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 |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 89 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 90 | O_NEXT_CLI=false |
| 91 | fi |
| 92 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 93 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 94 | 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] | 95 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 96 | else |
| 97 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 98 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 99 | fi |
| 100 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 101 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 102 | 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] | 103 | 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] | 104 | else |
| 105 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 106 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 107 | fi |
| 108 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 109 | TESTS=0 |
| 110 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 111 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 112 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 113 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 114 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 115 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 116 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 117 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 118 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 119 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 120 | RUN_TEST_NUMBER='' |
| 121 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 122 | PRESERVE_LOGS=0 |
| 123 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 124 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 125 | # port which is this plus 10000. Each port number may be independently |
| 126 | # overridden by a command line option. |
| 127 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 128 | PXY_PORT=$((SRV_PORT + 10000)) |
| 129 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 130 | print_usage() { |
| 131 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 132 | printf " -h|--help\tPrint this help.\n" |
| 133 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 134 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 135 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 136 | 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] | 137 | 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] | 138 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 139 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 140 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 141 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 142 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 143 | 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] | 144 | } |
| 145 | |
| 146 | get_options() { |
| 147 | while [ $# -gt 0 ]; do |
| 148 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 149 | -f|--filter) |
| 150 | shift; FILTER=$1 |
| 151 | ;; |
| 152 | -e|--exclude) |
| 153 | shift; EXCLUDE=$1 |
| 154 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 155 | -m|--memcheck) |
| 156 | MEMCHECK=1 |
| 157 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 158 | -n|--number) |
| 159 | shift; RUN_TEST_NUMBER=$1 |
| 160 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 161 | -s|--show-numbers) |
| 162 | SHOW_TEST_NUMBER=1 |
| 163 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 164 | -p|--preserve-logs) |
| 165 | PRESERVE_LOGS=1 |
| 166 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 167 | --port) |
| 168 | shift; SRV_PORT=$1 |
| 169 | ;; |
| 170 | --proxy-port) |
| 171 | shift; PXY_PORT=$1 |
| 172 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 173 | --seed) |
| 174 | shift; SEED="$1" |
| 175 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 176 | -h|--help) |
| 177 | print_usage |
| 178 | exit 0 |
| 179 | ;; |
| 180 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 181 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 182 | print_usage |
| 183 | exit 1 |
| 184 | ;; |
| 185 | esac |
| 186 | shift |
| 187 | done |
| 188 | } |
| 189 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 190 | # Make the outcome file path relative to the original directory, not |
| 191 | # to .../tests |
| 192 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 193 | [!/]*) |
| 194 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 195 | ;; |
| 196 | esac |
| 197 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 198 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 199 | # testing. Skip non-boolean options (with something other than spaces |
| 200 | # and a comment after "#define SYMBOL"). The variable contains a |
| 201 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 202 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 203 | # Skip next test; use this macro to skip tests which are legitimate |
| 204 | # in theory and expected to be re-introduced at some point, but |
| 205 | # aren't expected to succeed at the moment due to problems outside |
| 206 | # our control (such as bugs in other TLS implementations). |
| 207 | skip_next_test() { |
| 208 | SKIP_NEXT="YES" |
| 209 | } |
| 210 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 211 | # 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] | 212 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 213 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 214 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | *) SKIP_NEXT="YES";; |
| 216 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 217 | } |
| 218 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 219 | # 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] | 220 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 221 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 222 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 223 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 224 | } |
| 225 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 226 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 227 | # This function uses the query_config command line option to query the |
| 228 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 229 | # program. The command will always return a success value if the |
| 230 | # configuration is defined and the value will be printed to stdout. |
| 231 | # |
| 232 | # Note that if the configuration is not defined or is defined to nothing, |
| 233 | # the output of this function will be an empty string. |
| 234 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 235 | } |
| 236 | |
| 237 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 238 | VAL="$( get_config_value_or_default "$1" )" |
| 239 | if [ -z "$VAL" ]; then |
| 240 | # Should never happen |
| 241 | echo "Mbed TLS configuration $1 is not defined" |
| 242 | exit 1 |
| 243 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 244 | SKIP_NEXT="YES" |
| 245 | fi |
| 246 | } |
| 247 | |
| 248 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 249 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 250 | if [ -z "$VAL" ]; then |
| 251 | # Should never happen |
| 252 | echo "Mbed TLS configuration $1 is not defined" |
| 253 | exit 1 |
| 254 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 255 | SKIP_NEXT="YES" |
| 256 | fi |
| 257 | } |
| 258 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 259 | requires_config_value_equals() { |
| 260 | VAL=$( get_config_value_or_default "$1" ) |
| 261 | if [ -z "$VAL" ]; then |
| 262 | # Should never happen |
| 263 | echo "Mbed TLS configuration $1 is not defined" |
| 264 | exit 1 |
| 265 | elif [ "$VAL" -ne "$2" ]; then |
| 266 | SKIP_NEXT="YES" |
| 267 | fi |
| 268 | } |
| 269 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 270 | # Require Mbed TLS to support the given protocol version. |
| 271 | # |
| 272 | # Inputs: |
| 273 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 274 | requires_protocol_version() { |
| 275 | # Support for DTLS is detected separately in detect_dtls(). |
| 276 | case "$1" in |
| 277 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 278 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 279 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 280 | esac |
| 281 | } |
| 282 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 283 | # Space-separated list of ciphersuites supported by this build of |
| 284 | # Mbed TLS. |
| 285 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 286 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 287 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 288 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 289 | case $P_CIPHERSUITES in |
| 290 | *" $1 "*) :;; |
| 291 | *) SKIP_NEXT="YES";; |
| 292 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 293 | } |
| 294 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 295 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 296 | # If CMD (call to a TLS client or server program) requires certain features, |
| 297 | # arrange to only run the following test case if those features are enabled. |
| 298 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 299 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 300 | *\ force_version=*) |
| 301 | tmp="${1##*\ force_version=}" |
| 302 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 303 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 304 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 305 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 306 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 307 | *\ force_ciphersuite=*) |
| 308 | tmp="${1##*\ force_ciphersuite=}" |
| 309 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 310 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 311 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 312 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 313 | case " $1 " in |
| 314 | *[-_\ =]tickets=[^0]*) |
| 315 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 316 | esac |
| 317 | case " $1 " in |
| 318 | *[-_\ =]alpn=*) |
| 319 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 320 | esac |
| 321 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 322 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 323 | } |
| 324 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 325 | requires_certificate_authentication () { |
| 326 | if [ "$PSK_ONLY" = "YES" ]; then |
| 327 | SKIP_NEXT="YES" |
| 328 | fi |
| 329 | } |
| 330 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 331 | adapt_cmd_for_psk () { |
| 332 | case "$2" in |
| 333 | *openssl*) s='-psk abc123 -nocert';; |
| 334 | *gnutls-*) s='--pskkey=abc123';; |
| 335 | *) s='psk=abc123';; |
| 336 | esac |
| 337 | eval $1='"$2 $s"' |
| 338 | unset s |
| 339 | } |
| 340 | |
| 341 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 342 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 343 | # |
| 344 | # If not running in a PSK-only build, do nothing. |
| 345 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 346 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 347 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 348 | # a pre-shared key, do nothing. |
| 349 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 350 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 351 | # |
| 352 | # Inputs: |
| 353 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 354 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 355 | # * "$@": options passed to run_test. |
| 356 | # |
| 357 | # Outputs: |
| 358 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 359 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 360 | maybe_adapt_for_psk() { |
| 361 | if [ "$PSK_ONLY" != "YES" ]; then |
| 362 | return |
| 363 | fi |
| 364 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 365 | return |
| 366 | fi |
| 367 | case "$CLI_CMD $SRV_CMD" in |
| 368 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 369 | return;; |
| 370 | *force_ciphersuite*) |
| 371 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 372 | # PSK cipher suite could be substituted, but we're not ready for |
| 373 | # that yet. |
| 374 | SKIP_NEXT="YES" |
| 375 | return;; |
| 376 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 377 | # The test case involves certificates. PSK won't do. |
| 378 | SKIP_NEXT="YES" |
| 379 | return;; |
| 380 | esac |
| 381 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 382 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 383 | } |
| 384 | |
| 385 | case " $CONFIGS_ENABLED " in |
| 386 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 387 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 388 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 389 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 390 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 391 | *) PSK_ONLY="NO";; |
| 392 | esac |
| 393 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 394 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 395 | requires_openssl_with_fallback_scsv() { |
| 396 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 397 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 398 | then |
| 399 | OPENSSL_HAS_FBSCSV="YES" |
| 400 | else |
| 401 | OPENSSL_HAS_FBSCSV="NO" |
| 402 | fi |
| 403 | fi |
| 404 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 405 | SKIP_NEXT="YES" |
| 406 | fi |
| 407 | } |
| 408 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 409 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 410 | requires_max_content_len() { |
| 411 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 412 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 413 | } |
| 414 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 415 | # skip next test if GnuTLS isn't available |
| 416 | requires_gnutls() { |
| 417 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 418 | 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] | 419 | GNUTLS_AVAILABLE="YES" |
| 420 | else |
| 421 | GNUTLS_AVAILABLE="NO" |
| 422 | fi |
| 423 | fi |
| 424 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 425 | SKIP_NEXT="YES" |
| 426 | fi |
| 427 | } |
| 428 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 429 | # skip next test if GnuTLS-next isn't available |
| 430 | requires_gnutls_next() { |
| 431 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 432 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 433 | GNUTLS_NEXT_AVAILABLE="YES" |
| 434 | else |
| 435 | GNUTLS_NEXT_AVAILABLE="NO" |
| 436 | fi |
| 437 | fi |
| 438 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 439 | SKIP_NEXT="YES" |
| 440 | fi |
| 441 | } |
| 442 | |
| 443 | # skip next test if OpenSSL-legacy isn't available |
| 444 | requires_openssl_legacy() { |
| 445 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 446 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 447 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 448 | else |
| 449 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 450 | fi |
| 451 | fi |
| 452 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 453 | SKIP_NEXT="YES" |
| 454 | fi |
| 455 | } |
| 456 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 457 | requires_openssl_next() { |
| 458 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 459 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 460 | OPENSSL_NEXT_AVAILABLE="YES" |
| 461 | else |
| 462 | OPENSSL_NEXT_AVAILABLE="NO" |
| 463 | fi |
| 464 | fi |
| 465 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 466 | SKIP_NEXT="YES" |
| 467 | fi |
| 468 | } |
| 469 | |
| 470 | # skip next test if tls1_3 is not available |
| 471 | requires_openssl_tls1_3() { |
| 472 | requires_openssl_next |
| 473 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 474 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 475 | fi |
| 476 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 477 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 478 | then |
| 479 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 480 | else |
| 481 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 482 | fi |
| 483 | fi |
| 484 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 485 | SKIP_NEXT="YES" |
| 486 | fi |
| 487 | } |
| 488 | |
| 489 | # skip next test if tls1_3 is not available |
| 490 | requires_gnutls_tls1_3() { |
| 491 | requires_gnutls_next |
| 492 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 493 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 494 | fi |
| 495 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 496 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 497 | then |
| 498 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 499 | else |
| 500 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 501 | fi |
| 502 | fi |
| 503 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 504 | SKIP_NEXT="YES" |
| 505 | fi |
| 506 | } |
| 507 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 508 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 509 | requires_gnutls_next_no_ticket() { |
| 510 | requires_gnutls_next |
| 511 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 512 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 513 | fi |
| 514 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 515 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 516 | then |
| 517 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 518 | else |
| 519 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 520 | fi |
| 521 | fi |
| 522 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 523 | SKIP_NEXT="YES" |
| 524 | fi |
| 525 | } |
| 526 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 527 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 528 | requires_gnutls_next_disable_tls13_compat() { |
| 529 | requires_gnutls_next |
| 530 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 531 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 532 | fi |
| 533 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 534 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 535 | then |
| 536 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 537 | else |
| 538 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 539 | fi |
| 540 | fi |
| 541 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 542 | SKIP_NEXT="YES" |
| 543 | fi |
| 544 | } |
| 545 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 546 | # skip next test if IPv6 isn't available on this host |
| 547 | requires_ipv6() { |
| 548 | if [ -z "${HAS_IPV6:-}" ]; then |
| 549 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 550 | SRV_PID=$! |
| 551 | sleep 1 |
| 552 | kill $SRV_PID >/dev/null 2>&1 |
| 553 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 554 | HAS_IPV6="NO" |
| 555 | else |
| 556 | HAS_IPV6="YES" |
| 557 | fi |
| 558 | rm -r $SRV_OUT |
| 559 | fi |
| 560 | |
| 561 | if [ "$HAS_IPV6" = "NO" ]; then |
| 562 | SKIP_NEXT="YES" |
| 563 | fi |
| 564 | } |
| 565 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 566 | # skip next test if it's i686 or uname is not available |
| 567 | requires_not_i686() { |
| 568 | if [ -z "${IS_I686:-}" ]; then |
| 569 | IS_I686="YES" |
| 570 | if which "uname" >/dev/null 2>&1; then |
| 571 | if [ -z "$(uname -a | grep i686)" ]; then |
| 572 | IS_I686="NO" |
| 573 | fi |
| 574 | fi |
| 575 | fi |
| 576 | if [ "$IS_I686" = "YES" ]; then |
| 577 | SKIP_NEXT="YES" |
| 578 | fi |
| 579 | } |
| 580 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 581 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 582 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 583 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 584 | 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] | 585 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 586 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 587 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 588 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 589 | fi |
| 590 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 591 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 592 | fi |
| 593 | |
| 594 | # skip the next test if the SSL output buffer is less than 16KB |
| 595 | requires_full_size_output_buffer() { |
| 596 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 597 | SKIP_NEXT="YES" |
| 598 | fi |
| 599 | } |
| 600 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 601 | # skip the next test if valgrind is in use |
| 602 | not_with_valgrind() { |
| 603 | if [ "$MEMCHECK" -gt 0 ]; then |
| 604 | SKIP_NEXT="YES" |
| 605 | fi |
| 606 | } |
| 607 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 608 | # skip the next test if valgrind is NOT in use |
| 609 | only_with_valgrind() { |
| 610 | if [ "$MEMCHECK" -eq 0 ]; then |
| 611 | SKIP_NEXT="YES" |
| 612 | fi |
| 613 | } |
| 614 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 615 | # 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] | 616 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 617 | CLI_DELAY_FACTOR=$1 |
| 618 | } |
| 619 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 620 | # wait for the given seconds after the client finished in the next test |
| 621 | server_needs_more_time() { |
| 622 | SRV_DELAY_SECONDS=$1 |
| 623 | } |
| 624 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 625 | # print_name <name> |
| 626 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 627 | TESTS=$(( $TESTS + 1 )) |
| 628 | LINE="" |
| 629 | |
| 630 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 631 | LINE="$TESTS " |
| 632 | fi |
| 633 | |
| 634 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 635 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 636 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 637 | for i in `seq 1 $LEN`; do printf '.'; done |
| 638 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 639 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 640 | } |
| 641 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 642 | # record_outcome <outcome> [<failure-reason>] |
| 643 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 644 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 645 | record_outcome() { |
| 646 | echo "$1" |
| 647 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 648 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 649 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 650 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 651 | "$1" "${2-}" \ |
| 652 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 653 | fi |
| 654 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 655 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 656 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 657 | # True if the presence of the given pattern in a log definitely indicates |
| 658 | # that the test has failed. False if the presence is inconclusive. |
| 659 | # |
| 660 | # Inputs: |
| 661 | # * $1: pattern found in the logs |
| 662 | # * $TIMES_LEFT: >0 if retrying is an option |
| 663 | # |
| 664 | # Outputs: |
| 665 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 666 | # unchanged otherwise. |
| 667 | # * Return value: 1 if the pattern is inconclusive, |
| 668 | # 0 if the failure is definitive. |
| 669 | log_pattern_presence_is_conclusive() { |
| 670 | # If we've run out of attempts, then don't retry no matter what. |
| 671 | if [ $TIMES_LEFT -eq 0 ]; then |
| 672 | return 0 |
| 673 | fi |
| 674 | case $1 in |
| 675 | "resend") |
| 676 | # An undesired resend may have been caused by the OS dropping or |
| 677 | # delaying a packet at an inopportune time. |
| 678 | outcome="RETRY(resend)" |
| 679 | return 1;; |
| 680 | esac |
| 681 | } |
| 682 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 683 | # fail <message> |
| 684 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 685 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 686 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 687 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 688 | mv $SRV_OUT o-srv-${TESTS}.log |
| 689 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 690 | if [ -n "$PXY_CMD" ]; then |
| 691 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 692 | fi |
| 693 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 694 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 695 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 696 | echo " ! server output:" |
| 697 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 698 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 699 | echo " ! client output:" |
| 700 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 701 | if [ -n "$PXY_CMD" ]; then |
| 702 | echo " ! ========================================================" |
| 703 | echo " ! proxy output:" |
| 704 | cat o-pxy-${TESTS}.log |
| 705 | fi |
| 706 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 707 | fi |
| 708 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 709 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 710 | } |
| 711 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 712 | # is_polar <cmd_line> |
| 713 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 714 | case "$1" in |
| 715 | *ssl_client2*) true;; |
| 716 | *ssl_server2*) true;; |
| 717 | *) false;; |
| 718 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 719 | } |
| 720 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 721 | # openssl s_server doesn't have -www with DTLS |
| 722 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 723 | case "$SRV_CMD" in |
| 724 | *s_server*-dtls*) |
| 725 | NEEDS_INPUT=1 |
| 726 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 727 | *) NEEDS_INPUT=0;; |
| 728 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 729 | } |
| 730 | |
| 731 | # provide input to commands that need it |
| 732 | provide_input() { |
| 733 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 734 | return |
| 735 | fi |
| 736 | |
| 737 | while true; do |
| 738 | echo "HTTP/1.0 200 OK" |
| 739 | sleep 1 |
| 740 | done |
| 741 | } |
| 742 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 743 | # has_mem_err <log_file_name> |
| 744 | has_mem_err() { |
| 745 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 746 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 747 | then |
| 748 | return 1 # false: does not have errors |
| 749 | else |
| 750 | return 0 # true: has errors |
| 751 | fi |
| 752 | } |
| 753 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 754 | # 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] | 755 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 756 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 757 | newline=' |
| 758 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 759 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 760 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 761 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 762 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 763 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 764 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 765 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 766 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 767 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 768 | # When we use a proxy, it will be listening on the same port we |
| 769 | # 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] | 770 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 771 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 772 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 773 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 774 | echo "$3 START TIMEOUT" |
| 775 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 776 | break |
| 777 | fi |
| 778 | # Linux and *BSD support decimal arguments to sleep. On other |
| 779 | # OSes this may be a tight loop. |
| 780 | sleep 0.1 2>/dev/null || true |
| 781 | done |
| 782 | } |
| 783 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 784 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 785 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 786 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 787 | } |
| 788 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 789 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 790 | # Wait for server process $2 to be listening on port $1. |
| 791 | wait_server_start() { |
| 792 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 793 | } |
| 794 | |
| 795 | # Wait for proxy process $2 to be listening on port $1. |
| 796 | wait_proxy_start() { |
| 797 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 798 | } |
| 799 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 800 | # 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] | 801 | # 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] | 802 | # acceptable bounds |
| 803 | check_server_hello_time() { |
| 804 | # 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] | 805 | 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] | 806 | # Get the Unix timestamp for now |
| 807 | CUR_TIME=$(date +'%s') |
| 808 | THRESHOLD_IN_SECS=300 |
| 809 | |
| 810 | # Check if the ServerHello time was printed |
| 811 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 812 | return 1 |
| 813 | fi |
| 814 | |
| 815 | # Check the time in ServerHello is within acceptable bounds |
| 816 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 817 | # The time in ServerHello is at least 5 minutes before now |
| 818 | return 1 |
| 819 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 820 | # 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] | 821 | return 1 |
| 822 | else |
| 823 | return 0 |
| 824 | fi |
| 825 | } |
| 826 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 827 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 828 | handshake_memory_get() { |
| 829 | OUTPUT_VARIABLE="$1" |
| 830 | OUTPUT_FILE="$2" |
| 831 | |
| 832 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 833 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 834 | |
| 835 | # Check if memory usage was read |
| 836 | if [ -z "$MEM_USAGE" ]; then |
| 837 | echo "Error: Can not read the value of handshake memory usage" |
| 838 | return 1 |
| 839 | else |
| 840 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 841 | return 0 |
| 842 | fi |
| 843 | } |
| 844 | |
| 845 | # Get handshake memory usage from server or client output and check if this value |
| 846 | # is not higher than the maximum given by the first argument |
| 847 | handshake_memory_check() { |
| 848 | MAX_MEMORY="$1" |
| 849 | OUTPUT_FILE="$2" |
| 850 | |
| 851 | # Get memory usage |
| 852 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 853 | return 1 |
| 854 | fi |
| 855 | |
| 856 | # Check if memory usage is below max value |
| 857 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 858 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 859 | "but should be below $MAX_MEMORY bytes" |
| 860 | return 1 |
| 861 | else |
| 862 | return 0 |
| 863 | fi |
| 864 | } |
| 865 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 866 | # wait for client to terminate and set CLI_EXIT |
| 867 | # must be called right after starting the client |
| 868 | wait_client_done() { |
| 869 | CLI_PID=$! |
| 870 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 871 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 872 | CLI_DELAY_FACTOR=1 |
| 873 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 874 | ( 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] | 875 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 876 | |
| 877 | wait $CLI_PID |
| 878 | CLI_EXIT=$? |
| 879 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 880 | kill $DOG_PID >/dev/null 2>&1 |
| 881 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 882 | |
| 883 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 884 | |
| 885 | sleep $SRV_DELAY_SECONDS |
| 886 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 887 | } |
| 888 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 889 | # check if the given command uses dtls and sets global variable DTLS |
| 890 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 891 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 892 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 893 | *) DTLS=0;; |
| 894 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 895 | } |
| 896 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 897 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 898 | is_gnutls() { |
| 899 | case "$1" in |
| 900 | *gnutls-cli*) |
| 901 | CMD_IS_GNUTLS=1 |
| 902 | ;; |
| 903 | *gnutls-serv*) |
| 904 | CMD_IS_GNUTLS=1 |
| 905 | ;; |
| 906 | *) |
| 907 | CMD_IS_GNUTLS=0 |
| 908 | ;; |
| 909 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 910 | } |
| 911 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 912 | # Determine what calc_verify trace is to be expected, if any. |
| 913 | # |
| 914 | # calc_verify is only called for two things: to calculate the |
| 915 | # extended master secret, and to process client authentication. |
| 916 | # |
| 917 | # Warning: the current implementation assumes that extended_ms is not |
| 918 | # disabled on the client or on the server. |
| 919 | # |
| 920 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 921 | # * $1: the value of the server auth_mode parameter. |
| 922 | # 'required' if client authentication is expected, |
| 923 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 924 | # * $CONFIGS_ENABLED |
| 925 | # |
| 926 | # Outputs: |
| 927 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 928 | set_maybe_calc_verify() { |
| 929 | maybe_calc_verify= |
| 930 | case $CONFIGS_ENABLED in |
| 931 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 932 | *) |
| 933 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 934 | ''|none) return;; |
| 935 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 936 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 937 | esac |
| 938 | esac |
| 939 | case $CONFIGS_ENABLED in |
| 940 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 941 | *) maybe_calc_verify="<= calc verify";; |
| 942 | esac |
| 943 | } |
| 944 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 945 | # Compare file content |
| 946 | # Usage: find_in_both pattern file1 file2 |
| 947 | # extract from file1 the first line matching the pattern |
| 948 | # check in file2 that the same line can be found |
| 949 | find_in_both() { |
| 950 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 951 | if [ -z "$srv_pattern" ]; then |
| 952 | return 1; |
| 953 | fi |
| 954 | |
| 955 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 956 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 957 | else |
| 958 | return 1; |
| 959 | fi |
| 960 | } |
| 961 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 962 | SKIP_HANDSHAKE_CHECK="NO" |
| 963 | skip_handshake_stage_check() { |
| 964 | SKIP_HANDSHAKE_CHECK="YES" |
| 965 | } |
| 966 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 967 | # Analyze the commands that will be used in a test. |
| 968 | # |
| 969 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 970 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 971 | # |
| 972 | # Inputs: |
| 973 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 974 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 975 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 976 | # |
| 977 | # Outputs: |
| 978 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 979 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 980 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 981 | # 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] | 982 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 983 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 984 | case " $SRV_CMD " in |
| 985 | *' server_addr=::1 '*) |
| 986 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 987 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 988 | fi |
| 989 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 990 | # update CMD_IS_GNUTLS variable |
| 991 | is_gnutls "$SRV_CMD" |
| 992 | |
| 993 | # if the server uses gnutls but doesn't set priority, explicitly |
| 994 | # set the default priority |
| 995 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 996 | case "$SRV_CMD" in |
| 997 | *--priority*) :;; |
| 998 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 999 | esac |
| 1000 | fi |
| 1001 | |
| 1002 | # update CMD_IS_GNUTLS variable |
| 1003 | is_gnutls "$CLI_CMD" |
| 1004 | |
| 1005 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1006 | # set the default priority |
| 1007 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1008 | case "$CLI_CMD" in |
| 1009 | *--priority*) :;; |
| 1010 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1011 | esac |
| 1012 | fi |
| 1013 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1014 | # fix client port |
| 1015 | if [ -n "$PXY_CMD" ]; then |
| 1016 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1017 | else |
| 1018 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1019 | fi |
| 1020 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1021 | # prepend valgrind to our commands if active |
| 1022 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1023 | if is_polar "$SRV_CMD"; then |
| 1024 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1025 | fi |
| 1026 | if is_polar "$CLI_CMD"; then |
| 1027 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1028 | fi |
| 1029 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1030 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1031 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1032 | # Check for failure conditions after a test case. |
| 1033 | # |
| 1034 | # Inputs from run_test: |
| 1035 | # * positional parameters: test options (see run_test documentation) |
| 1036 | # * $CLI_EXIT: client return code |
| 1037 | # * $CLI_EXPECT: expected client return code |
| 1038 | # * $SRV_RET: server return code |
| 1039 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1040 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1041 | # |
| 1042 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1043 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1044 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1045 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1046 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1047 | if [ $TIMES_LEFT -gt 0 ] && |
| 1048 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1049 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1050 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1051 | return |
| 1052 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1053 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1054 | # 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] | 1055 | # (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] | 1056 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1057 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1058 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1059 | then |
| 1060 | if is_polar "$SRV_CMD"; then |
| 1061 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1062 | else |
| 1063 | fail "server or client failed to reach handshake stage" |
| 1064 | return |
| 1065 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1066 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1067 | if is_polar "$CLI_CMD"; then |
| 1068 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1069 | else |
| 1070 | fail "server or client failed to reach handshake stage" |
| 1071 | return |
| 1072 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1073 | fi |
| 1074 | fi |
| 1075 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1076 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1077 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1078 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1079 | # care anyway), in case e.g. the server reports a memory leak. |
| 1080 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1081 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1082 | return |
| 1083 | fi |
| 1084 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1085 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1086 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1087 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1088 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1089 | 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] | 1090 | return |
| 1091 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1092 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1093 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1094 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1095 | # 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] | 1096 | while [ $# -gt 0 ] |
| 1097 | do |
| 1098 | case $1 in |
| 1099 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1100 | 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] | 1101 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1102 | return |
| 1103 | fi |
| 1104 | ;; |
| 1105 | |
| 1106 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1107 | 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] | 1108 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1109 | return |
| 1110 | fi |
| 1111 | ;; |
| 1112 | |
| 1113 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1114 | 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] | 1115 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1116 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1117 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1118 | return |
| 1119 | fi |
| 1120 | ;; |
| 1121 | |
| 1122 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1123 | 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] | 1124 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1125 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1126 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1127 | return |
| 1128 | fi |
| 1129 | ;; |
| 1130 | |
| 1131 | # The filtering in the following two options (-u and -U) do the following |
| 1132 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1133 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1134 | # - keep one of each non-unique line |
| 1135 | # - count how many lines remain |
| 1136 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1137 | # if there were no duplicates. |
| 1138 | "-U") |
| 1139 | 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 |
| 1140 | fail "lines following pattern '$2' must be unique in Server output" |
| 1141 | return |
| 1142 | fi |
| 1143 | ;; |
| 1144 | |
| 1145 | "-u") |
| 1146 | 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 |
| 1147 | 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] | 1148 | return |
| 1149 | fi |
| 1150 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1151 | "-F") |
| 1152 | if ! $2 "$SRV_OUT"; then |
| 1153 | fail "function call to '$2' failed on Server output" |
| 1154 | return |
| 1155 | fi |
| 1156 | ;; |
| 1157 | "-f") |
| 1158 | if ! $2 "$CLI_OUT"; then |
| 1159 | fail "function call to '$2' failed on Client output" |
| 1160 | return |
| 1161 | fi |
| 1162 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1163 | "-g") |
| 1164 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1165 | fail "function call to '$2' failed on Server and Client output" |
| 1166 | return |
| 1167 | fi |
| 1168 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1169 | |
| 1170 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1171 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1172 | exit 1 |
| 1173 | esac |
| 1174 | shift 2 |
| 1175 | done |
| 1176 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1177 | # check valgrind's results |
| 1178 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1179 | 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] | 1180 | fail "Server has memory errors" |
| 1181 | return |
| 1182 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1183 | 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] | 1184 | fail "Client has memory errors" |
| 1185 | return |
| 1186 | fi |
| 1187 | fi |
| 1188 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1189 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1190 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1191 | } |
| 1192 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1193 | # Run the current test case: start the server and if applicable the proxy, run |
| 1194 | # the client, wait for all processes to finish or time out. |
| 1195 | # |
| 1196 | # Inputs: |
| 1197 | # * $NAME: test case name |
| 1198 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1199 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1200 | # |
| 1201 | # Outputs: |
| 1202 | # * $CLI_EXIT: client return code |
| 1203 | # * $SRV_RET: server return code |
| 1204 | do_run_test_once() { |
| 1205 | # run the commands |
| 1206 | if [ -n "$PXY_CMD" ]; then |
| 1207 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1208 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1209 | PXY_PID=$! |
| 1210 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1211 | fi |
| 1212 | |
| 1213 | check_osrv_dtls |
| 1214 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1215 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1216 | SRV_PID=$! |
| 1217 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1218 | |
| 1219 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1220 | # The client must be a subprocess of the script in order for killing it to |
| 1221 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1222 | # not at the end of the line: the latter approach will spawn eval as a |
| 1223 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1224 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1225 | wait_client_done |
| 1226 | |
| 1227 | sleep 0.05 |
| 1228 | |
| 1229 | # terminate the server (and the proxy) |
| 1230 | kill $SRV_PID |
| 1231 | wait $SRV_PID |
| 1232 | SRV_RET=$? |
| 1233 | |
| 1234 | if [ -n "$PXY_CMD" ]; then |
| 1235 | kill $PXY_PID >/dev/null 2>&1 |
| 1236 | wait $PXY_PID |
| 1237 | fi |
| 1238 | } |
| 1239 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1240 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1241 | # Options: -s pattern pattern that must be present in server output |
| 1242 | # -c pattern pattern that must be present in client output |
| 1243 | # -u pattern lines after pattern must be unique in client output |
| 1244 | # -f call shell function on client output |
| 1245 | # -S pattern pattern that must be absent in server output |
| 1246 | # -C pattern pattern that must be absent in client output |
| 1247 | # -U pattern lines after pattern must be unique in server output |
| 1248 | # -F call shell function on server output |
| 1249 | # -g call shell function on server and client output |
| 1250 | run_test() { |
| 1251 | NAME="$1" |
| 1252 | shift 1 |
| 1253 | |
| 1254 | if is_excluded "$NAME"; then |
| 1255 | SKIP_NEXT="NO" |
| 1256 | # There was no request to run the test, so don't record its outcome. |
| 1257 | return |
| 1258 | fi |
| 1259 | |
| 1260 | print_name "$NAME" |
| 1261 | |
| 1262 | # Do we only run numbered tests? |
| 1263 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1264 | case ",$RUN_TEST_NUMBER," in |
| 1265 | *",$TESTS,"*) :;; |
| 1266 | *) SKIP_NEXT="YES";; |
| 1267 | esac |
| 1268 | fi |
| 1269 | |
| 1270 | # does this test use a proxy? |
| 1271 | if [ "X$1" = "X-p" ]; then |
| 1272 | PXY_CMD="$2" |
| 1273 | shift 2 |
| 1274 | else |
| 1275 | PXY_CMD="" |
| 1276 | fi |
| 1277 | |
| 1278 | # get commands and client output |
| 1279 | SRV_CMD="$1" |
| 1280 | CLI_CMD="$2" |
| 1281 | CLI_EXPECT="$3" |
| 1282 | shift 3 |
| 1283 | |
| 1284 | # Check if test uses files |
| 1285 | case "$SRV_CMD $CLI_CMD" in |
| 1286 | *data_files/*) |
| 1287 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1288 | esac |
| 1289 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1290 | # Check if the test uses DTLS. |
| 1291 | detect_dtls "$SRV_CMD" |
| 1292 | if [ "$DTLS" -eq 1 ]; then |
| 1293 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1294 | fi |
| 1295 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1296 | # If the client or server requires certain features that can be detected |
| 1297 | # from their command-line arguments, check that they're enabled. |
| 1298 | detect_required_features "$SRV_CMD" "$@" |
| 1299 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1300 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1301 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1302 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1303 | |
| 1304 | # should we skip? |
| 1305 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1306 | SKIP_NEXT="NO" |
| 1307 | record_outcome "SKIP" |
| 1308 | SKIPS=$(( $SKIPS + 1 )) |
| 1309 | return |
| 1310 | fi |
| 1311 | |
| 1312 | analyze_test_commands "$@" |
| 1313 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1314 | # One regular run and two retries |
| 1315 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1316 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1317 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1318 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1319 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1320 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1321 | check_test_failure "$@" |
| 1322 | case $outcome in |
| 1323 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1324 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1325 | FAIL) return;; |
| 1326 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1327 | done |
| 1328 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1329 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1330 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1331 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1332 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1333 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1334 | if [ -n "$PXY_CMD" ]; then |
| 1335 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1336 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1337 | fi |
| 1338 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1339 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1340 | } |
| 1341 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1342 | run_test_psa() { |
| 1343 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1344 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1345 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1346 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1347 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1348 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1349 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1350 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1351 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1352 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1353 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1354 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1355 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1356 | -S "error" \ |
| 1357 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1358 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1359 | } |
| 1360 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1361 | run_test_psa_force_curve() { |
| 1362 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1363 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1364 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1365 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1366 | "$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] | 1367 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1368 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1369 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1370 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1371 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1372 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1373 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1374 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1375 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1376 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1377 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1378 | } |
| 1379 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1380 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1381 | # a maximum fragment length. |
| 1382 | # first argument ($1) is MFL for SSL client |
| 1383 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1384 | run_test_memory_after_hanshake_with_mfl() |
| 1385 | { |
| 1386 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1387 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1388 | |
| 1389 | # Leave some margin for robustness |
| 1390 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1391 | |
| 1392 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1393 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1394 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1395 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1396 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1397 | 0 \ |
| 1398 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1399 | } |
| 1400 | |
| 1401 | |
| 1402 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1403 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1404 | run_tests_memory_after_hanshake() |
| 1405 | { |
| 1406 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1407 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1408 | |
| 1409 | # first test with default MFU is to get reference memory usage |
| 1410 | MEMORY_USAGE_MFL_16K=0 |
| 1411 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1412 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1413 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1414 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1415 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1416 | 0 \ |
| 1417 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1418 | |
| 1419 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1420 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1421 | |
| 1422 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1423 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1424 | |
| 1425 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1426 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1427 | |
| 1428 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1429 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1430 | } |
| 1431 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1432 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1433 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1434 | rm -f context_srv.txt |
| 1435 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1436 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1437 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1438 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1439 | 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] | 1440 | exit 1 |
| 1441 | } |
| 1442 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1443 | # |
| 1444 | # MAIN |
| 1445 | # |
| 1446 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1447 | get_options "$@" |
| 1448 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1449 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1450 | # patterns rather than regular expressions, use a case statement instead |
| 1451 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1452 | # detects simple cases: plain substring, everything, nothing. |
| 1453 | # |
| 1454 | # As an exception, the character '.' is treated as an ordinary character |
| 1455 | # if it is the only special character in the string. This is because it's |
| 1456 | # rare to need "any one character", but needing a literal '.' is common |
| 1457 | # (e.g. '-f "DTLS 1.2"'). |
| 1458 | need_grep= |
| 1459 | case "$FILTER" in |
| 1460 | '^$') simple_filter=;; |
| 1461 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1462 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1463 | need_grep=1;; |
| 1464 | *) # No regexp or shell-pattern special character |
| 1465 | simple_filter="*$FILTER*";; |
| 1466 | esac |
| 1467 | case "$EXCLUDE" in |
| 1468 | '^$') simple_exclude=;; |
| 1469 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1470 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1471 | need_grep=1;; |
| 1472 | *) # No regexp or shell-pattern special character |
| 1473 | simple_exclude="*$EXCLUDE*";; |
| 1474 | esac |
| 1475 | if [ -n "$need_grep" ]; then |
| 1476 | is_excluded () { |
| 1477 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1478 | } |
| 1479 | else |
| 1480 | is_excluded () { |
| 1481 | case "$1" in |
| 1482 | $simple_exclude) true;; |
| 1483 | $simple_filter) false;; |
| 1484 | *) true;; |
| 1485 | esac |
| 1486 | } |
| 1487 | fi |
| 1488 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1489 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1490 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1491 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1492 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1493 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1494 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1495 | exit 1 |
| 1496 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1497 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1498 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1499 | exit 1 |
| 1500 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1501 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1502 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1503 | exit 1 |
| 1504 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1505 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1506 | if which valgrind >/dev/null 2>&1; then :; else |
| 1507 | echo "Memcheck not possible. Valgrind not found" |
| 1508 | exit 1 |
| 1509 | fi |
| 1510 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1511 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1512 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1513 | exit 1 |
| 1514 | fi |
| 1515 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1516 | # used by watchdog |
| 1517 | MAIN_PID="$$" |
| 1518 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1519 | # We use somewhat arbitrary delays for tests: |
| 1520 | # - how long do we wait for the server to start (when lsof not available)? |
| 1521 | # - how long do we allow for the client to finish? |
| 1522 | # (not to check performance, just to avoid waiting indefinitely) |
| 1523 | # Things are slower with valgrind, so give extra time here. |
| 1524 | # |
| 1525 | # Note: without lsof, there is a trade-off between the running time of this |
| 1526 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1527 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1528 | # 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] | 1529 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1530 | START_DELAY=6 |
| 1531 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1532 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1533 | START_DELAY=2 |
| 1534 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1535 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1536 | |
| 1537 | # some particular tests need more time: |
| 1538 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1539 | # - for the server, we sleep for a number of seconds after the client exits |
| 1540 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1541 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1542 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1543 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1544 | # 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] | 1545 | # +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] | 1546 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1547 | # 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] | 1548 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1549 | 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] | 1550 | 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] | 1551 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1552 | 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] | 1553 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1554 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1555 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1556 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1557 | 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] | 1558 | 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] | 1559 | fi |
| 1560 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1561 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1562 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1563 | 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] | 1564 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1565 | 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] | 1566 | fi |
| 1567 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1568 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1569 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1570 | 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] | 1571 | fi |
| 1572 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1573 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1574 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1575 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1576 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1577 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1578 | # Allow SHA-1, because many of our test certificates use it |
| 1579 | P_SRV="$P_SRV allow_sha1=1" |
| 1580 | P_CLI="$P_CLI allow_sha1=1" |
| 1581 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1582 | # Also pick a unique name for intermediate files |
| 1583 | SRV_OUT="srv_out.$$" |
| 1584 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1585 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1586 | SESSION="session.$$" |
| 1587 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1588 | SKIP_NEXT="NO" |
| 1589 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1590 | trap cleanup INT TERM HUP |
| 1591 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1592 | # Basic test |
| 1593 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1594 | # Checks that: |
| 1595 | # - 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] | 1596 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1598 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1599 | requires_config_enabled MBEDTLS_SHA512_C # "signature_algorithm ext: 6" |
| 1600 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1601 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1602 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1603 | "$P_CLI" \ |
| 1604 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1605 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1606 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1607 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1608 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1609 | -S "error" \ |
| 1610 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1611 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1613 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1614 | run_test "Default, DTLS" \ |
| 1615 | "$P_SRV dtls=1" \ |
| 1616 | "$P_CLI dtls=1" \ |
| 1617 | 0 \ |
| 1618 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1619 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1620 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1622 | run_test "TLS client auth: required" \ |
| 1623 | "$P_SRV auth_mode=required" \ |
| 1624 | "$P_CLI" \ |
| 1625 | 0 \ |
| 1626 | -s "Verifying peer X.509 certificate... ok" |
| 1627 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1629 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1630 | "$P_SRV" \ |
| 1631 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1632 | 0 \ |
| 1633 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1634 | -c "Key size is 256" |
| 1635 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1637 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1638 | "$P_SRV" \ |
| 1639 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1640 | 0 \ |
| 1641 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1642 | -c "Key size is 128" |
| 1643 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1645 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1646 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1647 | requires_config_enabled MBEDTLS_SHA256_C |
| 1648 | run_test "TLS: password protected client key" \ |
| 1649 | "$P_SRV auth_mode=required" \ |
| 1650 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1651 | 0 |
| 1652 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1654 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1655 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1656 | requires_config_enabled MBEDTLS_SHA256_C |
| 1657 | run_test "TLS: password protected server key" \ |
| 1658 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1659 | "$P_CLI" \ |
| 1660 | 0 |
| 1661 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1663 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1664 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1665 | requires_config_enabled MBEDTLS_RSA_C |
| 1666 | requires_config_enabled MBEDTLS_SHA256_C |
| 1667 | run_test "TLS: password protected server key, two certificates" \ |
| 1668 | "$P_SRV \ |
| 1669 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1670 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1671 | "$P_CLI" \ |
| 1672 | 0 |
| 1673 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1675 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1676 | run_test "CA callback on client" \ |
| 1677 | "$P_SRV debug_level=3" \ |
| 1678 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1679 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1680 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1681 | -S "error" \ |
| 1682 | -C "error" |
| 1683 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1685 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1686 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1687 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1688 | requires_config_enabled MBEDTLS_SHA256_C |
| 1689 | run_test "CA callback on server" \ |
| 1690 | "$P_SRV auth_mode=required" \ |
| 1691 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1692 | key_file=data_files/server5.key" \ |
| 1693 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1694 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1695 | -s "Verifying peer X.509 certificate... ok" \ |
| 1696 | -S "error" \ |
| 1697 | -C "error" |
| 1698 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1699 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1701 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1702 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1703 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1704 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1705 | run_test "TLS-ECDHE-ECDSA Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1706 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1707 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1708 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1709 | key_file=data_files/server5.key" \ |
| 1710 | 0 \ |
| 1711 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1712 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1713 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1714 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1715 | -S "error" \ |
| 1716 | -C "error" |
| 1717 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1718 | # Test using a RSA opaque private key for client authentication |
| 1719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1720 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1721 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1722 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1723 | requires_config_enabled MBEDTLS_RSA_C |
| 1724 | requires_config_enabled MBEDTLS_SHA256_C |
| 1725 | run_test "TLS-ECDHE-RSA Opaque key for client authentication" \ |
| 1726 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1727 | key_file=data_files/server2.key" \ |
| 1728 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1729 | key_file=data_files/server2.key" \ |
| 1730 | 0 \ |
| 1731 | -c "key type: Opaque" \ |
| 1732 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1733 | -s "Verifying peer X.509 certificate... ok" \ |
| 1734 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1735 | -S "error" \ |
| 1736 | -C "error" |
| 1737 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1739 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1740 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1741 | requires_config_enabled MBEDTLS_RSA_C |
| 1742 | requires_config_enabled MBEDTLS_SHA256_C |
| 1743 | run_test "TLS-DHE-RSA Opaque key for client authentication" \ |
| 1744 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1745 | key_file=data_files/server2.key" \ |
| 1746 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1747 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1748 | 0 \ |
| 1749 | -c "key type: Opaque" \ |
| 1750 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1751 | -s "Verifying peer X.509 certificate... ok" \ |
| 1752 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1753 | -S "error" \ |
| 1754 | -C "error" |
| 1755 | |
Przemek Stekiel | 8da6da3 | 2022-05-16 14:37:50 +0200 | [diff] [blame] | 1756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1757 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1758 | requires_config_enabled MBEDTLS_RSA_C |
| 1759 | run_test "RSA opaque key on server configured for decryption" \ |
| 1760 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ |
| 1761 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
| 1762 | 0 \ |
| 1763 | -c "Verifying peer X.509 certificate... ok" \ |
| 1764 | -c "Ciphersuite is TLS-RSA-" \ |
| 1765 | -s "key types: Opaque, Opaque" \ |
| 1766 | -s "Ciphersuite is TLS-RSA-" \ |
| 1767 | -S "error" \ |
| 1768 | -C "error" |
| 1769 | |
| 1770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1771 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1772 | requires_config_enabled MBEDTLS_RSA_C |
| 1773 | run_test "RSA-PSK opaque key on server configured for decryption" \ |
| 1774 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 1775 | psk=abc123 psk_identity=foo" \ |
| 1776 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 1777 | psk=abc123 psk_identity=foo" \ |
| 1778 | 0 \ |
| 1779 | -c "Verifying peer X.509 certificate... ok" \ |
| 1780 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 1781 | -s "key types: Opaque, Opaque" \ |
| 1782 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 1783 | -S "error" \ |
| 1784 | -C "error" |
| 1785 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1786 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1788 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1789 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1790 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1791 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1792 | run_test "TLS-ECDHE-ECDSA Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1793 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1794 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1795 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1796 | key_file=data_files/server5.key" \ |
| 1797 | 0 \ |
| 1798 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1799 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1800 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1801 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1802 | -S "error" \ |
| 1803 | -C "error" |
| 1804 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1806 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1807 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1808 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1809 | requires_config_enabled MBEDTLS_SHA256_C |
| 1810 | run_test "Opaque key for server authentication (ECDH-)" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1811 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1812 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1813 | key_file=data_files/server5.key" \ |
| 1814 | "$P_CLI" \ |
| 1815 | 0 \ |
| 1816 | -c "Verifying peer X.509 certificate... ok" \ |
| 1817 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1818 | -s "key types: Opaque, none" \ |
| 1819 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1820 | -S "error" \ |
| 1821 | -C "error" |
| 1822 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1823 | # Test using a RSA opaque private key for server authentication |
| 1824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1825 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1826 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1827 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1828 | requires_config_enabled MBEDTLS_RSA_C |
| 1829 | requires_config_enabled MBEDTLS_SHA256_C |
| 1830 | run_test "TLS-ECDHE-RSA Opaque key for server authentication" \ |
| 1831 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1832 | key_file=data_files/server2.key" \ |
| 1833 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 1834 | key_file=data_files/server2.key" \ |
| 1835 | 0 \ |
| 1836 | -c "Verifying peer X.509 certificate... ok" \ |
| 1837 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1838 | -s "key types: Opaque, none" \ |
| 1839 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1840 | -S "error" \ |
| 1841 | -C "error" |
| 1842 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1844 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1845 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1846 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1847 | requires_config_enabled MBEDTLS_RSA_C |
| 1848 | requires_config_enabled MBEDTLS_SHA256_C |
| 1849 | run_test "TLS-DHE-RSA Opaque key for server authentication" \ |
| 1850 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1851 | key_file=data_files/server2.key" \ |
| 1852 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 1853 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1854 | 0 \ |
| 1855 | -c "Verifying peer X.509 certificate... ok" \ |
| 1856 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1857 | -s "key types: Opaque, none" \ |
| 1858 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1859 | -S "error" \ |
| 1860 | -C "error" |
| 1861 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1862 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1864 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1865 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1866 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1867 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1868 | run_test "TLS-ECDHE-ECDSA Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1869 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1870 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1871 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1872 | key_file=data_files/server5.key" \ |
| 1873 | 0 \ |
| 1874 | -c "key type: Opaque" \ |
| 1875 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1876 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1877 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1878 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1879 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1880 | -S "error" \ |
| 1881 | -C "error" |
| 1882 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1883 | # Test using a RSA opaque private key for client/server authentication |
| 1884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1885 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1886 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1887 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1888 | requires_config_enabled MBEDTLS_RSA_C |
| 1889 | requires_config_enabled MBEDTLS_SHA256_C |
| 1890 | run_test "TLS-ECDHE-RSA Opaque key for client/server authentication" \ |
| 1891 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1892 | key_file=data_files/server2.key" \ |
| 1893 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1894 | key_file=data_files/server2.key" \ |
| 1895 | 0 \ |
| 1896 | -c "key type: Opaque" \ |
| 1897 | -c "Verifying peer X.509 certificate... ok" \ |
| 1898 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1899 | -s "key types: Opaque, none" \ |
| 1900 | -s "Verifying peer X.509 certificate... ok" \ |
| 1901 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1902 | -S "error" \ |
| 1903 | -C "error" |
| 1904 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1906 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1907 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1908 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1909 | requires_config_enabled MBEDTLS_RSA_C |
| 1910 | requires_config_enabled MBEDTLS_SHA256_C |
| 1911 | run_test "TLS-DHE-RSA Opaque key for client/server authentication" \ |
| 1912 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1913 | key_file=data_files/server2.key" \ |
| 1914 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1915 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1916 | 0 \ |
| 1917 | -c "key type: Opaque" \ |
| 1918 | -c "Verifying peer X.509 certificate... ok" \ |
| 1919 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1920 | -s "key types: Opaque, none" \ |
| 1921 | -s "Verifying peer X.509 certificate... ok" \ |
| 1922 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1923 | -S "error" \ |
| 1924 | -C "error" |
| 1925 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1926 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1927 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1928 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1929 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1930 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1931 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1932 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1933 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1934 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1935 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1936 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1937 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1938 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1939 | run_test_psa_force_curve "secp521r1" |
| 1940 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1941 | run_test_psa_force_curve "brainpoolP512r1" |
| 1942 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1943 | run_test_psa_force_curve "secp384r1" |
| 1944 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1945 | run_test_psa_force_curve "brainpoolP384r1" |
| 1946 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1947 | run_test_psa_force_curve "secp256r1" |
| 1948 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1949 | run_test_psa_force_curve "secp256k1" |
| 1950 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1951 | run_test_psa_force_curve "brainpoolP256r1" |
| 1952 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1953 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1954 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 1955 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1956 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1957 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1958 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1959 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1960 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1961 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1962 | run_test_psa_force_curve "secp192r1" |
| 1963 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1964 | run_test_psa_force_curve "secp192k1" |
| 1965 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1966 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1968 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1969 | run_test "ServerHello contains gmt_unix_time" \ |
| 1970 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1971 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1972 | 0 \ |
| 1973 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1974 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1975 | |
| 1976 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1978 | run_test "Unique IV in GCM" \ |
| 1979 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1980 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1981 | 0 \ |
| 1982 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1983 | -U "IV used" |
| 1984 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1985 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1987 | run_test "Configuration-specific CRT verification callback" \ |
| 1988 | "$P_SRV debug_level=3" \ |
| 1989 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1990 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1991 | -S "error" \ |
| 1992 | -c "Verify requested for " \ |
| 1993 | -c "Use configuration-specific verification callback" \ |
| 1994 | -C "Use context-specific verification callback" \ |
| 1995 | -C "error" |
| 1996 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1998 | run_test "Context-specific CRT verification callback" \ |
| 1999 | "$P_SRV debug_level=3" \ |
| 2000 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 2001 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2002 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2003 | -c "Verify requested for " \ |
| 2004 | -c "Use context-specific verification callback" \ |
| 2005 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2006 | -C "error" |
| 2007 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2008 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2010 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2011 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2012 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2013 | 1 \ |
| 2014 | -c "The certificate is signed with an unacceptable hash" |
| 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-1 explicitly allowed in server certificate" \ |
| 2018 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2019 | "$P_CLI allow_sha1=1" \ |
| 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-256 allowed by default in server certificate" \ |
| 2024 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2025 | "$P_CLI allow_sha1=0" \ |
| 2026 | 0 |
| 2027 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2029 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2030 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2031 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2032 | 1 \ |
| 2033 | -s "The certificate is signed with an unacceptable hash" |
| 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-1 explicitly allowed in client certificate" \ |
| 2037 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2038 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2039 | 0 |
| 2040 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2041 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2042 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2043 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2044 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2045 | 0 |
| 2046 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2047 | # Dummy TLS 1.3 test |
| 2048 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2049 | # ssl_client2/ssl_server2 example programs works. |
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 only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2053 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2054 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 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: PSK-ephemeral only" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2059 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2060 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 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: Pure-ephemeral only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 2065 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2066 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 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 ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2071 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2072 | "$P_CLI tls13_kex_modes=ephemeral_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 PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2077 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2078 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2079 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2082 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2083 | "$P_SRV tls13_kex_modes=all" \ |
| 2084 | "$P_CLI tls13_kex_modes=all" \ |
| 2085 | 0 |
| 2086 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2087 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2089 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2090 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2091 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2092 | 0 \ |
| 2093 | -c "next record in same datagram" \ |
| 2094 | -s "next record in same datagram" |
| 2095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2097 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2098 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2099 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2100 | 0 \ |
| 2101 | -s "next record in same datagram" \ |
| 2102 | -C "next record in same datagram" |
| 2103 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2105 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2106 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2107 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2108 | 0 \ |
| 2109 | -S "next record in same datagram" \ |
| 2110 | -c "next record in same datagram" |
| 2111 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2113 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2114 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2115 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2116 | 0 \ |
| 2117 | -S "next record in same datagram" \ |
| 2118 | -C "next record in same datagram" |
| 2119 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2120 | # Tests for Context serialization |
| 2121 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2123 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2124 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2125 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2126 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2127 | 0 \ |
| 2128 | -c "Deserializing connection..." \ |
| 2129 | -S "Deserializing connection..." |
| 2130 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2132 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2133 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2134 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2135 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2136 | 0 \ |
| 2137 | -c "Deserializing connection..." \ |
| 2138 | -S "Deserializing connection..." |
| 2139 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2140 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2141 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2142 | run_test "Context serialization, client serializes, GCM" \ |
| 2143 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2144 | "$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] | 2145 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2146 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2147 | -S "Deserializing connection..." |
| 2148 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2150 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2151 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2152 | run_test "Context serialization, client serializes, with CID" \ |
| 2153 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2154 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2155 | 0 \ |
| 2156 | -c "Deserializing connection..." \ |
| 2157 | -S "Deserializing connection..." |
| 2158 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2160 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2161 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2162 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2163 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2164 | 0 \ |
| 2165 | -C "Deserializing connection..." \ |
| 2166 | -s "Deserializing connection..." |
| 2167 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2169 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2170 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2171 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2172 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2173 | 0 \ |
| 2174 | -C "Deserializing connection..." \ |
| 2175 | -s "Deserializing connection..." |
| 2176 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2179 | run_test "Context serialization, server serializes, GCM" \ |
| 2180 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2181 | "$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] | 2182 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2183 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2184 | -s "Deserializing connection..." |
| 2185 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2187 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2188 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2189 | run_test "Context serialization, server serializes, with CID" \ |
| 2190 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2191 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2192 | 0 \ |
| 2193 | -C "Deserializing connection..." \ |
| 2194 | -s "Deserializing connection..." |
| 2195 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2196 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2197 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2198 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2199 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2200 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2201 | 0 \ |
| 2202 | -c "Deserializing connection..." \ |
| 2203 | -s "Deserializing connection..." |
| 2204 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2206 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2207 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2208 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2209 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2210 | 0 \ |
| 2211 | -c "Deserializing connection..." \ |
| 2212 | -s "Deserializing connection..." |
| 2213 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2216 | run_test "Context serialization, both serialize, GCM" \ |
| 2217 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2218 | "$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] | 2219 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2220 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2221 | -s "Deserializing connection..." |
| 2222 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2224 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2225 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2226 | run_test "Context serialization, both serialize, with CID" \ |
| 2227 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2228 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2229 | 0 \ |
| 2230 | -c "Deserializing connection..." \ |
| 2231 | -s "Deserializing connection..." |
| 2232 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2234 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2235 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2236 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2237 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2238 | 0 \ |
| 2239 | -c "Deserializing connection..." \ |
| 2240 | -S "Deserializing connection..." |
| 2241 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2243 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2244 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2245 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2246 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2247 | 0 \ |
| 2248 | -c "Deserializing connection..." \ |
| 2249 | -S "Deserializing connection..." |
| 2250 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2252 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2253 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2254 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2255 | "$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] | 2256 | 0 \ |
| 2257 | -c "Deserializing connection..." \ |
| 2258 | -S "Deserializing connection..." |
| 2259 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2261 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2262 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2263 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2264 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2265 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2266 | 0 \ |
| 2267 | -c "Deserializing connection..." \ |
| 2268 | -S "Deserializing connection..." |
| 2269 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2271 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2272 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2273 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2274 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2275 | 0 \ |
| 2276 | -C "Deserializing connection..." \ |
| 2277 | -s "Deserializing connection..." |
| 2278 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2281 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2282 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2283 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2284 | 0 \ |
| 2285 | -C "Deserializing connection..." \ |
| 2286 | -s "Deserializing connection..." |
| 2287 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2289 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2290 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2291 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2292 | "$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] | 2293 | 0 \ |
| 2294 | -C "Deserializing connection..." \ |
| 2295 | -s "Deserializing connection..." |
| 2296 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2298 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2299 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2300 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2301 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2302 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2303 | 0 \ |
| 2304 | -C "Deserializing connection..." \ |
| 2305 | -s "Deserializing connection..." |
| 2306 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2307 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2308 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2309 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2310 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2311 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2312 | 0 \ |
| 2313 | -c "Deserializing connection..." \ |
| 2314 | -s "Deserializing connection..." |
| 2315 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2317 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2318 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2319 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2320 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2321 | 0 \ |
| 2322 | -c "Deserializing connection..." \ |
| 2323 | -s "Deserializing connection..." |
| 2324 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2326 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2327 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2328 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2329 | "$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] | 2330 | 0 \ |
| 2331 | -c "Deserializing connection..." \ |
| 2332 | -s "Deserializing connection..." |
| 2333 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2334 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2335 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2336 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2337 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2338 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2339 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2340 | 0 \ |
| 2341 | -c "Deserializing connection..." \ |
| 2342 | -s "Deserializing connection..." |
| 2343 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2345 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2346 | run_test "Saving the serialized context to a file" \ |
| 2347 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2348 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2349 | 0 \ |
| 2350 | -s "Save serialized context to a file... ok" \ |
| 2351 | -c "Save serialized context to a file... ok" |
| 2352 | rm -f context_srv.txt |
| 2353 | rm -f context_cli.txt |
| 2354 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2355 | # Tests for DTLS Connection ID extension |
| 2356 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2357 | # So far, the CID API isn't implemented, so we can't |
| 2358 | # grep for output witnessing its use. This needs to be |
| 2359 | # changed once the CID extension is implemented. |
| 2360 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2361 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2362 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2363 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2364 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2365 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2366 | 0 \ |
| 2367 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2368 | -s "found CID extension" \ |
| 2369 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2370 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2371 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2372 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2373 | -C "found CID extension" \ |
| 2374 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2375 | -C "Copy CIDs into SSL transform" \ |
| 2376 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2377 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2378 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2379 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2380 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2381 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2382 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2383 | 0 \ |
| 2384 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2385 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2386 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2387 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2388 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2389 | -C "found CID extension" \ |
| 2390 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2391 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2392 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2393 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2395 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2396 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2397 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2398 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2399 | 0 \ |
| 2400 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2401 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2402 | -c "client hello, adding CID extension" \ |
| 2403 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2404 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2405 | -s "server hello, adding CID extension" \ |
| 2406 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2407 | -c "Use of CID extension negotiated" \ |
| 2408 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2409 | -c "Copy CIDs into SSL transform" \ |
| 2410 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2411 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2412 | -s "Use of Connection ID has been negotiated" \ |
| 2413 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2414 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2416 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2417 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2418 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2419 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2420 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2421 | 0 \ |
| 2422 | -c "Enable use of CID extension." \ |
| 2423 | -s "Enable use of CID extension." \ |
| 2424 | -c "client hello, adding CID extension" \ |
| 2425 | -s "found CID extension" \ |
| 2426 | -s "Use of CID extension negotiated" \ |
| 2427 | -s "server hello, adding CID extension" \ |
| 2428 | -c "found CID extension" \ |
| 2429 | -c "Use of CID extension negotiated" \ |
| 2430 | -s "Copy CIDs into SSL transform" \ |
| 2431 | -c "Copy CIDs into SSL transform" \ |
| 2432 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2433 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2434 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2435 | -c "Use of Connection ID has been negotiated" \ |
| 2436 | -c "ignoring unexpected CID" \ |
| 2437 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2438 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2441 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2442 | -p "$P_PXY mtu=800" \ |
| 2443 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2444 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2445 | 0 \ |
| 2446 | -c "Enable use of CID extension." \ |
| 2447 | -s "Enable use of CID extension." \ |
| 2448 | -c "client hello, adding CID extension" \ |
| 2449 | -s "found CID extension" \ |
| 2450 | -s "Use of CID extension negotiated" \ |
| 2451 | -s "server hello, adding CID extension" \ |
| 2452 | -c "found CID extension" \ |
| 2453 | -c "Use of CID extension negotiated" \ |
| 2454 | -s "Copy CIDs into SSL transform" \ |
| 2455 | -c "Copy CIDs into SSL transform" \ |
| 2456 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2457 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2458 | -s "Use of Connection ID has been negotiated" \ |
| 2459 | -c "Use of Connection ID has been negotiated" |
| 2460 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2462 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2463 | 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] | 2464 | -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] | 2465 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2466 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2467 | 0 \ |
| 2468 | -c "Enable use of CID extension." \ |
| 2469 | -s "Enable use of CID extension." \ |
| 2470 | -c "client hello, adding CID extension" \ |
| 2471 | -s "found CID extension" \ |
| 2472 | -s "Use of CID extension negotiated" \ |
| 2473 | -s "server hello, adding CID extension" \ |
| 2474 | -c "found CID extension" \ |
| 2475 | -c "Use of CID extension negotiated" \ |
| 2476 | -s "Copy CIDs into SSL transform" \ |
| 2477 | -c "Copy CIDs into SSL transform" \ |
| 2478 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2479 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2480 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2481 | -c "Use of Connection ID has been negotiated" \ |
| 2482 | -c "ignoring unexpected CID" \ |
| 2483 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2484 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2486 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2487 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2488 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2489 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2490 | 0 \ |
| 2491 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2492 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2493 | -c "client hello, adding CID extension" \ |
| 2494 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2495 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2496 | -s "server hello, adding CID extension" \ |
| 2497 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2498 | -c "Use of CID extension negotiated" \ |
| 2499 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2500 | -c "Copy CIDs into SSL transform" \ |
| 2501 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2502 | -s "Peer CID (length 0 Bytes):" \ |
| 2503 | -s "Use of Connection ID has been negotiated" \ |
| 2504 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2505 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2507 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2508 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2509 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2510 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2511 | 0 \ |
| 2512 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2513 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2514 | -c "client hello, adding CID extension" \ |
| 2515 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2516 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2517 | -s "server hello, adding CID extension" \ |
| 2518 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2519 | -c "Use of CID extension negotiated" \ |
| 2520 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2521 | -c "Copy CIDs into SSL transform" \ |
| 2522 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2523 | -c "Peer CID (length 0 Bytes):" \ |
| 2524 | -s "Use of Connection ID has been negotiated" \ |
| 2525 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2529 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2530 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2531 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2532 | 0 \ |
| 2533 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2534 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2535 | -c "client hello, adding CID extension" \ |
| 2536 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2537 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2538 | -s "server hello, adding CID extension" \ |
| 2539 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2540 | -c "Use of CID extension negotiated" \ |
| 2541 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2542 | -c "Copy CIDs into SSL transform" \ |
| 2543 | -S "Use of Connection ID has been negotiated" \ |
| 2544 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2545 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2547 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2548 | 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] | 2549 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2550 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2551 | 0 \ |
| 2552 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2553 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2554 | -c "client hello, adding CID extension" \ |
| 2555 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2556 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2557 | -s "server hello, adding CID extension" \ |
| 2558 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2559 | -c "Use of CID extension negotiated" \ |
| 2560 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2561 | -c "Copy CIDs into SSL transform" \ |
| 2562 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2563 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2564 | -s "Use of Connection ID has been negotiated" \ |
| 2565 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2566 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2568 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2569 | 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] | 2570 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2571 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2572 | 0 \ |
| 2573 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2574 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2575 | -c "client hello, adding CID extension" \ |
| 2576 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2577 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2578 | -s "server hello, adding CID extension" \ |
| 2579 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2580 | -c "Use of CID extension negotiated" \ |
| 2581 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2582 | -c "Copy CIDs into SSL transform" \ |
| 2583 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2584 | -s "Peer CID (length 0 Bytes):" \ |
| 2585 | -s "Use of Connection ID has been negotiated" \ |
| 2586 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2587 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2589 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2590 | 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] | 2591 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2592 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2593 | 0 \ |
| 2594 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2595 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2596 | -c "client hello, adding CID extension" \ |
| 2597 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2598 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2599 | -s "server hello, adding CID extension" \ |
| 2600 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2601 | -c "Use of CID extension negotiated" \ |
| 2602 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2603 | -c "Copy CIDs into SSL transform" \ |
| 2604 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2605 | -c "Peer CID (length 0 Bytes):" \ |
| 2606 | -s "Use of Connection ID has been negotiated" \ |
| 2607 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2608 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2610 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2611 | 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] | 2612 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2613 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2614 | 0 \ |
| 2615 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2616 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2617 | -c "client hello, adding CID extension" \ |
| 2618 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2619 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2620 | -s "server hello, adding CID extension" \ |
| 2621 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2622 | -c "Use of CID extension negotiated" \ |
| 2623 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2624 | -c "Copy CIDs into SSL transform" \ |
| 2625 | -S "Use of Connection ID has been negotiated" \ |
| 2626 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2627 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2629 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2630 | 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] | 2631 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2632 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2633 | 0 \ |
| 2634 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2635 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2636 | -c "client hello, adding CID extension" \ |
| 2637 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2638 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2639 | -s "server hello, adding CID extension" \ |
| 2640 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2641 | -c "Use of CID extension negotiated" \ |
| 2642 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2643 | -c "Copy CIDs into SSL transform" \ |
| 2644 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2645 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2646 | -s "Use of Connection ID has been negotiated" \ |
| 2647 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2648 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2650 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2651 | 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] | 2652 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2653 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2654 | 0 \ |
| 2655 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2656 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2657 | -c "client hello, adding CID extension" \ |
| 2658 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2659 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2660 | -s "server hello, adding CID extension" \ |
| 2661 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2662 | -c "Use of CID extension negotiated" \ |
| 2663 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2664 | -c "Copy CIDs into SSL transform" \ |
| 2665 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2666 | -s "Peer CID (length 0 Bytes):" \ |
| 2667 | -s "Use of Connection ID has been negotiated" \ |
| 2668 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2669 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2671 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2672 | 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] | 2673 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2674 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2675 | 0 \ |
| 2676 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2677 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2678 | -c "client hello, adding CID extension" \ |
| 2679 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2680 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2681 | -s "server hello, adding CID extension" \ |
| 2682 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2683 | -c "Use of CID extension negotiated" \ |
| 2684 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2685 | -c "Copy CIDs into SSL transform" \ |
| 2686 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2687 | -c "Peer CID (length 0 Bytes):" \ |
| 2688 | -s "Use of Connection ID has been negotiated" \ |
| 2689 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2690 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2691 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2692 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2693 | 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] | 2694 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2695 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2696 | 0 \ |
| 2697 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2698 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2699 | -c "client hello, adding CID extension" \ |
| 2700 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2701 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2702 | -s "server hello, adding CID extension" \ |
| 2703 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2704 | -c "Use of CID extension negotiated" \ |
| 2705 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2706 | -c "Copy CIDs into SSL transform" \ |
| 2707 | -S "Use of Connection ID has been negotiated" \ |
| 2708 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2709 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2711 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2712 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2713 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2714 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2715 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2716 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2717 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2718 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2719 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2720 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2721 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2722 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2723 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2724 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2725 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2727 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2728 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2729 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2730 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2731 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2732 | 0 \ |
| 2733 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2734 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2735 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2736 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2737 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2738 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2739 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2740 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2741 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2743 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2744 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2745 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2746 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2747 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2748 | 0 \ |
| 2749 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2750 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2751 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2752 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2753 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2754 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2755 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2756 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2757 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2759 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2760 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2761 | 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] | 2762 | -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] | 2763 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2764 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2765 | 0 \ |
| 2766 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2767 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2768 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2769 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2770 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2771 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2772 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2773 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2774 | -c "ignoring unexpected CID" \ |
| 2775 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2776 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2778 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2779 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2780 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2781 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2782 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2783 | 0 \ |
| 2784 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2785 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2786 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2787 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2788 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2789 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2790 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2791 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2792 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2794 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2795 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2796 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2797 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2798 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2799 | 0 \ |
| 2800 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2801 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2802 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2803 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2804 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2805 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2806 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2807 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2808 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2810 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2811 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2812 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2813 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2814 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2815 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2816 | 0 \ |
| 2817 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2818 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2819 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2820 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2821 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2822 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2823 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2824 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2825 | -c "ignoring unexpected CID" \ |
| 2826 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2827 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2829 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2830 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2831 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2832 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2833 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2834 | 0 \ |
| 2835 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2836 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2837 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2838 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2839 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2840 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2841 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2843 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2844 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2845 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2846 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2847 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2848 | 0 \ |
| 2849 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2850 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2851 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2852 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2853 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2854 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2855 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2856 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2857 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2858 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2859 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2860 | -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] | 2861 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2862 | "$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" \ |
| 2863 | 0 \ |
| 2864 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2865 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2866 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2867 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2868 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2869 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2870 | -c "ignoring unexpected CID" \ |
| 2871 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2872 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2874 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2875 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2876 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2877 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2878 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2879 | 0 \ |
| 2880 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2881 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2882 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2883 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2884 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2885 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2886 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2887 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2888 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2889 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2890 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2891 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2892 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2893 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2894 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2895 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2896 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2897 | 0 \ |
| 2898 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2899 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2900 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2901 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2902 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2903 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2904 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2905 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2906 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2907 | -c "ignoring unexpected CID" \ |
| 2908 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2909 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2911 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2912 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2913 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2914 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2915 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2916 | 0 \ |
| 2917 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2918 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2919 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2920 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2921 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2922 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2923 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2924 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2925 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2926 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2928 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2929 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2930 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2931 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2932 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2933 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2934 | 0 \ |
| 2935 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2936 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2937 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2938 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2939 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2940 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2941 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2942 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2943 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2944 | -c "ignoring unexpected CID" \ |
| 2945 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2946 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2947 | # 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] | 2948 | # tests check that the buffer contents are reallocated when the message is |
| 2949 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2952 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2953 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2954 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2955 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2956 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2957 | 0 \ |
| 2958 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2959 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2960 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2961 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2962 | -s "Reallocating in_buf" \ |
| 2963 | -s "Reallocating out_buf" |
| 2964 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2966 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2967 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2968 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2969 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2970 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2971 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2972 | 0 \ |
| 2973 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2974 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2975 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2976 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2977 | -s "Reallocating in_buf" \ |
| 2978 | -s "Reallocating out_buf" |
| 2979 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2980 | # Tests for Encrypt-then-MAC extension |
| 2981 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2983 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2984 | "$P_SRV debug_level=3 \ |
| 2985 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2986 | "$P_CLI debug_level=3" \ |
| 2987 | 0 \ |
| 2988 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2989 | -s "found encrypt then mac extension" \ |
| 2990 | -s "server hello, adding encrypt then mac extension" \ |
| 2991 | -c "found encrypt_then_mac extension" \ |
| 2992 | -c "using encrypt then mac" \ |
| 2993 | -s "using encrypt then mac" |
| 2994 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2996 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2997 | "$P_SRV debug_level=3 etm=0 \ |
| 2998 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2999 | "$P_CLI debug_level=3 etm=1" \ |
| 3000 | 0 \ |
| 3001 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3002 | -s "found encrypt then mac extension" \ |
| 3003 | -S "server hello, adding encrypt then mac extension" \ |
| 3004 | -C "found encrypt_then_mac extension" \ |
| 3005 | -C "using encrypt then mac" \ |
| 3006 | -S "using encrypt then mac" |
| 3007 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3009 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3010 | "$P_SRV debug_level=3 etm=1 \ |
| 3011 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3012 | "$P_CLI debug_level=3 etm=1" \ |
| 3013 | 0 \ |
| 3014 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3015 | -s "found encrypt then mac extension" \ |
| 3016 | -S "server hello, adding encrypt then mac extension" \ |
| 3017 | -C "found encrypt_then_mac extension" \ |
| 3018 | -C "using encrypt then mac" \ |
| 3019 | -S "using encrypt then mac" |
| 3020 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3022 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3023 | "$P_SRV debug_level=3 etm=1 \ |
| 3024 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3025 | "$P_CLI debug_level=3 etm=0" \ |
| 3026 | 0 \ |
| 3027 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3028 | -S "found encrypt then mac extension" \ |
| 3029 | -S "server hello, adding encrypt then mac extension" \ |
| 3030 | -C "found encrypt_then_mac extension" \ |
| 3031 | -C "using encrypt then mac" \ |
| 3032 | -S "using encrypt then mac" |
| 3033 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3034 | # Tests for Extended Master Secret extension |
| 3035 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3037 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3038 | run_test "Extended Master Secret: default" \ |
| 3039 | "$P_SRV debug_level=3" \ |
| 3040 | "$P_CLI debug_level=3" \ |
| 3041 | 0 \ |
| 3042 | -c "client hello, adding extended_master_secret extension" \ |
| 3043 | -s "found extended master secret extension" \ |
| 3044 | -s "server hello, adding extended master secret extension" \ |
| 3045 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3046 | -c "session hash for extended master secret" \ |
| 3047 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3048 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3050 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3051 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3052 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3053 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3054 | 0 \ |
| 3055 | -c "client hello, adding extended_master_secret extension" \ |
| 3056 | -s "found extended master secret extension" \ |
| 3057 | -S "server hello, adding extended master secret extension" \ |
| 3058 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3059 | -C "session hash for extended master secret" \ |
| 3060 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3061 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3063 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3064 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3065 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3066 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3067 | 0 \ |
| 3068 | -C "client hello, adding extended_master_secret extension" \ |
| 3069 | -S "found extended master secret extension" \ |
| 3070 | -S "server hello, adding extended master secret extension" \ |
| 3071 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3072 | -C "session hash for extended master secret" \ |
| 3073 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3074 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3075 | # Test sending and receiving empty application data records |
| 3076 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3078 | run_test "Encrypt then MAC: empty application data record" \ |
| 3079 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3080 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3081 | 0 \ |
| 3082 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3083 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3084 | -c "0 bytes written in 1 fragments" |
| 3085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3087 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3088 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3089 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3090 | 0 \ |
| 3091 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3092 | -c "0 bytes written in 1 fragments" |
| 3093 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3095 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3096 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3097 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3098 | 0 \ |
| 3099 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3100 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3101 | -c "0 bytes written in 1 fragments" |
| 3102 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3104 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3105 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3106 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3107 | 0 \ |
| 3108 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3109 | -c "0 bytes written in 1 fragments" |
| 3110 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3111 | # Tests for CBC 1/n-1 record splitting |
| 3112 | |
| 3113 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3114 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3115 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3116 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3117 | 0 \ |
| 3118 | -s "Read from client: 123 bytes read" \ |
| 3119 | -S "Read from client: 1 bytes read" \ |
| 3120 | -S "122 bytes read" |
| 3121 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3122 | # Tests for Session Tickets |
| 3123 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3125 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3126 | "$P_SRV debug_level=3 tickets=1" \ |
| 3127 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3128 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3129 | -c "client hello, adding session ticket extension" \ |
| 3130 | -s "found session ticket extension" \ |
| 3131 | -s "server hello, adding session ticket extension" \ |
| 3132 | -c "found session_ticket extension" \ |
| 3133 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3134 | -S "session successfully restored from cache" \ |
| 3135 | -s "session successfully restored from ticket" \ |
| 3136 | -s "a session has been resumed" \ |
| 3137 | -c "a session has been resumed" |
| 3138 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3140 | run_test "Session resume using tickets: manual rotation" \ |
| 3141 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3142 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3143 | 0 \ |
| 3144 | -c "client hello, adding session ticket extension" \ |
| 3145 | -s "found session ticket extension" \ |
| 3146 | -s "server hello, adding session ticket extension" \ |
| 3147 | -c "found session_ticket extension" \ |
| 3148 | -c "parse new session ticket" \ |
| 3149 | -S "session successfully restored from cache" \ |
| 3150 | -s "session successfully restored from ticket" \ |
| 3151 | -s "a session has been resumed" \ |
| 3152 | -c "a session has been resumed" |
| 3153 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3155 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3156 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3157 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3158 | 0 \ |
| 3159 | -c "client hello, adding session ticket extension" \ |
| 3160 | -s "found session ticket extension" \ |
| 3161 | -s "server hello, adding session ticket extension" \ |
| 3162 | -c "found session_ticket extension" \ |
| 3163 | -c "parse new session ticket" \ |
| 3164 | -S "session successfully restored from cache" \ |
| 3165 | -s "session successfully restored from ticket" \ |
| 3166 | -s "a session has been resumed" \ |
| 3167 | -c "a session has been resumed" |
| 3168 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3170 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3171 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3172 | "$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] | 3173 | 0 \ |
| 3174 | -c "client hello, adding session ticket extension" \ |
| 3175 | -s "found session ticket extension" \ |
| 3176 | -s "server hello, adding session ticket extension" \ |
| 3177 | -c "found session_ticket extension" \ |
| 3178 | -c "parse new session ticket" \ |
| 3179 | -S "session successfully restored from cache" \ |
| 3180 | -S "session successfully restored from ticket" \ |
| 3181 | -S "a session has been resumed" \ |
| 3182 | -C "a session has been resumed" |
| 3183 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3185 | run_test "Session resume using tickets: session copy" \ |
| 3186 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3187 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3188 | 0 \ |
| 3189 | -c "client hello, adding session ticket extension" \ |
| 3190 | -s "found session ticket extension" \ |
| 3191 | -s "server hello, adding session ticket extension" \ |
| 3192 | -c "found session_ticket extension" \ |
| 3193 | -c "parse new session ticket" \ |
| 3194 | -S "session successfully restored from cache" \ |
| 3195 | -s "session successfully restored from ticket" \ |
| 3196 | -s "a session has been resumed" \ |
| 3197 | -c "a session has been resumed" |
| 3198 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3200 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3201 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3202 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3203 | 0 \ |
| 3204 | -c "client hello, adding session ticket extension" \ |
| 3205 | -c "found session_ticket extension" \ |
| 3206 | -c "parse new session ticket" \ |
| 3207 | -c "a session has been resumed" |
| 3208 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3210 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3211 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3212 | "( $O_CLI -sess_out $SESSION; \ |
| 3213 | $O_CLI -sess_in $SESSION; \ |
| 3214 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3215 | 0 \ |
| 3216 | -s "found session ticket extension" \ |
| 3217 | -s "server hello, adding session ticket extension" \ |
| 3218 | -S "session successfully restored from cache" \ |
| 3219 | -s "session successfully restored from ticket" \ |
| 3220 | -s "a session has been resumed" |
| 3221 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3223 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3224 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3225 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3226 | 0 \ |
| 3227 | -c "client hello, adding session ticket extension" \ |
| 3228 | -s "found session ticket extension" \ |
| 3229 | -s "server hello, adding session ticket extension" \ |
| 3230 | -c "found session_ticket extension" \ |
| 3231 | -c "parse new session ticket" \ |
| 3232 | -S "session successfully restored from cache" \ |
| 3233 | -s "session successfully restored from ticket" \ |
| 3234 | -s "a session has been resumed" \ |
| 3235 | -c "a session has been resumed" |
| 3236 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3238 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3239 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3240 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3241 | 0 \ |
| 3242 | -c "client hello, adding session ticket extension" \ |
| 3243 | -s "found session ticket extension" \ |
| 3244 | -s "server hello, adding session ticket extension" \ |
| 3245 | -c "found session_ticket extension" \ |
| 3246 | -c "parse new session ticket" \ |
| 3247 | -S "session successfully restored from cache" \ |
| 3248 | -s "session successfully restored from ticket" \ |
| 3249 | -s "a session has been resumed" \ |
| 3250 | -c "a session has been resumed" |
| 3251 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3253 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3254 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3255 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3256 | 0 \ |
| 3257 | -c "client hello, adding session ticket extension" \ |
| 3258 | -s "found session ticket extension" \ |
| 3259 | -s "server hello, adding session ticket extension" \ |
| 3260 | -c "found session_ticket extension" \ |
| 3261 | -c "parse new session ticket" \ |
| 3262 | -S "session successfully restored from cache" \ |
| 3263 | -s "session successfully restored from ticket" \ |
| 3264 | -s "a session has been resumed" \ |
| 3265 | -c "a session has been resumed" |
| 3266 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3268 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3269 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3270 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3271 | 0 \ |
| 3272 | -c "client hello, adding session ticket extension" \ |
| 3273 | -s "found session ticket extension" \ |
| 3274 | -s "server hello, adding session ticket extension" \ |
| 3275 | -c "found session_ticket extension" \ |
| 3276 | -c "parse new session ticket" \ |
| 3277 | -S "session successfully restored from cache" \ |
| 3278 | -s "session successfully restored from ticket" \ |
| 3279 | -s "a session has been resumed" \ |
| 3280 | -c "a session has been resumed" |
| 3281 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3283 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3284 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3285 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3286 | 0 \ |
| 3287 | -c "client hello, adding session ticket extension" \ |
| 3288 | -s "found session ticket extension" \ |
| 3289 | -s "server hello, adding session ticket extension" \ |
| 3290 | -c "found session_ticket extension" \ |
| 3291 | -c "parse new session ticket" \ |
| 3292 | -S "session successfully restored from cache" \ |
| 3293 | -s "session successfully restored from ticket" \ |
| 3294 | -s "a session has been resumed" \ |
| 3295 | -c "a session has been resumed" |
| 3296 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3298 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3299 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3300 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3301 | 0 \ |
| 3302 | -c "client hello, adding session ticket extension" \ |
| 3303 | -s "found session ticket extension" \ |
| 3304 | -s "server hello, adding session ticket extension" \ |
| 3305 | -c "found session_ticket extension" \ |
| 3306 | -c "parse new session ticket" \ |
| 3307 | -S "session successfully restored from cache" \ |
| 3308 | -s "session successfully restored from ticket" \ |
| 3309 | -s "a session has been resumed" \ |
| 3310 | -c "a session has been resumed" |
| 3311 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3313 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3314 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3315 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3316 | 0 \ |
| 3317 | -c "client hello, adding session ticket extension" \ |
| 3318 | -s "found session ticket extension" \ |
| 3319 | -s "server hello, adding session ticket extension" \ |
| 3320 | -c "found session_ticket extension" \ |
| 3321 | -c "parse new session ticket" \ |
| 3322 | -S "session successfully restored from cache" \ |
| 3323 | -s "session successfully restored from ticket" \ |
| 3324 | -s "a session has been resumed" \ |
| 3325 | -c "a session has been resumed" |
| 3326 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3328 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3329 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3330 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3331 | 0 \ |
| 3332 | -c "client hello, adding session ticket extension" \ |
| 3333 | -s "found session ticket extension" \ |
| 3334 | -s "server hello, adding session ticket extension" \ |
| 3335 | -c "found session_ticket extension" \ |
| 3336 | -c "parse new session ticket" \ |
| 3337 | -S "session successfully restored from cache" \ |
| 3338 | -s "session successfully restored from ticket" \ |
| 3339 | -s "a session has been resumed" \ |
| 3340 | -c "a session has been resumed" |
| 3341 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3343 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3344 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3345 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3346 | 0 \ |
| 3347 | -c "client hello, adding session ticket extension" \ |
| 3348 | -s "found session ticket extension" \ |
| 3349 | -s "server hello, adding session ticket extension" \ |
| 3350 | -c "found session_ticket extension" \ |
| 3351 | -c "parse new session ticket" \ |
| 3352 | -S "session successfully restored from cache" \ |
| 3353 | -s "session successfully restored from ticket" \ |
| 3354 | -s "a session has been resumed" \ |
| 3355 | -c "a session has been resumed" |
| 3356 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3358 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3359 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3360 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3361 | 0 \ |
| 3362 | -c "client hello, adding session ticket extension" \ |
| 3363 | -s "found session ticket extension" \ |
| 3364 | -s "server hello, adding session ticket extension" \ |
| 3365 | -c "found session_ticket extension" \ |
| 3366 | -c "parse new session ticket" \ |
| 3367 | -S "session successfully restored from cache" \ |
| 3368 | -s "session successfully restored from ticket" \ |
| 3369 | -s "a session has been resumed" \ |
| 3370 | -c "a session has been resumed" |
| 3371 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3373 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3374 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3375 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3376 | 0 \ |
| 3377 | -c "client hello, adding session ticket extension" \ |
| 3378 | -s "found session ticket extension" \ |
| 3379 | -s "server hello, adding session ticket extension" \ |
| 3380 | -c "found session_ticket extension" \ |
| 3381 | -c "parse new session ticket" \ |
| 3382 | -S "session successfully restored from cache" \ |
| 3383 | -s "session successfully restored from ticket" \ |
| 3384 | -s "a session has been resumed" \ |
| 3385 | -c "a session has been resumed" |
| 3386 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3388 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3389 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3390 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3391 | 0 \ |
| 3392 | -c "client hello, adding session ticket extension" \ |
| 3393 | -s "found session ticket extension" \ |
| 3394 | -s "server hello, adding session ticket extension" \ |
| 3395 | -c "found session_ticket extension" \ |
| 3396 | -c "parse new session ticket" \ |
| 3397 | -S "session successfully restored from cache" \ |
| 3398 | -s "session successfully restored from ticket" \ |
| 3399 | -s "a session has been resumed" \ |
| 3400 | -c "a session has been resumed" |
| 3401 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3403 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3404 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3405 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3406 | 0 \ |
| 3407 | -c "client hello, adding session ticket extension" \ |
| 3408 | -s "found session ticket extension" \ |
| 3409 | -s "server hello, adding session ticket extension" \ |
| 3410 | -c "found session_ticket extension" \ |
| 3411 | -c "parse new session ticket" \ |
| 3412 | -S "session successfully restored from cache" \ |
| 3413 | -s "session successfully restored from ticket" \ |
| 3414 | -s "a session has been resumed" \ |
| 3415 | -c "a session has been resumed" |
| 3416 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3418 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3419 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3420 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3421 | 0 \ |
| 3422 | -c "client hello, adding session ticket extension" \ |
| 3423 | -s "found session ticket extension" \ |
| 3424 | -s "server hello, adding session ticket extension" \ |
| 3425 | -c "found session_ticket extension" \ |
| 3426 | -c "parse new session ticket" \ |
| 3427 | -S "session successfully restored from cache" \ |
| 3428 | -s "session successfully restored from ticket" \ |
| 3429 | -s "a session has been resumed" \ |
| 3430 | -c "a session has been resumed" |
| 3431 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3433 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3434 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3435 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3436 | 0 \ |
| 3437 | -c "client hello, adding session ticket extension" \ |
| 3438 | -s "found session ticket extension" \ |
| 3439 | -s "server hello, adding session ticket extension" \ |
| 3440 | -c "found session_ticket extension" \ |
| 3441 | -c "parse new session ticket" \ |
| 3442 | -S "session successfully restored from cache" \ |
| 3443 | -s "session successfully restored from ticket" \ |
| 3444 | -s "a session has been resumed" \ |
| 3445 | -c "a session has been resumed" |
| 3446 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3447 | # Tests for Session Tickets with DTLS |
| 3448 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3450 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3451 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3452 | "$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] | 3453 | 0 \ |
| 3454 | -c "client hello, adding session ticket extension" \ |
| 3455 | -s "found session ticket extension" \ |
| 3456 | -s "server hello, adding session ticket extension" \ |
| 3457 | -c "found session_ticket extension" \ |
| 3458 | -c "parse new session ticket" \ |
| 3459 | -S "session successfully restored from cache" \ |
| 3460 | -s "session successfully restored from ticket" \ |
| 3461 | -s "a session has been resumed" \ |
| 3462 | -c "a session has been resumed" |
| 3463 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3465 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3466 | "$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] | 3467 | "$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] | 3468 | 0 \ |
| 3469 | -c "client hello, adding session ticket extension" \ |
| 3470 | -s "found session ticket extension" \ |
| 3471 | -s "server hello, adding session ticket extension" \ |
| 3472 | -c "found session_ticket extension" \ |
| 3473 | -c "parse new session ticket" \ |
| 3474 | -S "session successfully restored from cache" \ |
| 3475 | -s "session successfully restored from ticket" \ |
| 3476 | -s "a session has been resumed" \ |
| 3477 | -c "a session has been resumed" |
| 3478 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3480 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3481 | "$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] | 3482 | "$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] | 3483 | 0 \ |
| 3484 | -c "client hello, adding session ticket extension" \ |
| 3485 | -s "found session ticket extension" \ |
| 3486 | -s "server hello, adding session ticket extension" \ |
| 3487 | -c "found session_ticket extension" \ |
| 3488 | -c "parse new session ticket" \ |
| 3489 | -S "session successfully restored from cache" \ |
| 3490 | -S "session successfully restored from ticket" \ |
| 3491 | -S "a session has been resumed" \ |
| 3492 | -C "a session has been resumed" |
| 3493 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3495 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3496 | "$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] | 3497 | "$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] | 3498 | 0 \ |
| 3499 | -c "client hello, adding session ticket extension" \ |
| 3500 | -s "found session ticket extension" \ |
| 3501 | -s "server hello, adding session ticket extension" \ |
| 3502 | -c "found session_ticket extension" \ |
| 3503 | -c "parse new session ticket" \ |
| 3504 | -S "session successfully restored from cache" \ |
| 3505 | -s "session successfully restored from ticket" \ |
| 3506 | -s "a session has been resumed" \ |
| 3507 | -c "a session has been resumed" |
| 3508 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3510 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3511 | "$O_SRV -dtls" \ |
| 3512 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3513 | 0 \ |
| 3514 | -c "client hello, adding session ticket extension" \ |
| 3515 | -c "found session_ticket extension" \ |
| 3516 | -c "parse new session ticket" \ |
| 3517 | -c "a session has been resumed" |
| 3518 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3519 | # 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] | 3520 | # 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] | 3521 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3523 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3524 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3525 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3526 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3527 | rm -f $SESSION )" \ |
| 3528 | 0 \ |
| 3529 | -s "found session ticket extension" \ |
| 3530 | -s "server hello, adding session ticket extension" \ |
| 3531 | -S "session successfully restored from cache" \ |
| 3532 | -s "session successfully restored from ticket" \ |
| 3533 | -s "a session has been resumed" |
| 3534 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3535 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3536 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3538 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3539 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3540 | "$P_SRV debug_level=3 tickets=0" \ |
| 3541 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3542 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3543 | -c "client hello, adding session ticket extension" \ |
| 3544 | -s "found session ticket extension" \ |
| 3545 | -S "server hello, adding session ticket extension" \ |
| 3546 | -C "found session_ticket extension" \ |
| 3547 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3548 | -s "session successfully restored from cache" \ |
| 3549 | -S "session successfully restored from ticket" \ |
| 3550 | -s "a session has been resumed" \ |
| 3551 | -c "a session has been resumed" |
| 3552 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3554 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3555 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3556 | "$P_SRV debug_level=3 tickets=1" \ |
| 3557 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3558 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3559 | -C "client hello, adding session ticket extension" \ |
| 3560 | -S "found session ticket extension" \ |
| 3561 | -S "server hello, adding session ticket extension" \ |
| 3562 | -C "found session_ticket extension" \ |
| 3563 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3564 | -s "session successfully restored from cache" \ |
| 3565 | -S "session successfully restored from ticket" \ |
| 3566 | -s "a session has been resumed" \ |
| 3567 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3568 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3570 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3571 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3572 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3573 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3574 | 0 \ |
| 3575 | -S "session successfully restored from cache" \ |
| 3576 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3577 | -S "a session has been resumed" \ |
| 3578 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3579 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3581 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3582 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3583 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3584 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3585 | 0 \ |
| 3586 | -s "session successfully restored from cache" \ |
| 3587 | -S "session successfully restored from ticket" \ |
| 3588 | -s "a session has been resumed" \ |
| 3589 | -c "a session has been resumed" |
| 3590 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3592 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3593 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3594 | "$P_SRV debug_level=3 tickets=0" \ |
| 3595 | "$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] | 3596 | 0 \ |
| 3597 | -s "session successfully restored from cache" \ |
| 3598 | -S "session successfully restored from ticket" \ |
| 3599 | -s "a session has been resumed" \ |
| 3600 | -c "a session has been resumed" |
| 3601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3603 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3604 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3605 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3606 | "$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] | 3607 | 0 \ |
| 3608 | -S "session successfully restored from cache" \ |
| 3609 | -S "session successfully restored from ticket" \ |
| 3610 | -S "a session has been resumed" \ |
| 3611 | -C "a session has been resumed" |
| 3612 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3614 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3615 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3616 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3617 | "$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] | 3618 | 0 \ |
| 3619 | -s "session successfully restored from cache" \ |
| 3620 | -S "session successfully restored from ticket" \ |
| 3621 | -s "a session has been resumed" \ |
| 3622 | -c "a session has been resumed" |
| 3623 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3625 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3626 | run_test "Session resume using cache: session copy" \ |
| 3627 | "$P_SRV debug_level=3 tickets=0" \ |
| 3628 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3629 | 0 \ |
| 3630 | -s "session successfully restored from cache" \ |
| 3631 | -S "session successfully restored from ticket" \ |
| 3632 | -s "a session has been resumed" \ |
| 3633 | -c "a session has been resumed" |
| 3634 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3636 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3637 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3638 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3639 | "( $O_CLI -sess_out $SESSION; \ |
| 3640 | $O_CLI -sess_in $SESSION; \ |
| 3641 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3642 | 0 \ |
| 3643 | -s "found session ticket extension" \ |
| 3644 | -S "server hello, adding session ticket extension" \ |
| 3645 | -s "session successfully restored from cache" \ |
| 3646 | -S "session successfully restored from ticket" \ |
| 3647 | -s "a session has been resumed" |
| 3648 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3650 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3651 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3652 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3653 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3654 | 0 \ |
| 3655 | -C "found session_ticket extension" \ |
| 3656 | -C "parse new session ticket" \ |
| 3657 | -c "a session has been resumed" |
| 3658 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3659 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3660 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3662 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3663 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3664 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3665 | "$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] | 3666 | 0 \ |
| 3667 | -c "client hello, adding session ticket extension" \ |
| 3668 | -s "found session ticket extension" \ |
| 3669 | -S "server hello, adding session ticket extension" \ |
| 3670 | -C "found session_ticket extension" \ |
| 3671 | -C "parse new session ticket" \ |
| 3672 | -s "session successfully restored from cache" \ |
| 3673 | -S "session successfully restored from ticket" \ |
| 3674 | -s "a session has been resumed" \ |
| 3675 | -c "a session has been resumed" |
| 3676 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3678 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3679 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3680 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3681 | "$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] | 3682 | 0 \ |
| 3683 | -C "client hello, adding session ticket extension" \ |
| 3684 | -S "found session ticket extension" \ |
| 3685 | -S "server hello, adding session ticket extension" \ |
| 3686 | -C "found session_ticket extension" \ |
| 3687 | -C "parse new session ticket" \ |
| 3688 | -s "session successfully restored from cache" \ |
| 3689 | -S "session successfully restored from ticket" \ |
| 3690 | -s "a session has been resumed" \ |
| 3691 | -c "a session has been resumed" |
| 3692 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3694 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3695 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3696 | "$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] | 3697 | "$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] | 3698 | 0 \ |
| 3699 | -S "session successfully restored from cache" \ |
| 3700 | -S "session successfully restored from ticket" \ |
| 3701 | -S "a session has been resumed" \ |
| 3702 | -C "a session has been resumed" |
| 3703 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3705 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3706 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3707 | "$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] | 3708 | "$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] | 3709 | 0 \ |
| 3710 | -s "session successfully restored from cache" \ |
| 3711 | -S "session successfully restored from ticket" \ |
| 3712 | -s "a session has been resumed" \ |
| 3713 | -c "a session has been resumed" |
| 3714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3716 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3717 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3718 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3719 | "$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] | 3720 | 0 \ |
| 3721 | -s "session successfully restored from cache" \ |
| 3722 | -S "session successfully restored from ticket" \ |
| 3723 | -s "a session has been resumed" \ |
| 3724 | -c "a session has been resumed" |
| 3725 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3727 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3728 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3729 | "$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] | 3730 | "$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] | 3731 | 0 \ |
| 3732 | -S "session successfully restored from cache" \ |
| 3733 | -S "session successfully restored from ticket" \ |
| 3734 | -S "a session has been resumed" \ |
| 3735 | -C "a session has been resumed" |
| 3736 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3738 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3739 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3740 | "$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] | 3741 | "$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] | 3742 | 0 \ |
| 3743 | -s "session successfully restored from cache" \ |
| 3744 | -S "session successfully restored from ticket" \ |
| 3745 | -s "a session has been resumed" \ |
| 3746 | -c "a session has been resumed" |
| 3747 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3749 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3750 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3751 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3752 | "$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] | 3753 | 0 \ |
| 3754 | -s "session successfully restored from cache" \ |
| 3755 | -S "session successfully restored from ticket" \ |
| 3756 | -s "a session has been resumed" \ |
| 3757 | -c "a session has been resumed" |
| 3758 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3759 | # 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] | 3760 | # 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] | 3761 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3763 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3764 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3765 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3766 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3767 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3768 | rm -f $SESSION )" \ |
| 3769 | 0 \ |
| 3770 | -s "found session ticket extension" \ |
| 3771 | -S "server hello, adding session ticket extension" \ |
| 3772 | -s "session successfully restored from cache" \ |
| 3773 | -S "session successfully restored from ticket" \ |
| 3774 | -s "a session has been resumed" |
| 3775 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3777 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3778 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3779 | "$O_SRV -dtls" \ |
| 3780 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3781 | 0 \ |
| 3782 | -C "found session_ticket extension" \ |
| 3783 | -C "parse new session ticket" \ |
| 3784 | -c "a session has been resumed" |
| 3785 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3786 | # Tests for Max Fragment Length extension |
| 3787 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3788 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3790 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3791 | "$P_SRV debug_level=3" \ |
| 3792 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3793 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3794 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3795 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3796 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3797 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3798 | -C "client hello, adding max_fragment_length extension" \ |
| 3799 | -S "found max fragment length extension" \ |
| 3800 | -S "server hello, max_fragment_length extension" \ |
| 3801 | -C "found max_fragment_length extension" |
| 3802 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3803 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3805 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3806 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3807 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3808 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3809 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3810 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3811 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3812 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3813 | -C "client hello, adding max_fragment_length extension" \ |
| 3814 | -S "found max fragment length extension" \ |
| 3815 | -S "server hello, max_fragment_length extension" \ |
| 3816 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3817 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3818 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3819 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3820 | |
| 3821 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3822 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3823 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3824 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3825 | "$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] | 3826 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3827 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3828 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3829 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3830 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3831 | -C "client hello, adding max_fragment_length extension" \ |
| 3832 | -S "found max fragment length extension" \ |
| 3833 | -S "server hello, max_fragment_length extension" \ |
| 3834 | -C "found max_fragment_length extension" \ |
| 3835 | -c "fragment larger than.*maximum " |
| 3836 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3837 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3838 | # (session fragment length will be 16384 regardless of mbedtls |
| 3839 | # content length configuration.) |
| 3840 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3841 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3843 | run_test "Max fragment length: disabled, larger message" \ |
| 3844 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3845 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3846 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3847 | -C "Maximum incoming record payload length is 16384" \ |
| 3848 | -C "Maximum outgoing record payload length is 16384" \ |
| 3849 | -S "Maximum incoming record payload length is 16384" \ |
| 3850 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3851 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3852 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3853 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3854 | |
| 3855 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3856 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3857 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3858 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3859 | "$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] | 3860 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3861 | -C "Maximum incoming record payload length is 16384" \ |
| 3862 | -C "Maximum outgoing record payload length is 16384" \ |
| 3863 | -S "Maximum incoming record payload length is 16384" \ |
| 3864 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3865 | -c "fragment larger than.*maximum " |
| 3866 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3867 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3868 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3870 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3871 | "$P_SRV debug_level=3" \ |
| 3872 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3873 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3874 | -c "Maximum incoming record payload length is 4096" \ |
| 3875 | -c "Maximum outgoing record payload length is 4096" \ |
| 3876 | -s "Maximum incoming record payload length is 4096" \ |
| 3877 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3878 | -c "client hello, adding max_fragment_length extension" \ |
| 3879 | -s "found max fragment length extension" \ |
| 3880 | -s "server hello, max_fragment_length extension" \ |
| 3881 | -c "found max_fragment_length extension" |
| 3882 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3883 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3884 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3886 | run_test "Max fragment length: client 512, server 1024" \ |
| 3887 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3888 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3889 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3890 | -c "Maximum incoming record payload length is 512" \ |
| 3891 | -c "Maximum outgoing record payload length is 512" \ |
| 3892 | -s "Maximum incoming record payload length is 512" \ |
| 3893 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3894 | -c "client hello, adding max_fragment_length extension" \ |
| 3895 | -s "found max fragment length extension" \ |
| 3896 | -s "server hello, max_fragment_length extension" \ |
| 3897 | -c "found max_fragment_length extension" |
| 3898 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3899 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3900 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3902 | run_test "Max fragment length: client 512, server 2048" \ |
| 3903 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3904 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3905 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3906 | -c "Maximum incoming record payload length is 512" \ |
| 3907 | -c "Maximum outgoing record payload length is 512" \ |
| 3908 | -s "Maximum incoming record payload length is 512" \ |
| 3909 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3910 | -c "client hello, adding max_fragment_length extension" \ |
| 3911 | -s "found max fragment length extension" \ |
| 3912 | -s "server hello, max_fragment_length extension" \ |
| 3913 | -c "found max_fragment_length extension" |
| 3914 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3915 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3916 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3918 | run_test "Max fragment length: client 512, server 4096" \ |
| 3919 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3920 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3921 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3922 | -c "Maximum incoming record payload length is 512" \ |
| 3923 | -c "Maximum outgoing record payload length is 512" \ |
| 3924 | -s "Maximum incoming record payload length is 512" \ |
| 3925 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3926 | -c "client hello, adding max_fragment_length extension" \ |
| 3927 | -s "found max fragment length extension" \ |
| 3928 | -s "server hello, max_fragment_length extension" \ |
| 3929 | -c "found max_fragment_length extension" |
| 3930 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3931 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3932 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3934 | run_test "Max fragment length: client 1024, server 512" \ |
| 3935 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3936 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3937 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3938 | -c "Maximum incoming record payload length is 1024" \ |
| 3939 | -c "Maximum outgoing record payload length is 1024" \ |
| 3940 | -s "Maximum incoming record payload length is 1024" \ |
| 3941 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3942 | -c "client hello, adding max_fragment_length extension" \ |
| 3943 | -s "found max fragment length extension" \ |
| 3944 | -s "server hello, max_fragment_length extension" \ |
| 3945 | -c "found max_fragment_length extension" |
| 3946 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3947 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3948 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3950 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3951 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3952 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3953 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3954 | -c "Maximum incoming record payload length is 1024" \ |
| 3955 | -c "Maximum outgoing record payload length is 1024" \ |
| 3956 | -s "Maximum incoming record payload length is 1024" \ |
| 3957 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3958 | -c "client hello, adding max_fragment_length extension" \ |
| 3959 | -s "found max fragment length extension" \ |
| 3960 | -s "server hello, max_fragment_length extension" \ |
| 3961 | -c "found max_fragment_length extension" |
| 3962 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3963 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3964 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3966 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3967 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3968 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3969 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3970 | -c "Maximum incoming record payload length is 1024" \ |
| 3971 | -c "Maximum outgoing record payload length is 1024" \ |
| 3972 | -s "Maximum incoming record payload length is 1024" \ |
| 3973 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3974 | -c "client hello, adding max_fragment_length extension" \ |
| 3975 | -s "found max fragment length extension" \ |
| 3976 | -s "server hello, max_fragment_length extension" \ |
| 3977 | -c "found max_fragment_length extension" |
| 3978 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3979 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3980 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3982 | run_test "Max fragment length: client 2048, server 512" \ |
| 3983 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3984 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3985 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3986 | -c "Maximum incoming record payload length is 2048" \ |
| 3987 | -c "Maximum outgoing record payload length is 2048" \ |
| 3988 | -s "Maximum incoming record payload length is 2048" \ |
| 3989 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3990 | -c "client hello, adding max_fragment_length extension" \ |
| 3991 | -s "found max fragment length extension" \ |
| 3992 | -s "server hello, max_fragment_length extension" \ |
| 3993 | -c "found max_fragment_length extension" |
| 3994 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3995 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3996 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3998 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3999 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4000 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4001 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4002 | -c "Maximum incoming record payload length is 2048" \ |
| 4003 | -c "Maximum outgoing record payload length is 2048" \ |
| 4004 | -s "Maximum incoming record payload length is 2048" \ |
| 4005 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4006 | -c "client hello, adding max_fragment_length extension" \ |
| 4007 | -s "found max fragment length extension" \ |
| 4008 | -s "server hello, max_fragment_length extension" \ |
| 4009 | -c "found max_fragment_length extension" |
| 4010 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4011 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4012 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4014 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4015 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4016 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4017 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4018 | -c "Maximum incoming record payload length is 2048" \ |
| 4019 | -c "Maximum outgoing record payload length is 2048" \ |
| 4020 | -s "Maximum incoming record payload length is 2048" \ |
| 4021 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4022 | -c "client hello, adding max_fragment_length extension" \ |
| 4023 | -s "found max fragment length extension" \ |
| 4024 | -s "server hello, max_fragment_length extension" \ |
| 4025 | -c "found max_fragment_length extension" |
| 4026 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4027 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4028 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4030 | run_test "Max fragment length: client 4096, server 512" \ |
| 4031 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4032 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4033 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4034 | -c "Maximum incoming record payload length is 4096" \ |
| 4035 | -c "Maximum outgoing record payload length is 4096" \ |
| 4036 | -s "Maximum incoming record payload length is 4096" \ |
| 4037 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4038 | -c "client hello, adding max_fragment_length extension" \ |
| 4039 | -s "found max fragment length extension" \ |
| 4040 | -s "server hello, max_fragment_length extension" \ |
| 4041 | -c "found max_fragment_length extension" |
| 4042 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4043 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4044 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4046 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4047 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4048 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4049 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4050 | -c "Maximum incoming record payload length is 4096" \ |
| 4051 | -c "Maximum outgoing record payload length is 4096" \ |
| 4052 | -s "Maximum incoming record payload length is 4096" \ |
| 4053 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4054 | -c "client hello, adding max_fragment_length extension" \ |
| 4055 | -s "found max fragment length extension" \ |
| 4056 | -s "server hello, max_fragment_length extension" \ |
| 4057 | -c "found max_fragment_length extension" |
| 4058 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4059 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4060 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4062 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4063 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4064 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4065 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4066 | -c "Maximum incoming record payload length is 4096" \ |
| 4067 | -c "Maximum outgoing record payload length is 4096" \ |
| 4068 | -s "Maximum incoming record payload length is 4096" \ |
| 4069 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4070 | -c "client hello, adding max_fragment_length extension" \ |
| 4071 | -s "found max fragment length extension" \ |
| 4072 | -s "server hello, max_fragment_length extension" \ |
| 4073 | -c "found max_fragment_length extension" |
| 4074 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4075 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4076 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4078 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4079 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4080 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4081 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4082 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4083 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4084 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4085 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4086 | -C "client hello, adding max_fragment_length extension" \ |
| 4087 | -S "found max fragment length extension" \ |
| 4088 | -S "server hello, max_fragment_length extension" \ |
| 4089 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4090 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4091 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4092 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4093 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4095 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4096 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4097 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4098 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4099 | -c "Maximum incoming record payload length is 4096" \ |
| 4100 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4101 | -c "client hello, adding max_fragment_length extension" \ |
| 4102 | -c "found max_fragment_length extension" |
| 4103 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4104 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4105 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4107 | run_test "Max fragment length: client, message just fits" \ |
| 4108 | "$P_SRV debug_level=3" \ |
| 4109 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4110 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4111 | -c "Maximum incoming record payload length is 2048" \ |
| 4112 | -c "Maximum outgoing record payload length is 2048" \ |
| 4113 | -s "Maximum incoming record payload length is 2048" \ |
| 4114 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4115 | -c "client hello, adding max_fragment_length extension" \ |
| 4116 | -s "found max fragment length extension" \ |
| 4117 | -s "server hello, max_fragment_length extension" \ |
| 4118 | -c "found max_fragment_length extension" \ |
| 4119 | -c "2048 bytes written in 1 fragments" \ |
| 4120 | -s "2048 bytes read" |
| 4121 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4122 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4123 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4125 | run_test "Max fragment length: client, larger message" \ |
| 4126 | "$P_SRV debug_level=3" \ |
| 4127 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4128 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4129 | -c "Maximum incoming record payload length is 2048" \ |
| 4130 | -c "Maximum outgoing record payload length is 2048" \ |
| 4131 | -s "Maximum incoming record payload length is 2048" \ |
| 4132 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4133 | -c "client hello, adding max_fragment_length extension" \ |
| 4134 | -s "found max fragment length extension" \ |
| 4135 | -s "server hello, max_fragment_length extension" \ |
| 4136 | -c "found max_fragment_length extension" \ |
| 4137 | -c "2345 bytes written in 2 fragments" \ |
| 4138 | -s "2048 bytes read" \ |
| 4139 | -s "297 bytes read" |
| 4140 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4141 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4142 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4144 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4145 | "$P_SRV debug_level=3 dtls=1" \ |
| 4146 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4147 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4148 | -c "Maximum incoming record payload length is 2048" \ |
| 4149 | -c "Maximum outgoing record payload length is 2048" \ |
| 4150 | -s "Maximum incoming record payload length is 2048" \ |
| 4151 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4152 | -c "client hello, adding max_fragment_length extension" \ |
| 4153 | -s "found max fragment length extension" \ |
| 4154 | -s "server hello, max_fragment_length extension" \ |
| 4155 | -c "found max_fragment_length extension" \ |
| 4156 | -c "fragment larger than.*maximum" |
| 4157 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4158 | # Tests for renegotiation |
| 4159 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4160 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4162 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4163 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4164 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4165 | 0 \ |
| 4166 | -C "client hello, adding renegotiation extension" \ |
| 4167 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4168 | -S "found renegotiation extension" \ |
| 4169 | -s "server hello, secure renegotiation extension" \ |
| 4170 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4171 | -C "=> renegotiate" \ |
| 4172 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4173 | -S "write hello request" |
| 4174 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4175 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4177 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4178 | "$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] | 4179 | "$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] | 4180 | 0 \ |
| 4181 | -c "client hello, adding renegotiation extension" \ |
| 4182 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4183 | -s "found renegotiation extension" \ |
| 4184 | -s "server hello, secure renegotiation extension" \ |
| 4185 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4186 | -c "=> renegotiate" \ |
| 4187 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4188 | -S "write hello request" |
| 4189 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4190 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4192 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4193 | "$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] | 4194 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4195 | 0 \ |
| 4196 | -c "client hello, adding renegotiation extension" \ |
| 4197 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4198 | -s "found renegotiation extension" \ |
| 4199 | -s "server hello, secure renegotiation extension" \ |
| 4200 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4201 | -c "=> renegotiate" \ |
| 4202 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4203 | -s "write hello request" |
| 4204 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4205 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4206 | # 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] | 4207 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4210 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4211 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4212 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4213 | 0 \ |
| 4214 | -c "client hello, adding renegotiation extension" \ |
| 4215 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4216 | -s "found renegotiation extension" \ |
| 4217 | -s "server hello, secure renegotiation extension" \ |
| 4218 | -c "found renegotiation extension" \ |
| 4219 | -c "=> renegotiate" \ |
| 4220 | -s "=> renegotiate" \ |
| 4221 | -S "write hello request" \ |
| 4222 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4223 | |
| 4224 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4225 | # 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] | 4226 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4227 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4229 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4230 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4231 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4232 | 0 \ |
| 4233 | -c "client hello, adding renegotiation extension" \ |
| 4234 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4235 | -s "found renegotiation extension" \ |
| 4236 | -s "server hello, secure renegotiation extension" \ |
| 4237 | -c "found renegotiation extension" \ |
| 4238 | -c "=> renegotiate" \ |
| 4239 | -s "=> renegotiate" \ |
| 4240 | -s "write hello request" \ |
| 4241 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4242 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4244 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4245 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4246 | "$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] | 4247 | "$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] | 4248 | 0 \ |
| 4249 | -c "client hello, adding renegotiation extension" \ |
| 4250 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4251 | -s "found renegotiation extension" \ |
| 4252 | -s "server hello, secure renegotiation extension" \ |
| 4253 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4254 | -c "=> renegotiate" \ |
| 4255 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4256 | -s "write hello request" |
| 4257 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4258 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4259 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4260 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4262 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4263 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4264 | "$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" \ |
| 4265 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4266 | -c "Maximum incoming record payload length is 2048" \ |
| 4267 | -c "Maximum outgoing record payload length is 2048" \ |
| 4268 | -s "Maximum incoming record payload length is 2048" \ |
| 4269 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4270 | -c "client hello, adding max_fragment_length extension" \ |
| 4271 | -s "found max fragment length extension" \ |
| 4272 | -s "server hello, max_fragment_length extension" \ |
| 4273 | -c "found max_fragment_length extension" \ |
| 4274 | -c "client hello, adding renegotiation extension" \ |
| 4275 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4276 | -s "found renegotiation extension" \ |
| 4277 | -s "server hello, secure renegotiation extension" \ |
| 4278 | -c "found renegotiation extension" \ |
| 4279 | -c "=> renegotiate" \ |
| 4280 | -s "=> renegotiate" \ |
| 4281 | -s "write hello request" |
| 4282 | |
| 4283 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4285 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4286 | "$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] | 4287 | "$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] | 4288 | 1 \ |
| 4289 | -c "client hello, adding renegotiation extension" \ |
| 4290 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4291 | -S "found renegotiation extension" \ |
| 4292 | -s "server hello, secure renegotiation extension" \ |
| 4293 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4294 | -c "=> renegotiate" \ |
| 4295 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4296 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4297 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4298 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4299 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4300 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4302 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4303 | "$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] | 4304 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4305 | 0 \ |
| 4306 | -C "client hello, adding renegotiation extension" \ |
| 4307 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4308 | -S "found renegotiation extension" \ |
| 4309 | -s "server hello, secure renegotiation extension" \ |
| 4310 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4311 | -C "=> renegotiate" \ |
| 4312 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4313 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4314 | -S "SSL - An unexpected message was received from our peer" \ |
| 4315 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4316 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4317 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4319 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4320 | "$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] | 4321 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4322 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4323 | 0 \ |
| 4324 | -C "client hello, adding renegotiation extension" \ |
| 4325 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4326 | -S "found renegotiation extension" \ |
| 4327 | -s "server hello, secure renegotiation extension" \ |
| 4328 | -c "found renegotiation extension" \ |
| 4329 | -C "=> renegotiate" \ |
| 4330 | -S "=> renegotiate" \ |
| 4331 | -s "write hello request" \ |
| 4332 | -S "SSL - An unexpected message was received from our peer" \ |
| 4333 | -S "failed" |
| 4334 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4335 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4336 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4338 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4339 | "$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] | 4340 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4341 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4342 | 0 \ |
| 4343 | -C "client hello, adding renegotiation extension" \ |
| 4344 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4345 | -S "found renegotiation extension" \ |
| 4346 | -s "server hello, secure renegotiation extension" \ |
| 4347 | -c "found renegotiation extension" \ |
| 4348 | -C "=> renegotiate" \ |
| 4349 | -S "=> renegotiate" \ |
| 4350 | -s "write hello request" \ |
| 4351 | -S "SSL - An unexpected message was received from our peer" \ |
| 4352 | -S "failed" |
| 4353 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4356 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4357 | "$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] | 4358 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4359 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4360 | 0 \ |
| 4361 | -C "client hello, adding renegotiation extension" \ |
| 4362 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4363 | -S "found renegotiation extension" \ |
| 4364 | -s "server hello, secure renegotiation extension" \ |
| 4365 | -c "found renegotiation extension" \ |
| 4366 | -C "=> renegotiate" \ |
| 4367 | -S "=> renegotiate" \ |
| 4368 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4369 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4370 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4371 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4373 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4374 | "$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] | 4375 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4376 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4377 | 0 \ |
| 4378 | -c "client hello, adding renegotiation extension" \ |
| 4379 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4380 | -s "found renegotiation extension" \ |
| 4381 | -s "server hello, secure renegotiation extension" \ |
| 4382 | -c "found renegotiation extension" \ |
| 4383 | -c "=> renegotiate" \ |
| 4384 | -s "=> renegotiate" \ |
| 4385 | -s "write hello request" \ |
| 4386 | -S "SSL - An unexpected message was received from our peer" \ |
| 4387 | -S "failed" |
| 4388 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4391 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4392 | "$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] | 4393 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4394 | 0 \ |
| 4395 | -C "client hello, adding renegotiation extension" \ |
| 4396 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4397 | -S "found renegotiation extension" \ |
| 4398 | -s "server hello, secure renegotiation extension" \ |
| 4399 | -c "found renegotiation extension" \ |
| 4400 | -S "record counter limit reached: renegotiate" \ |
| 4401 | -C "=> renegotiate" \ |
| 4402 | -S "=> renegotiate" \ |
| 4403 | -S "write hello request" \ |
| 4404 | -S "SSL - An unexpected message was received from our peer" \ |
| 4405 | -S "failed" |
| 4406 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4407 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4408 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4410 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4411 | "$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] | 4412 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4413 | 0 \ |
| 4414 | -c "client hello, adding renegotiation extension" \ |
| 4415 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4416 | -s "found renegotiation extension" \ |
| 4417 | -s "server hello, secure renegotiation extension" \ |
| 4418 | -c "found renegotiation extension" \ |
| 4419 | -s "record counter limit reached: renegotiate" \ |
| 4420 | -c "=> renegotiate" \ |
| 4421 | -s "=> renegotiate" \ |
| 4422 | -s "write hello request" \ |
| 4423 | -S "SSL - An unexpected message was received from our peer" \ |
| 4424 | -S "failed" |
| 4425 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4426 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4428 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4429 | "$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] | 4430 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4431 | 0 \ |
| 4432 | -c "client hello, adding renegotiation extension" \ |
| 4433 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4434 | -s "found renegotiation extension" \ |
| 4435 | -s "server hello, secure renegotiation extension" \ |
| 4436 | -c "found renegotiation extension" \ |
| 4437 | -s "record counter limit reached: renegotiate" \ |
| 4438 | -c "=> renegotiate" \ |
| 4439 | -s "=> renegotiate" \ |
| 4440 | -s "write hello request" \ |
| 4441 | -S "SSL - An unexpected message was received from our peer" \ |
| 4442 | -S "failed" |
| 4443 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4444 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4446 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4447 | "$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] | 4448 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4449 | 0 \ |
| 4450 | -C "client hello, adding renegotiation extension" \ |
| 4451 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4452 | -S "found renegotiation extension" \ |
| 4453 | -s "server hello, secure renegotiation extension" \ |
| 4454 | -c "found renegotiation extension" \ |
| 4455 | -S "record counter limit reached: renegotiate" \ |
| 4456 | -C "=> renegotiate" \ |
| 4457 | -S "=> renegotiate" \ |
| 4458 | -S "write hello request" \ |
| 4459 | -S "SSL - An unexpected message was received from our peer" \ |
| 4460 | -S "failed" |
| 4461 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4462 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4464 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4465 | "$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] | 4466 | "$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] | 4467 | 0 \ |
| 4468 | -c "client hello, adding renegotiation extension" \ |
| 4469 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4470 | -s "found renegotiation extension" \ |
| 4471 | -s "server hello, secure renegotiation extension" \ |
| 4472 | -c "found renegotiation extension" \ |
| 4473 | -c "=> renegotiate" \ |
| 4474 | -s "=> renegotiate" \ |
| 4475 | -S "write hello request" |
| 4476 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4477 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4479 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4480 | "$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] | 4481 | "$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] | 4482 | 0 \ |
| 4483 | -c "client hello, adding renegotiation extension" \ |
| 4484 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4485 | -s "found renegotiation extension" \ |
| 4486 | -s "server hello, secure renegotiation extension" \ |
| 4487 | -c "found renegotiation extension" \ |
| 4488 | -c "=> renegotiate" \ |
| 4489 | -s "=> renegotiate" \ |
| 4490 | -s "write hello request" |
| 4491 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4492 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4494 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4495 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4496 | "$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] | 4497 | 0 \ |
| 4498 | -c "client hello, adding renegotiation extension" \ |
| 4499 | -c "found renegotiation extension" \ |
| 4500 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4501 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4502 | -C "error" \ |
| 4503 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4504 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4505 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4506 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4508 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4509 | "$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] | 4510 | "$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] | 4511 | 0 \ |
| 4512 | -c "client hello, adding renegotiation extension" \ |
| 4513 | -c "found renegotiation extension" \ |
| 4514 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4515 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4516 | -C "error" \ |
| 4517 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4518 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4519 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4520 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4522 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4523 | "$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] | 4524 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4525 | 1 \ |
| 4526 | -c "client hello, adding renegotiation extension" \ |
| 4527 | -C "found renegotiation extension" \ |
| 4528 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4529 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4530 | -c "error" \ |
| 4531 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4532 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4533 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4536 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4537 | "$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] | 4538 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4539 | allow_legacy=0" \ |
| 4540 | 1 \ |
| 4541 | -c "client hello, adding renegotiation extension" \ |
| 4542 | -C "found renegotiation extension" \ |
| 4543 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4544 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4545 | -c "error" \ |
| 4546 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4547 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4548 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4549 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4550 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4551 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4552 | "$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] | 4553 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4554 | allow_legacy=1" \ |
| 4555 | 0 \ |
| 4556 | -c "client hello, adding renegotiation extension" \ |
| 4557 | -C "found renegotiation extension" \ |
| 4558 | -c "=> renegotiate" \ |
| 4559 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4560 | -C "error" \ |
| 4561 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4562 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4563 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4565 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4566 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4567 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4568 | 0 \ |
| 4569 | -c "client hello, adding renegotiation extension" \ |
| 4570 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4571 | -s "found renegotiation extension" \ |
| 4572 | -s "server hello, secure renegotiation extension" \ |
| 4573 | -c "found renegotiation extension" \ |
| 4574 | -c "=> renegotiate" \ |
| 4575 | -s "=> renegotiate" \ |
| 4576 | -S "write hello request" |
| 4577 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4578 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4580 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4581 | "$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] | 4582 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4583 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4584 | 0 \ |
| 4585 | -c "client hello, adding renegotiation extension" \ |
| 4586 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4587 | -s "found renegotiation extension" \ |
| 4588 | -s "server hello, secure renegotiation extension" \ |
| 4589 | -c "found renegotiation extension" \ |
| 4590 | -c "=> renegotiate" \ |
| 4591 | -s "=> renegotiate" \ |
| 4592 | -s "write hello request" |
| 4593 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4594 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4596 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4597 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4598 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4599 | 0 \ |
| 4600 | -c "client hello, adding renegotiation extension" \ |
| 4601 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4602 | -s "found renegotiation extension" \ |
| 4603 | -s "server hello, secure renegotiation extension" \ |
| 4604 | -s "record counter limit reached: renegotiate" \ |
| 4605 | -c "=> renegotiate" \ |
| 4606 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4607 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4608 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4609 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4610 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4612 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4613 | "$G_SRV -u --mtu 4096" \ |
| 4614 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4615 | 0 \ |
| 4616 | -c "client hello, adding renegotiation extension" \ |
| 4617 | -c "found renegotiation extension" \ |
| 4618 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4619 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4620 | -C "error" \ |
| 4621 | -s "Extra-header:" |
| 4622 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 4623 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4624 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4625 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4627 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4628 | "$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] | 4629 | "$P_CLI debug_level=3" \ |
| 4630 | 0 \ |
| 4631 | -c "found renegotiation extension" \ |
| 4632 | -C "error" \ |
| 4633 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4634 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4635 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4637 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4638 | "$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] | 4639 | "$P_CLI debug_level=3" \ |
| 4640 | 0 \ |
| 4641 | -C "found renegotiation extension" \ |
| 4642 | -C "error" \ |
| 4643 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4644 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4645 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4647 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4648 | "$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] | 4649 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4650 | 1 \ |
| 4651 | -C "found renegotiation extension" \ |
| 4652 | -c "error" \ |
| 4653 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4654 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4655 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4657 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4658 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4659 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4660 | 0 \ |
| 4661 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4662 | -s "server hello, secure renegotiation extension" |
| 4663 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4664 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4665 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4666 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4667 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4668 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4669 | 0 \ |
| 4670 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4671 | -S "server hello, secure renegotiation extension" |
| 4672 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4673 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4675 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4676 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4677 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4678 | 1 \ |
| 4679 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4680 | -S "server hello, secure renegotiation extension" |
| 4681 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4682 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4683 | |
| 4684 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4686 | run_test "DER format: no trailing bytes" \ |
| 4687 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4688 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4689 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4690 | 0 \ |
| 4691 | -c "Handshake was completed" \ |
| 4692 | |
| 4693 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4695 | run_test "DER format: with a trailing zero byte" \ |
| 4696 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4697 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4698 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4699 | 0 \ |
| 4700 | -c "Handshake was completed" \ |
| 4701 | |
| 4702 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4704 | run_test "DER format: with a trailing random byte" \ |
| 4705 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4706 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4707 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4708 | 0 \ |
| 4709 | -c "Handshake was completed" \ |
| 4710 | |
| 4711 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4713 | run_test "DER format: with 2 trailing random bytes" \ |
| 4714 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4715 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4716 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4717 | 0 \ |
| 4718 | -c "Handshake was completed" \ |
| 4719 | |
| 4720 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4722 | run_test "DER format: with 4 trailing random bytes" \ |
| 4723 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4724 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4725 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4726 | 0 \ |
| 4727 | -c "Handshake was completed" \ |
| 4728 | |
| 4729 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4731 | run_test "DER format: with 8 trailing random bytes" \ |
| 4732 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4733 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4734 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4735 | 0 \ |
| 4736 | -c "Handshake was completed" \ |
| 4737 | |
| 4738 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4739 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4740 | run_test "DER format: with 9 trailing random bytes" \ |
| 4741 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4742 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4743 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4744 | 0 \ |
| 4745 | -c "Handshake was completed" \ |
| 4746 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4747 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4748 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4749 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4751 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4752 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4753 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4754 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4755 | 1 \ |
| 4756 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4757 | -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] | 4758 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4759 | -c "X509 - Certificate verification failed" |
| 4760 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4762 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4763 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4764 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4765 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4766 | 0 \ |
| 4767 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4768 | -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] | 4769 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4770 | -C "X509 - Certificate verification failed" |
| 4771 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4773 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4774 | "$P_SRV" \ |
| 4775 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4776 | 0 \ |
| 4777 | -c "x509_verify_cert() returned" \ |
| 4778 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4779 | -c "! Certificate verification flags"\ |
| 4780 | -C "! mbedtls_ssl_handshake returned" \ |
| 4781 | -C "X509 - Certificate verification failed" \ |
| 4782 | -C "SSL - No CA Chain is set, but required to operate" |
| 4783 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4785 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4786 | "$P_SRV" \ |
| 4787 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4788 | 1 \ |
| 4789 | -c "x509_verify_cert() returned" \ |
| 4790 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4791 | -c "! Certificate verification flags"\ |
| 4792 | -c "! mbedtls_ssl_handshake returned" \ |
| 4793 | -c "SSL - No CA Chain is set, but required to operate" |
| 4794 | |
| 4795 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4796 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4797 | # the client informs the server about the supported curves - it does, though, in the |
| 4798 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4799 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4800 | # different means to have the server ignoring the client's supported curve list. |
| 4801 | |
| 4802 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4804 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4805 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4806 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4807 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4808 | 1 \ |
| 4809 | -c "bad certificate (EC key curve)"\ |
| 4810 | -c "! Certificate verification flags"\ |
| 4811 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4812 | |
| 4813 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4815 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4816 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4817 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4818 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4819 | 1 \ |
| 4820 | -c "bad certificate (EC key curve)"\ |
| 4821 | -c "! Certificate verification flags"\ |
| 4822 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4823 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4825 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4826 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4827 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4828 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4829 | 0 \ |
| 4830 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4831 | -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] | 4832 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4833 | -C "X509 - Certificate verification failed" |
| 4834 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4836 | run_test "Authentication: client SHA256, server required" \ |
| 4837 | "$P_SRV auth_mode=required" \ |
| 4838 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4839 | key_file=data_files/server6.key \ |
| 4840 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4841 | 0 \ |
| 4842 | -c "Supported Signature Algorithm found: 4," \ |
| 4843 | -c "Supported Signature Algorithm found: 5," |
| 4844 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4846 | run_test "Authentication: client SHA384, server required" \ |
| 4847 | "$P_SRV auth_mode=required" \ |
| 4848 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4849 | key_file=data_files/server6.key \ |
| 4850 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4851 | 0 \ |
| 4852 | -c "Supported Signature Algorithm found: 4," \ |
| 4853 | -c "Supported Signature Algorithm found: 5," |
| 4854 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4856 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4857 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4858 | "$P_CLI debug_level=3 crt_file=none \ |
| 4859 | key_file=data_files/server5.key" \ |
| 4860 | 1 \ |
| 4861 | -S "skip write certificate request" \ |
| 4862 | -C "skip parse certificate request" \ |
| 4863 | -c "got a certificate request" \ |
| 4864 | -c "= write certificate$" \ |
| 4865 | -C "skip write certificate$" \ |
| 4866 | -S "x509_verify_cert() returned" \ |
| 4867 | -s "client has no certificate" \ |
| 4868 | -s "! mbedtls_ssl_handshake returned" \ |
| 4869 | -c "! mbedtls_ssl_handshake returned" \ |
| 4870 | -s "No client certification received from the client, but required by the authentication mode" |
| 4871 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4873 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4874 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4875 | "$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] | 4876 | key_file=data_files/server5.key" \ |
| 4877 | 1 \ |
| 4878 | -S "skip write certificate request" \ |
| 4879 | -C "skip parse certificate request" \ |
| 4880 | -c "got a certificate request" \ |
| 4881 | -C "skip write certificate" \ |
| 4882 | -C "skip write certificate verify" \ |
| 4883 | -S "skip parse certificate verify" \ |
| 4884 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4885 | -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] | 4886 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4887 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4888 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4889 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4890 | # We don't check that the client receives the alert because it might |
| 4891 | # detect that its write end of the connection is closed and abort |
| 4892 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4893 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4895 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4896 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4897 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4898 | key_file=data_files/server5.key" \ |
| 4899 | 0 \ |
| 4900 | -S "skip write certificate request" \ |
| 4901 | -C "skip parse certificate request" \ |
| 4902 | -c "got a certificate request" \ |
| 4903 | -C "skip write certificate" \ |
| 4904 | -C "skip write certificate verify" \ |
| 4905 | -S "skip parse certificate verify" \ |
| 4906 | -S "x509_verify_cert() returned" \ |
| 4907 | -S "! The certificate is not correctly signed" \ |
| 4908 | -S "X509 - Certificate verification failed" |
| 4909 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4911 | run_test "Authentication: client cert not trusted, server required" \ |
| 4912 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4913 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4914 | key_file=data_files/server5.key" \ |
| 4915 | 1 \ |
| 4916 | -S "skip write certificate request" \ |
| 4917 | -C "skip parse certificate request" \ |
| 4918 | -c "got a certificate request" \ |
| 4919 | -C "skip write certificate" \ |
| 4920 | -C "skip write certificate verify" \ |
| 4921 | -S "skip parse certificate verify" \ |
| 4922 | -s "x509_verify_cert() returned" \ |
| 4923 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4924 | -s "! mbedtls_ssl_handshake returned" \ |
| 4925 | -c "! mbedtls_ssl_handshake returned" \ |
| 4926 | -s "X509 - Certificate verification failed" |
| 4927 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4929 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4930 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4931 | "$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] | 4932 | key_file=data_files/server5.key" \ |
| 4933 | 0 \ |
| 4934 | -S "skip write certificate request" \ |
| 4935 | -C "skip parse certificate request" \ |
| 4936 | -c "got a certificate request" \ |
| 4937 | -C "skip write certificate" \ |
| 4938 | -C "skip write certificate verify" \ |
| 4939 | -S "skip parse certificate verify" \ |
| 4940 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4941 | -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] | 4942 | -S "! mbedtls_ssl_handshake returned" \ |
| 4943 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4944 | -S "X509 - Certificate verification failed" |
| 4945 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4947 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4948 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4949 | "$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] | 4950 | key_file=data_files/server5.key" \ |
| 4951 | 0 \ |
| 4952 | -s "skip write certificate request" \ |
| 4953 | -C "skip parse certificate request" \ |
| 4954 | -c "got no certificate request" \ |
| 4955 | -c "skip write certificate" \ |
| 4956 | -c "skip write certificate verify" \ |
| 4957 | -s "skip parse certificate verify" \ |
| 4958 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4959 | -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] | 4960 | -S "! mbedtls_ssl_handshake returned" \ |
| 4961 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4962 | -S "X509 - Certificate verification failed" |
| 4963 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4965 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4966 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4967 | "$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] | 4968 | 0 \ |
| 4969 | -S "skip write certificate request" \ |
| 4970 | -C "skip parse certificate request" \ |
| 4971 | -c "got a certificate request" \ |
| 4972 | -C "skip write certificate$" \ |
| 4973 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4974 | -c "skip write certificate verify" \ |
| 4975 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4976 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4977 | -S "! mbedtls_ssl_handshake returned" \ |
| 4978 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4979 | -S "X509 - Certificate verification failed" |
| 4980 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4982 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4983 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4984 | "$O_CLI" \ |
| 4985 | 0 \ |
| 4986 | -S "skip write certificate request" \ |
| 4987 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4988 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4989 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4990 | -S "X509 - Certificate verification failed" |
| 4991 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4993 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4994 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4995 | "$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] | 4996 | 0 \ |
| 4997 | -C "skip parse certificate request" \ |
| 4998 | -c "got a certificate request" \ |
| 4999 | -C "skip write certificate$" \ |
| 5000 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5001 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5002 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5004 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5005 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5006 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5007 | 1 \ |
| 5008 | -C "skip parse certificate request" \ |
| 5009 | -c "got a certificate request" \ |
| 5010 | -C "skip write certificate$" \ |
| 5011 | -c "skip write certificate verify" \ |
| 5012 | -c "! mbedtls_ssl_handshake returned" |
| 5013 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5014 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5015 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5016 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5017 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5018 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5019 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5020 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5021 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5022 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5023 | # 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] | 5024 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5025 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5027 | run_test "Authentication: server max_int chain, client default" \ |
| 5028 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5029 | key_file=data_files/dir-maxpath/09.key" \ |
| 5030 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5031 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5032 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5033 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5034 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5035 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5037 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5038 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5039 | key_file=data_files/dir-maxpath/10.key" \ |
| 5040 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5041 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5042 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5043 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5044 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5045 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5047 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5048 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5049 | key_file=data_files/dir-maxpath/10.key" \ |
| 5050 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5051 | auth_mode=optional" \ |
| 5052 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5053 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5054 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5055 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5056 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5058 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5059 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5060 | key_file=data_files/dir-maxpath/10.key" \ |
| 5061 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5062 | auth_mode=none" \ |
| 5063 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5064 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5065 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5066 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5067 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5069 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5070 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5071 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5072 | key_file=data_files/dir-maxpath/10.key" \ |
| 5073 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5074 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5075 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5076 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5077 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5079 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5080 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5081 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5082 | key_file=data_files/dir-maxpath/10.key" \ |
| 5083 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5084 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5085 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5086 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5087 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5089 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5090 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5091 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5092 | key_file=data_files/dir-maxpath/10.key" \ |
| 5093 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5094 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5095 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5096 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5097 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5099 | run_test "Authentication: client max_int chain, server required" \ |
| 5100 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5101 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5102 | key_file=data_files/dir-maxpath/09.key" \ |
| 5103 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5104 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5105 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5106 | # Tests for CA list in CertificateRequest messages |
| 5107 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5109 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5110 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5111 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5112 | key_file=data_files/server6.key" \ |
| 5113 | 0 \ |
| 5114 | -s "requested DN" |
| 5115 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5117 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5118 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5119 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5120 | key_file=data_files/server6.key" \ |
| 5121 | 0 \ |
| 5122 | -S "requested DN" |
| 5123 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5125 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5126 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5127 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5128 | key_file=data_files/server5.key" \ |
| 5129 | 1 \ |
| 5130 | -S "requested DN" \ |
| 5131 | -s "x509_verify_cert() returned" \ |
| 5132 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5133 | -s "! mbedtls_ssl_handshake returned" \ |
| 5134 | -c "! mbedtls_ssl_handshake returned" \ |
| 5135 | -s "X509 - Certificate verification failed" |
| 5136 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5137 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5138 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5139 | |
| 5140 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5142 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5143 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5144 | key_file=data_files/server5.key" \ |
| 5145 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5146 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5147 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5148 | -c "x509_verify_cert() returned" \ |
| 5149 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5150 | -c "! mbedtls_ssl_handshake returned" \ |
| 5151 | -c "X509 - Certificate verification failed" |
| 5152 | |
| 5153 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5155 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5156 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5157 | key_file=data_files/server5.key" \ |
| 5158 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5159 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5160 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5161 | -c "x509_verify_cert() returned" \ |
| 5162 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5163 | -C "! mbedtls_ssl_handshake returned" \ |
| 5164 | -C "X509 - Certificate verification failed" |
| 5165 | |
| 5166 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5167 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5168 | # the client informs the server about the supported curves - it does, though, in the |
| 5169 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5170 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5171 | # different means to have the server ignoring the client's supported curve list. |
| 5172 | |
| 5173 | requires_config_enabled MBEDTLS_ECP_C |
| 5174 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5176 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5177 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5178 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5179 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5180 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5181 | -c "use CA callback for X.509 CRT verification" \ |
| 5182 | -c "bad certificate (EC key curve)" \ |
| 5183 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5184 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5185 | |
| 5186 | requires_config_enabled MBEDTLS_ECP_C |
| 5187 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5189 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5190 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5191 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5192 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5193 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5194 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5195 | -c "bad certificate (EC key curve)"\ |
| 5196 | -c "! Certificate verification flags"\ |
| 5197 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5198 | |
| 5199 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5201 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5202 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5203 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5204 | key_file=data_files/server6.key \ |
| 5205 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5206 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5207 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5208 | -c "Supported Signature Algorithm found: 4," \ |
| 5209 | -c "Supported Signature Algorithm found: 5," |
| 5210 | |
| 5211 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5213 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5214 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5215 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5216 | key_file=data_files/server6.key \ |
| 5217 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5218 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5219 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5220 | -c "Supported Signature Algorithm found: 4," \ |
| 5221 | -c "Supported Signature Algorithm found: 5," |
| 5222 | |
| 5223 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5225 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5226 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5227 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5228 | key_file=data_files/server5.key" \ |
| 5229 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5230 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5231 | -S "skip write certificate request" \ |
| 5232 | -C "skip parse certificate request" \ |
| 5233 | -c "got a certificate request" \ |
| 5234 | -C "skip write certificate" \ |
| 5235 | -C "skip write certificate verify" \ |
| 5236 | -S "skip parse certificate verify" \ |
| 5237 | -s "x509_verify_cert() returned" \ |
| 5238 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5239 | -s "! mbedtls_ssl_handshake returned" \ |
| 5240 | -s "send alert level=2 message=48" \ |
| 5241 | -c "! mbedtls_ssl_handshake returned" \ |
| 5242 | -s "X509 - Certificate verification failed" |
| 5243 | # We don't check that the client receives the alert because it might |
| 5244 | # detect that its write end of the connection is closed and abort |
| 5245 | # before reading the alert message. |
| 5246 | |
| 5247 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5249 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5250 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5251 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5252 | key_file=data_files/server5.key" \ |
| 5253 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5254 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5255 | -S "skip write certificate request" \ |
| 5256 | -C "skip parse certificate request" \ |
| 5257 | -c "got a certificate request" \ |
| 5258 | -C "skip write certificate" \ |
| 5259 | -C "skip write certificate verify" \ |
| 5260 | -S "skip parse certificate verify" \ |
| 5261 | -s "x509_verify_cert() returned" \ |
| 5262 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5263 | -s "! mbedtls_ssl_handshake returned" \ |
| 5264 | -c "! mbedtls_ssl_handshake returned" \ |
| 5265 | -s "X509 - Certificate verification failed" |
| 5266 | |
| 5267 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5269 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5270 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5271 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5272 | key_file=data_files/server5.key" \ |
| 5273 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5274 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5275 | -S "skip write certificate request" \ |
| 5276 | -C "skip parse certificate request" \ |
| 5277 | -c "got a certificate request" \ |
| 5278 | -C "skip write certificate" \ |
| 5279 | -C "skip write certificate verify" \ |
| 5280 | -S "skip parse certificate verify" \ |
| 5281 | -s "x509_verify_cert() returned" \ |
| 5282 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5283 | -S "! mbedtls_ssl_handshake returned" \ |
| 5284 | -C "! mbedtls_ssl_handshake returned" \ |
| 5285 | -S "X509 - Certificate verification failed" |
| 5286 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5287 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5288 | requires_full_size_output_buffer |
| 5289 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5291 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5292 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5293 | key_file=data_files/dir-maxpath/09.key" \ |
| 5294 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5295 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5296 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5297 | -C "X509 - A fatal error occurred" |
| 5298 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5299 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5300 | requires_full_size_output_buffer |
| 5301 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5303 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5304 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5305 | key_file=data_files/dir-maxpath/10.key" \ |
| 5306 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5307 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5308 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5309 | -c "X509 - A fatal error occurred" |
| 5310 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5311 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5312 | requires_full_size_output_buffer |
| 5313 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5315 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5316 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5317 | key_file=data_files/dir-maxpath/10.key" \ |
| 5318 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5319 | debug_level=3 auth_mode=optional" \ |
| 5320 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5321 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5322 | -c "X509 - A fatal error occurred" |
| 5323 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5324 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5325 | requires_full_size_output_buffer |
| 5326 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5328 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5329 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5330 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5331 | key_file=data_files/dir-maxpath/10.key" \ |
| 5332 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5333 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5334 | -s "X509 - A fatal error occurred" |
| 5335 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5336 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5337 | requires_full_size_output_buffer |
| 5338 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5340 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5341 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5342 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5343 | key_file=data_files/dir-maxpath/10.key" \ |
| 5344 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5345 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5346 | -s "X509 - A fatal error occurred" |
| 5347 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5348 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5349 | requires_full_size_output_buffer |
| 5350 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5352 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5353 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5354 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5355 | key_file=data_files/dir-maxpath/09.key" \ |
| 5356 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5357 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5358 | -S "X509 - A fatal error occurred" |
| 5359 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5360 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5361 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5362 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5363 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5364 | "$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] | 5365 | key_file=data_files/server5.key \ |
| 5366 | crt_file2=data_files/server5-sha1.crt \ |
| 5367 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5368 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5369 | 0 \ |
| 5370 | -c "signed using.*ECDSA with SHA256" \ |
| 5371 | -C "signed using.*ECDSA with SHA1" |
| 5372 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5373 | # tests for SNI |
| 5374 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5375 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5376 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5377 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5378 | 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] | 5379 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5380 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5381 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5382 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5383 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5384 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5385 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5386 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5387 | 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] | 5388 | 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] | 5389 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5390 | 0 \ |
| 5391 | -s "parse ServerName extension" \ |
| 5392 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5393 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5394 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5395 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5396 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5397 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5398 | 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] | 5399 | 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] | 5400 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5401 | 0 \ |
| 5402 | -s "parse ServerName extension" \ |
| 5403 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5404 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5405 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5406 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5407 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5408 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5409 | 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] | 5410 | 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] | 5411 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5412 | 1 \ |
| 5413 | -s "parse ServerName extension" \ |
| 5414 | -s "ssl_sni_wrapper() returned" \ |
| 5415 | -s "mbedtls_ssl_handshake returned" \ |
| 5416 | -c "mbedtls_ssl_handshake returned" \ |
| 5417 | -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] | 5418 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5419 | run_test "SNI: client auth no override: optional" \ |
| 5420 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5421 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5422 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5423 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5424 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5425 | -S "skip write certificate request" \ |
| 5426 | -C "skip parse certificate request" \ |
| 5427 | -c "got a certificate request" \ |
| 5428 | -C "skip write certificate" \ |
| 5429 | -C "skip write certificate verify" \ |
| 5430 | -S "skip parse certificate verify" |
| 5431 | |
| 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 | |
| 5445 | run_test "SNI: client auth override: optional -> none" \ |
| 5446 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5447 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5448 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5449 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5450 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5451 | -s "skip write certificate request" \ |
| 5452 | -C "skip parse certificate request" \ |
| 5453 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 5454 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5455 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5456 | run_test "SNI: CA no override" \ |
| 5457 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5458 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5459 | ca_file=data_files/test-ca.crt \ |
| 5460 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5461 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5462 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5463 | 1 \ |
| 5464 | -S "skip write certificate request" \ |
| 5465 | -C "skip parse certificate request" \ |
| 5466 | -c "got a certificate request" \ |
| 5467 | -C "skip write certificate" \ |
| 5468 | -C "skip write certificate verify" \ |
| 5469 | -S "skip parse certificate verify" \ |
| 5470 | -s "x509_verify_cert() returned" \ |
| 5471 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5472 | -S "The certificate has been revoked (is on a CRL)" |
| 5473 | |
| 5474 | run_test "SNI: CA override" \ |
| 5475 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5476 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5477 | ca_file=data_files/test-ca.crt \ |
| 5478 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5479 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5480 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5481 | 0 \ |
| 5482 | -S "skip write certificate request" \ |
| 5483 | -C "skip parse certificate request" \ |
| 5484 | -c "got a certificate request" \ |
| 5485 | -C "skip write certificate" \ |
| 5486 | -C "skip write certificate verify" \ |
| 5487 | -S "skip parse certificate verify" \ |
| 5488 | -S "x509_verify_cert() returned" \ |
| 5489 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5490 | -S "The certificate has been revoked (is on a CRL)" |
| 5491 | |
| 5492 | run_test "SNI: CA override with CRL" \ |
| 5493 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5494 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5495 | ca_file=data_files/test-ca.crt \ |
| 5496 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5497 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5498 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5499 | 1 \ |
| 5500 | -S "skip write certificate request" \ |
| 5501 | -C "skip parse certificate request" \ |
| 5502 | -c "got a certificate request" \ |
| 5503 | -C "skip write certificate" \ |
| 5504 | -C "skip write certificate verify" \ |
| 5505 | -S "skip parse certificate verify" \ |
| 5506 | -s "x509_verify_cert() returned" \ |
| 5507 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5508 | -s "The certificate has been revoked (is on a CRL)" |
| 5509 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5510 | # Tests for SNI and DTLS |
| 5511 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5512 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5514 | run_test "SNI: DTLS, no SNI callback" \ |
| 5515 | "$P_SRV debug_level=3 dtls=1 \ |
| 5516 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5517 | "$P_CLI server_name=localhost dtls=1" \ |
| 5518 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5519 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5520 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5521 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5522 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5524 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5525 | "$P_SRV debug_level=3 dtls=1 \ |
| 5526 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5527 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5528 | "$P_CLI server_name=localhost dtls=1" \ |
| 5529 | 0 \ |
| 5530 | -s "parse ServerName extension" \ |
| 5531 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5532 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5533 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5534 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5536 | run_test "SNI: DTLS, matching cert 2" \ |
| 5537 | "$P_SRV debug_level=3 dtls=1 \ |
| 5538 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5539 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5540 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5541 | 0 \ |
| 5542 | -s "parse ServerName extension" \ |
| 5543 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5544 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5545 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5547 | run_test "SNI: DTLS, no matching cert" \ |
| 5548 | "$P_SRV debug_level=3 dtls=1 \ |
| 5549 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5550 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5551 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5552 | 1 \ |
| 5553 | -s "parse ServerName extension" \ |
| 5554 | -s "ssl_sni_wrapper() returned" \ |
| 5555 | -s "mbedtls_ssl_handshake returned" \ |
| 5556 | -c "mbedtls_ssl_handshake returned" \ |
| 5557 | -c "SSL - A fatal alert message was received from our peer" |
| 5558 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5560 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5561 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5562 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5563 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5564 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5565 | 0 \ |
| 5566 | -S "skip write certificate request" \ |
| 5567 | -C "skip parse certificate request" \ |
| 5568 | -c "got a certificate request" \ |
| 5569 | -C "skip write certificate" \ |
| 5570 | -C "skip write certificate verify" \ |
| 5571 | -S "skip parse certificate verify" |
| 5572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5574 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5575 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5576 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5577 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5578 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5579 | 0 \ |
| 5580 | -S "skip write certificate request" \ |
| 5581 | -C "skip parse certificate request" \ |
| 5582 | -c "got a certificate request" \ |
| 5583 | -C "skip write certificate" \ |
| 5584 | -C "skip write certificate verify" \ |
| 5585 | -S "skip parse certificate verify" |
| 5586 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5588 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5589 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5590 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5591 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5592 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5593 | 0 \ |
| 5594 | -s "skip write certificate request" \ |
| 5595 | -C "skip parse certificate request" \ |
| 5596 | -c "got no certificate request" \ |
| 5597 | -c "skip write certificate" \ |
| 5598 | -c "skip write certificate verify" \ |
| 5599 | -s "skip parse certificate verify" |
| 5600 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5602 | run_test "SNI: DTLS, CA no override" \ |
| 5603 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5604 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5605 | ca_file=data_files/test-ca.crt \ |
| 5606 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5607 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5608 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5609 | 1 \ |
| 5610 | -S "skip write certificate request" \ |
| 5611 | -C "skip parse certificate request" \ |
| 5612 | -c "got a certificate request" \ |
| 5613 | -C "skip write certificate" \ |
| 5614 | -C "skip write certificate verify" \ |
| 5615 | -S "skip parse certificate verify" \ |
| 5616 | -s "x509_verify_cert() returned" \ |
| 5617 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5618 | -S "The certificate has been revoked (is on a CRL)" |
| 5619 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5621 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5622 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5623 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5624 | ca_file=data_files/test-ca.crt \ |
| 5625 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5626 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5627 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5628 | 0 \ |
| 5629 | -S "skip write certificate request" \ |
| 5630 | -C "skip parse certificate request" \ |
| 5631 | -c "got a certificate request" \ |
| 5632 | -C "skip write certificate" \ |
| 5633 | -C "skip write certificate verify" \ |
| 5634 | -S "skip parse certificate verify" \ |
| 5635 | -S "x509_verify_cert() returned" \ |
| 5636 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5637 | -S "The certificate has been revoked (is on a CRL)" |
| 5638 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5640 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5641 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5642 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5643 | ca_file=data_files/test-ca.crt \ |
| 5644 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5645 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5646 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5647 | 1 \ |
| 5648 | -S "skip write certificate request" \ |
| 5649 | -C "skip parse certificate request" \ |
| 5650 | -c "got a certificate request" \ |
| 5651 | -C "skip write certificate" \ |
| 5652 | -C "skip write certificate verify" \ |
| 5653 | -S "skip parse certificate verify" \ |
| 5654 | -s "x509_verify_cert() returned" \ |
| 5655 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5656 | -s "The certificate has been revoked (is on a CRL)" |
| 5657 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5658 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5659 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5661 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5662 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5663 | "$P_CLI nbio=2 tickets=0" \ |
| 5664 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5665 | -S "mbedtls_ssl_handshake returned" \ |
| 5666 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5667 | -c "Read from server: .* bytes read" |
| 5668 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5670 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5671 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5672 | "$P_CLI nbio=2 tickets=0" \ |
| 5673 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5674 | -S "mbedtls_ssl_handshake returned" \ |
| 5675 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5676 | -c "Read from server: .* bytes read" |
| 5677 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5679 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5680 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5681 | "$P_CLI nbio=2 tickets=1" \ |
| 5682 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5683 | -S "mbedtls_ssl_handshake returned" \ |
| 5684 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5685 | -c "Read from server: .* bytes read" |
| 5686 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5688 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5689 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5690 | "$P_CLI nbio=2 tickets=1" \ |
| 5691 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5692 | -S "mbedtls_ssl_handshake returned" \ |
| 5693 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5694 | -c "Read from server: .* bytes read" |
| 5695 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5697 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5698 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5699 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5700 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5701 | -S "mbedtls_ssl_handshake returned" \ |
| 5702 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5703 | -c "Read from server: .* bytes read" |
| 5704 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5706 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5707 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5708 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5709 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5710 | -S "mbedtls_ssl_handshake returned" \ |
| 5711 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5712 | -c "Read from server: .* bytes read" |
| 5713 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5715 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5716 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5717 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5718 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5719 | -S "mbedtls_ssl_handshake returned" \ |
| 5720 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5721 | -c "Read from server: .* bytes read" |
| 5722 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5723 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5724 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5726 | run_test "Event-driven I/O: basic handshake" \ |
| 5727 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5728 | "$P_CLI event=1 tickets=0" \ |
| 5729 | 0 \ |
| 5730 | -S "mbedtls_ssl_handshake returned" \ |
| 5731 | -C "mbedtls_ssl_handshake returned" \ |
| 5732 | -c "Read from server: .* bytes read" |
| 5733 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5735 | run_test "Event-driven I/O: client auth" \ |
| 5736 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5737 | "$P_CLI event=1 tickets=0" \ |
| 5738 | 0 \ |
| 5739 | -S "mbedtls_ssl_handshake returned" \ |
| 5740 | -C "mbedtls_ssl_handshake returned" \ |
| 5741 | -c "Read from server: .* bytes read" |
| 5742 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5744 | run_test "Event-driven I/O: ticket" \ |
| 5745 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5746 | "$P_CLI event=1 tickets=1" \ |
| 5747 | 0 \ |
| 5748 | -S "mbedtls_ssl_handshake returned" \ |
| 5749 | -C "mbedtls_ssl_handshake returned" \ |
| 5750 | -c "Read from server: .* bytes read" |
| 5751 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5753 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5754 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5755 | "$P_CLI event=1 tickets=1" \ |
| 5756 | 0 \ |
| 5757 | -S "mbedtls_ssl_handshake returned" \ |
| 5758 | -C "mbedtls_ssl_handshake returned" \ |
| 5759 | -c "Read from server: .* bytes read" |
| 5760 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5762 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5763 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5764 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5765 | 0 \ |
| 5766 | -S "mbedtls_ssl_handshake returned" \ |
| 5767 | -C "mbedtls_ssl_handshake returned" \ |
| 5768 | -c "Read from server: .* bytes read" |
| 5769 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5771 | run_test "Event-driven I/O: ticket + resume" \ |
| 5772 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5773 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5774 | 0 \ |
| 5775 | -S "mbedtls_ssl_handshake returned" \ |
| 5776 | -C "mbedtls_ssl_handshake returned" \ |
| 5777 | -c "Read from server: .* bytes read" |
| 5778 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5780 | run_test "Event-driven I/O: session-id resume" \ |
| 5781 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5782 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5783 | 0 \ |
| 5784 | -S "mbedtls_ssl_handshake returned" \ |
| 5785 | -C "mbedtls_ssl_handshake returned" \ |
| 5786 | -c "Read from server: .* bytes read" |
| 5787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5789 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5790 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5791 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5792 | 0 \ |
| 5793 | -c "Read from server: .* bytes read" |
| 5794 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5796 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5797 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5798 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5799 | 0 \ |
| 5800 | -c "Read from server: .* bytes read" |
| 5801 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5803 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5804 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5805 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5806 | 0 \ |
| 5807 | -c "Read from server: .* bytes read" |
| 5808 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5810 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5811 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5812 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5813 | 0 \ |
| 5814 | -c "Read from server: .* bytes read" |
| 5815 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5817 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5818 | "$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] | 5819 | "$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] | 5820 | 0 \ |
| 5821 | -c "Read from server: .* bytes read" |
| 5822 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5824 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5825 | "$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] | 5826 | "$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] | 5827 | 0 \ |
| 5828 | -c "Read from server: .* bytes read" |
| 5829 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5831 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5832 | "$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] | 5833 | "$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] | 5834 | 0 \ |
| 5835 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5836 | |
| 5837 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5838 | # During session resumption, the client will send its ApplicationData record |
| 5839 | # within the same datagram as the Finished messages. In this situation, the |
| 5840 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5841 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5843 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5844 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5845 | "$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] | 5846 | "$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] | 5847 | 0 \ |
| 5848 | -c "Read from server: .* bytes read" |
| 5849 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5850 | # Tests for version negotiation |
| 5851 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5853 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5854 | "$P_SRV" \ |
| 5855 | "$P_CLI" \ |
| 5856 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5857 | -S "mbedtls_ssl_handshake returned" \ |
| 5858 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5859 | -s "Protocol is TLSv1.2" \ |
| 5860 | -c "Protocol is TLSv1.2" |
| 5861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5863 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5864 | "$P_SRV" \ |
| 5865 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5866 | 1 \ |
| 5867 | -s "Handshake protocol not within min/max boundaries" \ |
| 5868 | -c "Error in protocol version" \ |
| 5869 | -S "Protocol is TLSv1.0" \ |
| 5870 | -C "Handshake was completed" |
| 5871 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5873 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5874 | "$P_SRV" \ |
| 5875 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5876 | 1 \ |
| 5877 | -s "Handshake protocol not within min/max boundaries" \ |
| 5878 | -c "Error in protocol version" \ |
| 5879 | -S "Protocol is TLSv1.1" \ |
| 5880 | -C "Handshake was completed" |
| 5881 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5883 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5884 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5885 | "$P_CLI" \ |
| 5886 | 1 \ |
| 5887 | -s "Error in protocol version" \ |
| 5888 | -c "Handshake protocol not within min/max boundaries" \ |
| 5889 | -S "Version: TLS1.0" \ |
| 5890 | -C "Protocol is TLSv1.0" |
| 5891 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5893 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5894 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5895 | "$P_CLI" \ |
| 5896 | 1 \ |
| 5897 | -s "Error in protocol version" \ |
| 5898 | -c "Handshake protocol not within min/max boundaries" \ |
| 5899 | -S "Version: TLS1.1" \ |
| 5900 | -C "Protocol is TLSv1.1" |
| 5901 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5902 | # Tests for ALPN extension |
| 5903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5905 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5906 | "$P_SRV debug_level=3" \ |
| 5907 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5908 | 0 \ |
| 5909 | -C "client hello, adding alpn extension" \ |
| 5910 | -S "found alpn extension" \ |
| 5911 | -C "got an alert message, type: \\[2:120]" \ |
| 5912 | -S "server hello, adding alpn extension" \ |
| 5913 | -C "found alpn extension " \ |
| 5914 | -C "Application Layer Protocol is" \ |
| 5915 | -S "Application Layer Protocol is" |
| 5916 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5918 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5919 | "$P_SRV debug_level=3" \ |
| 5920 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5921 | 0 \ |
| 5922 | -c "client hello, adding alpn extension" \ |
| 5923 | -s "found alpn extension" \ |
| 5924 | -C "got an alert message, type: \\[2:120]" \ |
| 5925 | -S "server hello, adding alpn extension" \ |
| 5926 | -C "found alpn extension " \ |
| 5927 | -c "Application Layer Protocol is (none)" \ |
| 5928 | -S "Application Layer Protocol is" |
| 5929 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5931 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5932 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5933 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5934 | 0 \ |
| 5935 | -C "client hello, adding alpn extension" \ |
| 5936 | -S "found alpn extension" \ |
| 5937 | -C "got an alert message, type: \\[2:120]" \ |
| 5938 | -S "server hello, adding alpn extension" \ |
| 5939 | -C "found alpn extension " \ |
| 5940 | -C "Application Layer Protocol is" \ |
| 5941 | -s "Application Layer Protocol is (none)" |
| 5942 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5944 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5945 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5946 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5947 | 0 \ |
| 5948 | -c "client hello, adding alpn extension" \ |
| 5949 | -s "found alpn extension" \ |
| 5950 | -C "got an alert message, type: \\[2:120]" \ |
| 5951 | -s "server hello, adding alpn extension" \ |
| 5952 | -c "found alpn extension" \ |
| 5953 | -c "Application Layer Protocol is abc" \ |
| 5954 | -s "Application Layer Protocol is abc" |
| 5955 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5957 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5958 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5959 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5960 | 0 \ |
| 5961 | -c "client hello, adding alpn extension" \ |
| 5962 | -s "found alpn extension" \ |
| 5963 | -C "got an alert message, type: \\[2:120]" \ |
| 5964 | -s "server hello, adding alpn extension" \ |
| 5965 | -c "found alpn extension" \ |
| 5966 | -c "Application Layer Protocol is abc" \ |
| 5967 | -s "Application Layer Protocol is abc" |
| 5968 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5970 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5971 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5972 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5973 | 0 \ |
| 5974 | -c "client hello, adding alpn extension" \ |
| 5975 | -s "found alpn extension" \ |
| 5976 | -C "got an alert message, type: \\[2:120]" \ |
| 5977 | -s "server hello, adding alpn extension" \ |
| 5978 | -c "found alpn extension" \ |
| 5979 | -c "Application Layer Protocol is 1234" \ |
| 5980 | -s "Application Layer Protocol is 1234" |
| 5981 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5983 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5984 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5985 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5986 | 1 \ |
| 5987 | -c "client hello, adding alpn extension" \ |
| 5988 | -s "found alpn extension" \ |
| 5989 | -c "got an alert message, type: \\[2:120]" \ |
| 5990 | -S "server hello, adding alpn extension" \ |
| 5991 | -C "found alpn extension" \ |
| 5992 | -C "Application Layer Protocol is 1234" \ |
| 5993 | -S "Application Layer Protocol is 1234" |
| 5994 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5995 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5996 | # Tests for keyUsage in leaf certificates, part 1: |
| 5997 | # server-side certificate/suite selection |
| 5998 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6000 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6001 | "$P_SRV key_file=data_files/server2.key \ |
| 6002 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6003 | "$P_CLI" \ |
| 6004 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6005 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6006 | |
| 6007 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6009 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6010 | "$P_SRV key_file=data_files/server2.key \ |
| 6011 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6012 | "$P_CLI" \ |
| 6013 | 0 \ |
| 6014 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6017 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6018 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6019 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6020 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6021 | 1 \ |
| 6022 | -C "Ciphersuite is " |
| 6023 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6025 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6026 | "$P_SRV key_file=data_files/server5.key \ |
| 6027 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6028 | "$P_CLI" \ |
| 6029 | 0 \ |
| 6030 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6031 | |
| 6032 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6034 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6035 | "$P_SRV key_file=data_files/server5.key \ |
| 6036 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6037 | "$P_CLI" \ |
| 6038 | 0 \ |
| 6039 | -c "Ciphersuite is TLS-ECDH-" |
| 6040 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6041 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6042 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6043 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6044 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6045 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6046 | 1 \ |
| 6047 | -C "Ciphersuite is " |
| 6048 | |
| 6049 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6050 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6051 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6053 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6054 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6055 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6056 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6057 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6058 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6059 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6060 | -C "Processing of the Certificate handshake message failed" \ |
| 6061 | -c "Ciphersuite is TLS-" |
| 6062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6064 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6065 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6066 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6067 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6068 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6069 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6070 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6071 | -C "Processing of the Certificate handshake message failed" \ |
| 6072 | -c "Ciphersuite is TLS-" |
| 6073 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6075 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6076 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6077 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6078 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6079 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6080 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6081 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6082 | -C "Processing of the Certificate handshake message failed" \ |
| 6083 | -c "Ciphersuite is TLS-" |
| 6084 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6086 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6087 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6088 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6089 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6090 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6091 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6092 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6093 | -c "Processing of the Certificate handshake message failed" \ |
| 6094 | -C "Ciphersuite is TLS-" |
| 6095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6097 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6098 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6099 | -cert data_files/server2.ku-ke.crt" \ |
| 6100 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6101 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6102 | 0 \ |
| 6103 | -c "bad certificate (usage extensions)" \ |
| 6104 | -C "Processing of the Certificate handshake message failed" \ |
| 6105 | -c "Ciphersuite is TLS-" \ |
| 6106 | -c "! Usage does not match the keyUsage extension" |
| 6107 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6109 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6110 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6111 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6112 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6113 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6114 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6115 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6116 | -C "Processing of the Certificate handshake message failed" \ |
| 6117 | -c "Ciphersuite is TLS-" |
| 6118 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6120 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6121 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6122 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6123 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6124 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6125 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6126 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6127 | -c "Processing of the Certificate handshake message failed" \ |
| 6128 | -C "Ciphersuite is TLS-" |
| 6129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6131 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6132 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6133 | -cert data_files/server2.ku-ds.crt" \ |
| 6134 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6135 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6136 | 0 \ |
| 6137 | -c "bad certificate (usage extensions)" \ |
| 6138 | -C "Processing of the Certificate handshake message failed" \ |
| 6139 | -c "Ciphersuite is TLS-" \ |
| 6140 | -c "! Usage does not match the keyUsage extension" |
| 6141 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6142 | # Tests for keyUsage in leaf certificates, part 3: |
| 6143 | # server-side checking of client cert |
| 6144 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6146 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6147 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6148 | "$O_CLI -key data_files/server2.key \ |
| 6149 | -cert data_files/server2.ku-ds.crt" \ |
| 6150 | 0 \ |
| 6151 | -S "bad certificate (usage extensions)" \ |
| 6152 | -S "Processing of the Certificate handshake message failed" |
| 6153 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6155 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6156 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6157 | "$O_CLI -key data_files/server2.key \ |
| 6158 | -cert data_files/server2.ku-ke.crt" \ |
| 6159 | 0 \ |
| 6160 | -s "bad certificate (usage extensions)" \ |
| 6161 | -S "Processing of the Certificate handshake message failed" |
| 6162 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6164 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6165 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6166 | "$O_CLI -key data_files/server2.key \ |
| 6167 | -cert data_files/server2.ku-ke.crt" \ |
| 6168 | 1 \ |
| 6169 | -s "bad certificate (usage extensions)" \ |
| 6170 | -s "Processing of the Certificate handshake message failed" |
| 6171 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6173 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6174 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6175 | "$O_CLI -key data_files/server5.key \ |
| 6176 | -cert data_files/server5.ku-ds.crt" \ |
| 6177 | 0 \ |
| 6178 | -S "bad certificate (usage extensions)" \ |
| 6179 | -S "Processing of the Certificate handshake message failed" |
| 6180 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6182 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6183 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6184 | "$O_CLI -key data_files/server5.key \ |
| 6185 | -cert data_files/server5.ku-ka.crt" \ |
| 6186 | 0 \ |
| 6187 | -s "bad certificate (usage extensions)" \ |
| 6188 | -S "Processing of the Certificate handshake message failed" |
| 6189 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6190 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6191 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6193 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6194 | "$P_SRV key_file=data_files/server5.key \ |
| 6195 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6196 | "$P_CLI" \ |
| 6197 | 0 |
| 6198 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6200 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6201 | "$P_SRV key_file=data_files/server5.key \ |
| 6202 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6203 | "$P_CLI" \ |
| 6204 | 0 |
| 6205 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6207 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6208 | "$P_SRV key_file=data_files/server5.key \ |
| 6209 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6210 | "$P_CLI" \ |
| 6211 | 0 |
| 6212 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6214 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6215 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6216 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6217 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6218 | 1 |
| 6219 | |
| 6220 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6221 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6223 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6224 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6225 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6226 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6227 | 0 \ |
| 6228 | -C "bad certificate (usage extensions)" \ |
| 6229 | -C "Processing of the Certificate handshake message failed" \ |
| 6230 | -c "Ciphersuite is TLS-" |
| 6231 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6233 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6234 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6235 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6236 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6237 | 0 \ |
| 6238 | -C "bad certificate (usage extensions)" \ |
| 6239 | -C "Processing of the Certificate handshake message failed" \ |
| 6240 | -c "Ciphersuite is TLS-" |
| 6241 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6243 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6244 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6245 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6246 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6247 | 0 \ |
| 6248 | -C "bad certificate (usage extensions)" \ |
| 6249 | -C "Processing of the Certificate handshake message failed" \ |
| 6250 | -c "Ciphersuite is TLS-" |
| 6251 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6253 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6254 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6255 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6256 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6257 | 1 \ |
| 6258 | -c "bad certificate (usage extensions)" \ |
| 6259 | -c "Processing of the Certificate handshake message failed" \ |
| 6260 | -C "Ciphersuite is TLS-" |
| 6261 | |
| 6262 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6263 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6265 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6266 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6267 | "$O_CLI -key data_files/server5.key \ |
| 6268 | -cert data_files/server5.eku-cli.crt" \ |
| 6269 | 0 \ |
| 6270 | -S "bad certificate (usage extensions)" \ |
| 6271 | -S "Processing of the Certificate handshake message failed" |
| 6272 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6274 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6275 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6276 | "$O_CLI -key data_files/server5.key \ |
| 6277 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6278 | 0 \ |
| 6279 | -S "bad certificate (usage extensions)" \ |
| 6280 | -S "Processing of the Certificate handshake message failed" |
| 6281 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6283 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6284 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6285 | "$O_CLI -key data_files/server5.key \ |
| 6286 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6287 | 0 \ |
| 6288 | -S "bad certificate (usage extensions)" \ |
| 6289 | -S "Processing of the Certificate handshake message failed" |
| 6290 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6292 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6293 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6294 | "$O_CLI -key data_files/server5.key \ |
| 6295 | -cert data_files/server5.eku-cs.crt" \ |
| 6296 | 0 \ |
| 6297 | -s "bad certificate (usage extensions)" \ |
| 6298 | -S "Processing of the Certificate handshake message failed" |
| 6299 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6301 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6302 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6303 | "$O_CLI -key data_files/server5.key \ |
| 6304 | -cert data_files/server5.eku-cs.crt" \ |
| 6305 | 1 \ |
| 6306 | -s "bad certificate (usage extensions)" \ |
| 6307 | -s "Processing of the Certificate handshake message failed" |
| 6308 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6309 | # Tests for DHM parameters loading |
| 6310 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6312 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6313 | "$P_SRV" \ |
| 6314 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6315 | debug_level=3" \ |
| 6316 | 0 \ |
| 6317 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 6318 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6319 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6321 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6322 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6323 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6324 | debug_level=3" \ |
| 6325 | 0 \ |
| 6326 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 6327 | -c "value of 'DHM: G ' (2 bits)" |
| 6328 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6329 | # Tests for DHM client-side size checking |
| 6330 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6332 | run_test "DHM size: server default, client default, OK" \ |
| 6333 | "$P_SRV" \ |
| 6334 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6335 | debug_level=1" \ |
| 6336 | 0 \ |
| 6337 | -C "DHM prime too short:" |
| 6338 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6340 | run_test "DHM size: server default, client 2048, OK" \ |
| 6341 | "$P_SRV" \ |
| 6342 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6343 | debug_level=1 dhmlen=2048" \ |
| 6344 | 0 \ |
| 6345 | -C "DHM prime too short:" |
| 6346 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6348 | run_test "DHM size: server 1024, client default, OK" \ |
| 6349 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6350 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6351 | debug_level=1" \ |
| 6352 | 0 \ |
| 6353 | -C "DHM prime too short:" |
| 6354 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6356 | run_test "DHM size: server 999, client 999, OK" \ |
| 6357 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6358 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6359 | debug_level=1 dhmlen=999" \ |
| 6360 | 0 \ |
| 6361 | -C "DHM prime too short:" |
| 6362 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6364 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6365 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6366 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6367 | debug_level=1 dhmlen=1000" \ |
| 6368 | 0 \ |
| 6369 | -C "DHM prime too short:" |
| 6370 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6372 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6373 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6374 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6375 | debug_level=1" \ |
| 6376 | 1 \ |
| 6377 | -c "DHM prime too short:" |
| 6378 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6380 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6381 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6382 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6383 | debug_level=1 dhmlen=1001" \ |
| 6384 | 1 \ |
| 6385 | -c "DHM prime too short:" |
| 6386 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6388 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6389 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6390 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6391 | debug_level=1 dhmlen=1000" \ |
| 6392 | 1 \ |
| 6393 | -c "DHM prime too short:" |
| 6394 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6396 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6397 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6398 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6399 | debug_level=1 dhmlen=999" \ |
| 6400 | 1 \ |
| 6401 | -c "DHM prime too short:" |
| 6402 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6404 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6405 | "$P_SRV" \ |
| 6406 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6407 | debug_level=1 dhmlen=2049" \ |
| 6408 | 1 \ |
| 6409 | -c "DHM prime too short:" |
| 6410 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6411 | # Tests for PSK callback |
| 6412 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6414 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6415 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6416 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6417 | psk_identity=foo psk=abc123" \ |
| 6418 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6419 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6420 | -S "SSL - Unknown identity received" \ |
| 6421 | -S "SSL - Verification of the message MAC failed" |
| 6422 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6423 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6425 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6426 | "$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] | 6427 | "$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] | 6428 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6429 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6430 | -C "session hash for extended master secret"\ |
| 6431 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6432 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6433 | -S "SSL - Unknown identity received" \ |
| 6434 | -S "SSL - Verification of the message MAC failed" |
| 6435 | |
| 6436 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6438 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 6439 | "$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] | 6440 | "$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] | 6441 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6442 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6443 | -C "session hash for extended master secret"\ |
| 6444 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6445 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6446 | -S "SSL - Unknown identity received" \ |
| 6447 | -S "SSL - Verification of the message MAC failed" |
| 6448 | |
| 6449 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6451 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 6452 | "$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] | 6453 | "$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] | 6454 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6455 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6456 | -c "session hash for extended master secret"\ |
| 6457 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6458 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6459 | -S "SSL - Unknown identity received" \ |
| 6460 | -S "SSL - Verification of the message MAC failed" |
| 6461 | |
| 6462 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6464 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 6465 | "$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] | 6466 | "$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] | 6467 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6468 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6469 | -c "session hash for extended master secret"\ |
| 6470 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6471 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6472 | -S "SSL - Unknown identity received" \ |
| 6473 | -S "SSL - Verification of the message MAC failed" |
| 6474 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6475 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6477 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 6478 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6479 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6480 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6481 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6482 | -C "session hash for extended master secret"\ |
| 6483 | -S "session hash for extended master secret"\ |
| 6484 | -S "SSL - The handshake negotiation failed" \ |
| 6485 | -S "SSL - Unknown identity received" \ |
| 6486 | -S "SSL - Verification of the message MAC failed" |
| 6487 | |
| 6488 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6490 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 6491 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6492 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6493 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6494 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6495 | -C "session hash for extended master secret"\ |
| 6496 | -S "session hash for extended master secret"\ |
| 6497 | -S "SSL - The handshake negotiation failed" \ |
| 6498 | -S "SSL - Unknown identity received" \ |
| 6499 | -S "SSL - Verification of the message MAC failed" |
| 6500 | |
| 6501 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6503 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 6504 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6505 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6506 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6507 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6508 | -c "session hash for extended master secret"\ |
| 6509 | -s "session hash for extended master secret"\ |
| 6510 | -S "SSL - The handshake negotiation failed" \ |
| 6511 | -S "SSL - Unknown identity received" \ |
| 6512 | -S "SSL - Verification of the message MAC failed" |
| 6513 | |
| 6514 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6516 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 6517 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6518 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6519 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6520 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6521 | -c "session hash for extended master secret"\ |
| 6522 | -s "session hash for extended master secret"\ |
| 6523 | -S "SSL - The handshake negotiation failed" \ |
| 6524 | -S "SSL - Unknown identity received" \ |
| 6525 | -S "SSL - Verification of the message MAC failed" |
| 6526 | |
| 6527 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6529 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 6530 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6531 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6532 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6533 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6534 | -C "session hash for extended master secret"\ |
| 6535 | -S "session hash for extended master secret"\ |
| 6536 | -S "SSL - The handshake negotiation failed" \ |
| 6537 | -S "SSL - Unknown identity received" \ |
| 6538 | -S "SSL - Verification of the message MAC failed" |
| 6539 | |
| 6540 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6542 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 6543 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6544 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6545 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6546 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6547 | -C "session hash for extended master secret"\ |
| 6548 | -S "session hash for extended master secret"\ |
| 6549 | -S "SSL - The handshake negotiation failed" \ |
| 6550 | -S "SSL - Unknown identity received" \ |
| 6551 | -S "SSL - Verification of the message MAC failed" |
| 6552 | |
| 6553 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6555 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 6556 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6557 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6558 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6559 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6560 | -c "session hash for extended master secret"\ |
| 6561 | -s "session hash for extended master secret"\ |
| 6562 | -S "SSL - The handshake negotiation failed" \ |
| 6563 | -S "SSL - Unknown identity received" \ |
| 6564 | -S "SSL - Verification of the message MAC failed" |
| 6565 | |
| 6566 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6568 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 6569 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6570 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6571 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6572 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6573 | -c "session hash for extended master secret"\ |
| 6574 | -s "session hash for extended master secret"\ |
| 6575 | -S "SSL - The handshake negotiation failed" \ |
| 6576 | -S "SSL - Unknown identity received" \ |
| 6577 | -S "SSL - Verification of the message MAC failed" |
| 6578 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6579 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6581 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 6582 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6583 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6584 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6585 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6586 | -C "session hash for extended master secret"\ |
| 6587 | -S "session hash for extended master secret"\ |
| 6588 | -S "SSL - The handshake negotiation failed" \ |
| 6589 | -S "SSL - Unknown identity received" \ |
| 6590 | -S "SSL - Verification of the message MAC failed" |
| 6591 | |
| 6592 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6594 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 6595 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6596 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6597 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6598 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6599 | -C "session hash for extended master secret"\ |
| 6600 | -S "session hash for extended master secret"\ |
| 6601 | -S "SSL - The handshake negotiation failed" \ |
| 6602 | -S "SSL - Unknown identity received" \ |
| 6603 | -S "SSL - Verification of the message MAC failed" |
| 6604 | |
| 6605 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6607 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 6608 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6609 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6610 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6611 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6612 | -c "session hash for extended master secret"\ |
| 6613 | -s "session hash for extended master secret"\ |
| 6614 | -S "SSL - The handshake negotiation failed" \ |
| 6615 | -S "SSL - Unknown identity received" \ |
| 6616 | -S "SSL - Verification of the message MAC failed" |
| 6617 | |
| 6618 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6620 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 6621 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6622 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6623 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6624 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6625 | -c "session hash for extended master secret"\ |
| 6626 | -s "session hash for extended master secret"\ |
| 6627 | -S "SSL - The handshake negotiation failed" \ |
| 6628 | -S "SSL - Unknown identity received" \ |
| 6629 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6630 | |
| 6631 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6633 | 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] | 6634 | "$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" \ |
| 6635 | "$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] | 6636 | psk_identity=foo psk=abc123" \ |
| 6637 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6638 | -C "session hash for extended master secret"\ |
| 6639 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6640 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6641 | -S "SSL - Unknown identity received" \ |
| 6642 | -S "SSL - Verification of the message MAC failed" |
| 6643 | |
| 6644 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6646 | 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] | 6647 | "$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" \ |
| 6648 | "$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] | 6649 | psk_identity=foo psk=abc123" \ |
| 6650 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6651 | -C "session hash for extended master secret"\ |
| 6652 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6653 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6654 | -S "SSL - Unknown identity received" \ |
| 6655 | -S "SSL - Verification of the message MAC failed" |
| 6656 | |
| 6657 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6659 | 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] | 6660 | "$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] | 6661 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6662 | "$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] | 6663 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6664 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6665 | -c "session hash for extended master secret"\ |
| 6666 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6667 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6668 | -S "SSL - Unknown identity received" \ |
| 6669 | -S "SSL - Verification of the message MAC failed" |
| 6670 | |
| 6671 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6673 | 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] | 6674 | "$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] | 6675 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6676 | "$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] | 6677 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6678 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6679 | -c "session hash for extended master secret"\ |
| 6680 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6681 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6682 | -S "SSL - Unknown identity received" \ |
| 6683 | -S "SSL - Verification of the message MAC failed" |
| 6684 | |
| 6685 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6687 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 6688 | "$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" \ |
| 6689 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6690 | psk_identity=foo psk=abc123" \ |
| 6691 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6692 | -C "session hash for extended master secret"\ |
| 6693 | -S "session hash for extended master secret"\ |
| 6694 | -S "SSL - The handshake negotiation failed" \ |
| 6695 | -S "SSL - Unknown identity received" \ |
| 6696 | -S "SSL - Verification of the message MAC failed" |
| 6697 | |
| 6698 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6700 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 6701 | "$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" \ |
| 6702 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6703 | psk_identity=foo psk=abc123" \ |
| 6704 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6705 | -C "session hash for extended master secret"\ |
| 6706 | -S "session hash for extended master secret"\ |
| 6707 | -S "SSL - The handshake negotiation failed" \ |
| 6708 | -S "SSL - Unknown identity received" \ |
| 6709 | -S "SSL - Verification of the message MAC failed" |
| 6710 | |
| 6711 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6713 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 6714 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6715 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6716 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6717 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6718 | 0 \ |
| 6719 | -c "session hash for extended master secret"\ |
| 6720 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6721 | -S "SSL - The handshake negotiation failed" \ |
| 6722 | -S "SSL - Unknown identity received" \ |
| 6723 | -S "SSL - Verification of the message MAC failed" |
| 6724 | |
| 6725 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6727 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 6728 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6729 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 6730 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6731 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6732 | 0 \ |
| 6733 | -c "session hash for extended master secret"\ |
| 6734 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6735 | -S "SSL - The handshake negotiation failed" \ |
| 6736 | -S "SSL - Unknown identity received" \ |
| 6737 | -S "SSL - Verification of the message MAC failed" |
| 6738 | |
| 6739 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6741 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 6742 | "$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" \ |
| 6743 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6744 | psk_identity=foo psk=abc123" \ |
| 6745 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6746 | -C "session hash for extended master secret"\ |
| 6747 | -S "session hash for extended master secret"\ |
| 6748 | -S "SSL - The handshake negotiation failed" \ |
| 6749 | -S "SSL - Unknown identity received" \ |
| 6750 | -S "SSL - Verification of the message MAC failed" |
| 6751 | |
| 6752 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6754 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 6755 | "$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" \ |
| 6756 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6757 | psk_identity=foo psk=abc123" \ |
| 6758 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6759 | -C "session hash for extended master secret"\ |
| 6760 | -S "session hash for extended master secret"\ |
| 6761 | -S "SSL - The handshake negotiation failed" \ |
| 6762 | -S "SSL - Unknown identity received" \ |
| 6763 | -S "SSL - Verification of the message MAC failed" |
| 6764 | |
| 6765 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6767 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 6768 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6769 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6770 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6771 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6772 | 0 \ |
| 6773 | -c "session hash for extended master secret"\ |
| 6774 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6775 | -S "SSL - The handshake negotiation failed" \ |
| 6776 | -S "SSL - Unknown identity received" \ |
| 6777 | -S "SSL - Verification of the message MAC failed" |
| 6778 | |
| 6779 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6781 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 6782 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6783 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 6784 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6785 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6786 | 0 \ |
| 6787 | -c "session hash for extended master secret"\ |
| 6788 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6789 | -S "SSL - The handshake negotiation failed" \ |
| 6790 | -S "SSL - Unknown identity received" \ |
| 6791 | -S "SSL - Verification of the message MAC failed" |
| 6792 | |
| 6793 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6795 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 6796 | "$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" \ |
| 6797 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6798 | psk_identity=foo psk=abc123" \ |
| 6799 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6800 | -C "session hash for extended master secret"\ |
| 6801 | -S "session hash for extended master secret"\ |
| 6802 | -S "SSL - The handshake negotiation failed" \ |
| 6803 | -S "SSL - Unknown identity received" \ |
| 6804 | -S "SSL - Verification of the message MAC failed" |
| 6805 | |
| 6806 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6808 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 6809 | "$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" \ |
| 6810 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6811 | psk_identity=foo psk=abc123" \ |
| 6812 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6813 | -C "session hash for extended master secret"\ |
| 6814 | -S "session hash for extended master secret"\ |
| 6815 | -S "SSL - The handshake negotiation failed" \ |
| 6816 | -S "SSL - Unknown identity received" \ |
| 6817 | -S "SSL - Verification of the message MAC failed" |
| 6818 | |
| 6819 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6821 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 6822 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6823 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6824 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6825 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6826 | 0 \ |
| 6827 | -c "session hash for extended master secret"\ |
| 6828 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6829 | -S "SSL - The handshake negotiation failed" \ |
| 6830 | -S "SSL - Unknown identity received" \ |
| 6831 | -S "SSL - Verification of the message MAC failed" |
| 6832 | |
| 6833 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6835 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 6836 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6837 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 6838 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6839 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6840 | 0 \ |
| 6841 | -c "session hash for extended master secret"\ |
| 6842 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6843 | -S "SSL - The handshake negotiation failed" \ |
| 6844 | -S "SSL - Unknown identity received" \ |
| 6845 | -S "SSL - Verification of the message MAC failed" |
| 6846 | |
| 6847 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6849 | 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] | 6850 | "$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" \ |
| 6851 | "$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] | 6852 | psk_identity=def psk=beef" \ |
| 6853 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6854 | -C "session hash for extended master secret"\ |
| 6855 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6856 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6857 | -S "SSL - Unknown identity received" \ |
| 6858 | -S "SSL - Verification of the message MAC failed" |
| 6859 | |
| 6860 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6861 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6862 | 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] | 6863 | "$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" \ |
| 6864 | "$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] | 6865 | psk_identity=def psk=beef" \ |
| 6866 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6867 | -C "session hash for extended master secret"\ |
| 6868 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6869 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6870 | -S "SSL - Unknown identity received" \ |
| 6871 | -S "SSL - Verification of the message MAC failed" |
| 6872 | |
| 6873 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6874 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6875 | 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] | 6876 | "$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] | 6877 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6878 | "$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] | 6879 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6880 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6881 | -c "session hash for extended master secret"\ |
| 6882 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6883 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6884 | -S "SSL - Unknown identity received" \ |
| 6885 | -S "SSL - Verification of the message MAC failed" |
| 6886 | |
| 6887 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6889 | 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] | 6890 | "$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] | 6891 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6892 | "$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] | 6893 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6894 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6895 | -c "session hash for extended master secret"\ |
| 6896 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6897 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6898 | -S "SSL - Unknown identity received" \ |
| 6899 | -S "SSL - Verification of the message MAC failed" |
| 6900 | |
| 6901 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6903 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 6904 | "$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" \ |
| 6905 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6906 | psk_identity=def psk=beef" \ |
| 6907 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6908 | -C "session hash for extended master secret"\ |
| 6909 | -S "session hash for extended master secret"\ |
| 6910 | -S "SSL - The handshake negotiation failed" \ |
| 6911 | -S "SSL - Unknown identity received" \ |
| 6912 | -S "SSL - Verification of the message MAC failed" |
| 6913 | |
| 6914 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6916 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 6917 | "$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" \ |
| 6918 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6919 | psk_identity=def psk=beef" \ |
| 6920 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6921 | -C "session hash for extended master secret"\ |
| 6922 | -S "session hash for extended master secret"\ |
| 6923 | -S "SSL - The handshake negotiation failed" \ |
| 6924 | -S "SSL - Unknown identity received" \ |
| 6925 | -S "SSL - Verification of the message MAC failed" |
| 6926 | |
| 6927 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6929 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 6930 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 6931 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6932 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6933 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6934 | 0 \ |
| 6935 | -c "session hash for extended master secret"\ |
| 6936 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6937 | -S "SSL - The handshake negotiation failed" \ |
| 6938 | -S "SSL - Unknown identity received" \ |
| 6939 | -S "SSL - Verification of the message MAC failed" |
| 6940 | |
| 6941 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6943 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 6944 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 6945 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 6946 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6947 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6948 | 0 \ |
| 6949 | -c "session hash for extended master secret"\ |
| 6950 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6951 | -S "SSL - The handshake negotiation failed" \ |
| 6952 | -S "SSL - Unknown identity received" \ |
| 6953 | -S "SSL - Verification of the message MAC failed" |
| 6954 | |
| 6955 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6957 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 6958 | "$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" \ |
| 6959 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6960 | psk_identity=def psk=beef" \ |
| 6961 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6962 | -C "session hash for extended master secret"\ |
| 6963 | -S "session hash for extended master secret"\ |
| 6964 | -S "SSL - The handshake negotiation failed" \ |
| 6965 | -S "SSL - Unknown identity received" \ |
| 6966 | -S "SSL - Verification of the message MAC failed" |
| 6967 | |
| 6968 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6970 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 6971 | "$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" \ |
| 6972 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6973 | psk_identity=def psk=beef" \ |
| 6974 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6975 | -C "session hash for extended master secret"\ |
| 6976 | -S "session hash for extended master secret"\ |
| 6977 | -S "SSL - The handshake negotiation failed" \ |
| 6978 | -S "SSL - Unknown identity received" \ |
| 6979 | -S "SSL - Verification of the message MAC failed" |
| 6980 | |
| 6981 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6983 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 6984 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 6985 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6986 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6987 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6988 | 0 \ |
| 6989 | -c "session hash for extended master secret"\ |
| 6990 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6991 | -S "SSL - The handshake negotiation failed" \ |
| 6992 | -S "SSL - Unknown identity received" \ |
| 6993 | -S "SSL - Verification of the message MAC failed" |
| 6994 | |
| 6995 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6997 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 6998 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 6999 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7000 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7001 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7002 | 0 \ |
| 7003 | -c "session hash for extended master secret"\ |
| 7004 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7005 | -S "SSL - The handshake negotiation failed" \ |
| 7006 | -S "SSL - Unknown identity received" \ |
| 7007 | -S "SSL - Verification of the message MAC failed" |
| 7008 | |
| 7009 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7011 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7012 | "$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" \ |
| 7013 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7014 | psk_identity=def psk=beef" \ |
| 7015 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7016 | -C "session hash for extended master secret"\ |
| 7017 | -S "session hash for extended master secret"\ |
| 7018 | -S "SSL - The handshake negotiation failed" \ |
| 7019 | -S "SSL - Unknown identity received" \ |
| 7020 | -S "SSL - Verification of the message MAC failed" |
| 7021 | |
| 7022 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7024 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7025 | "$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" \ |
| 7026 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7027 | psk_identity=def psk=beef" \ |
| 7028 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7029 | -C "session hash for extended master secret"\ |
| 7030 | -S "session hash for extended master secret"\ |
| 7031 | -S "SSL - The handshake negotiation failed" \ |
| 7032 | -S "SSL - Unknown identity received" \ |
| 7033 | -S "SSL - Verification of the message MAC failed" |
| 7034 | |
| 7035 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7037 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7038 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7039 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7040 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7041 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7042 | 0 \ |
| 7043 | -c "session hash for extended master secret"\ |
| 7044 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7045 | -S "SSL - The handshake negotiation failed" \ |
| 7046 | -S "SSL - Unknown identity received" \ |
| 7047 | -S "SSL - Verification of the message MAC failed" |
| 7048 | |
| 7049 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7051 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7052 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7053 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7054 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7055 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7056 | 0 \ |
| 7057 | -c "session hash for extended master secret"\ |
| 7058 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7059 | -S "SSL - The handshake negotiation failed" \ |
| 7060 | -S "SSL - Unknown identity received" \ |
| 7061 | -S "SSL - Verification of the message MAC failed" |
| 7062 | |
| 7063 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7065 | 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] | 7066 | "$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" \ |
| 7067 | "$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] | 7068 | psk_identity=def psk=beef" \ |
| 7069 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7070 | -C "session hash for extended master secret"\ |
| 7071 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7072 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7073 | -S "SSL - Unknown identity received" \ |
| 7074 | -S "SSL - Verification of the message MAC failed" |
| 7075 | |
| 7076 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7078 | 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] | 7079 | "$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" \ |
| 7080 | "$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] | 7081 | psk_identity=def psk=beef" \ |
| 7082 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7083 | -C "session hash for extended master secret"\ |
| 7084 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7085 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7086 | -S "SSL - Unknown identity received" \ |
| 7087 | -S "SSL - Verification of the message MAC failed" |
| 7088 | |
| 7089 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7091 | 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] | 7092 | "$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" \ |
| 7093 | "$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] | 7094 | psk_identity=def psk=beef" \ |
| 7095 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7096 | -C "session hash for extended master secret"\ |
| 7097 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7098 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7099 | -S "SSL - Unknown identity received" \ |
| 7100 | -S "SSL - Verification of the message MAC failed" |
| 7101 | |
| 7102 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7104 | 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] | 7105 | "$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" \ |
| 7106 | "$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] | 7107 | psk_identity=def psk=beef" \ |
| 7108 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7109 | -C "session hash for extended master secret"\ |
| 7110 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7111 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7112 | -S "SSL - Unknown identity received" \ |
| 7113 | -S "SSL - Verification of the message MAC failed" |
| 7114 | |
| 7115 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7117 | 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] | 7118 | "$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" \ |
| 7119 | "$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] | 7120 | psk_identity=def psk=beef" \ |
| 7121 | 1 \ |
| 7122 | -s "SSL - Verification of the message MAC failed" |
| 7123 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7125 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7126 | "$P_SRV" \ |
| 7127 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7128 | psk_identity=foo psk=abc123" \ |
| 7129 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7130 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7131 | -S "SSL - Unknown identity received" \ |
| 7132 | -S "SSL - Verification of the message MAC failed" |
| 7133 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7135 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7136 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7137 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7138 | psk_identity=foo psk=abc123" \ |
| 7139 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7140 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7141 | -s "SSL - Unknown identity received" \ |
| 7142 | -S "SSL - Verification of the message MAC failed" |
| 7143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7145 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7146 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7147 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7148 | psk_identity=abc psk=dead" \ |
| 7149 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7150 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7151 | -S "SSL - Unknown identity received" \ |
| 7152 | -S "SSL - Verification of the message MAC failed" |
| 7153 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7155 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7156 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7157 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7158 | psk_identity=def psk=beef" \ |
| 7159 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7160 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7161 | -S "SSL - Unknown identity received" \ |
| 7162 | -S "SSL - Verification of the message MAC failed" |
| 7163 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7165 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7166 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7167 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7168 | psk_identity=ghi psk=beef" \ |
| 7169 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7170 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7171 | -s "SSL - Unknown identity received" \ |
| 7172 | -S "SSL - Verification of the message MAC failed" |
| 7173 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7175 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7176 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7177 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7178 | psk_identity=abc psk=beef" \ |
| 7179 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7180 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7181 | -S "SSL - Unknown identity received" \ |
| 7182 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7183 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7184 | # Tests for EC J-PAKE |
| 7185 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7186 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7188 | run_test "ECJPAKE: client not configured" \ |
| 7189 | "$P_SRV debug_level=3" \ |
| 7190 | "$P_CLI debug_level=3" \ |
| 7191 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7192 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7193 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7194 | -S "found ecjpake kkpp extension" \ |
| 7195 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7196 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7197 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7198 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7199 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7200 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7201 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7203 | run_test "ECJPAKE: server not configured" \ |
| 7204 | "$P_SRV debug_level=3" \ |
| 7205 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7206 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7207 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7208 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7209 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7210 | -s "found ecjpake kkpp extension" \ |
| 7211 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7212 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7213 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7214 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7215 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7216 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7217 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7219 | run_test "ECJPAKE: working, TLS" \ |
| 7220 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7221 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7222 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7223 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7224 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7225 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7226 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7227 | -s "found ecjpake kkpp extension" \ |
| 7228 | -S "skip ecjpake kkpp extension" \ |
| 7229 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7230 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7231 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7232 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7233 | -S "SSL - Verification of the message MAC failed" |
| 7234 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7235 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7236 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7238 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 7239 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7240 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 7241 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7242 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7243 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7244 | -s "SSL - Verification of the message MAC failed" |
| 7245 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7246 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7248 | run_test "ECJPAKE: working, DTLS" \ |
| 7249 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7250 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7251 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7252 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7253 | -c "re-using cached ecjpake parameters" \ |
| 7254 | -S "SSL - Verification of the message MAC failed" |
| 7255 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7256 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7258 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 7259 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 7260 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7261 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7262 | 0 \ |
| 7263 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7264 | -S "SSL - Verification of the message MAC failed" |
| 7265 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7266 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7267 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7269 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 7270 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7271 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 7272 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7273 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7274 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7275 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7276 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 7277 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7278 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 7280 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 7281 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 7282 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 7283 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7284 | 0 |
| 7285 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 7286 | # Test for ClientHello without extensions |
| 7287 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 7288 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 7290 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 7291 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7292 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 7293 | 0 \ |
| 7294 | -s "dumping 'client hello extensions' (0 bytes)" |
| 7295 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7296 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7297 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7298 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7300 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7301 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7302 | "$P_CLI request_size=100" \ |
| 7303 | 0 \ |
| 7304 | -s "Read from client: 100 bytes read$" |
| 7305 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7307 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 7308 | "$P_SRV buffer_size=100" \ |
| 7309 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7310 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7311 | -s "Read from client: 101 bytes read (100 + 1)" |
| 7312 | |
| 7313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7314 | requires_max_content_len 200 |
| 7315 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 7316 | "$P_SRV buffer_size=100" \ |
| 7317 | "$P_CLI request_size=200" \ |
| 7318 | 0 \ |
| 7319 | -s "Read from client: 200 bytes read (100 + 100)" |
| 7320 | |
| 7321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7322 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 7323 | "$P_SRV buffer_size=100" \ |
| 7324 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 7325 | 0 \ |
| 7326 | -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] | 7327 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7328 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7329 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7330 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7331 | "$P_SRV force_version=tls12" \ |
| 7332 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7333 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7334 | 0 \ |
| 7335 | -s "Read from client: 1 bytes read" |
| 7336 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7337 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7338 | "$P_SRV force_version=tls12" \ |
| 7339 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7340 | 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] | 7341 | 0 \ |
| 7342 | -s "Read from client: 1 bytes read" |
| 7343 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7344 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7345 | "$P_SRV force_version=tls12" \ |
| 7346 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7347 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7348 | 0 \ |
| 7349 | -s "Read from client: 1 bytes read" |
| 7350 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7351 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7352 | "$P_SRV force_version=tls12" \ |
| 7353 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7354 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7355 | 0 \ |
| 7356 | -s "Read from client: 1 bytes read" |
| 7357 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7358 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7359 | "$P_SRV force_version=tls12" \ |
| 7360 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7361 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7362 | 0 \ |
| 7363 | -s "Read from client: 1 bytes read" |
| 7364 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7365 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7366 | |
| 7367 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7368 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7369 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7370 | "$P_CLI dtls=1 request_size=1 \ |
| 7371 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7372 | 0 \ |
| 7373 | -s "Read from client: 1 bytes read" |
| 7374 | |
| 7375 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7376 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7377 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7378 | "$P_CLI dtls=1 request_size=1 \ |
| 7379 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7380 | 0 \ |
| 7381 | -s "Read from client: 1 bytes read" |
| 7382 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7383 | # Tests for small server packets |
| 7384 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7385 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7386 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7387 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7388 | 0 \ |
| 7389 | -c "Read from server: 1 bytes read" |
| 7390 | |
| 7391 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
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 etm=0" \ |
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 larger MAC" \ |
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-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7400 | 0 \ |
| 7401 | -c "Read from server: 1 bytes read" |
| 7402 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7403 | run_test "Small server packet TLS 1.2 AEAD" \ |
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-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7406 | 0 \ |
| 7407 | -c "Read from server: 1 bytes read" |
| 7408 | |
| 7409 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
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-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7412 | 0 \ |
| 7413 | -c "Read from server: 1 bytes read" |
| 7414 | |
| 7415 | # Tests for small server packets in DTLS |
| 7416 | |
| 7417 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7418 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7419 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7420 | "$P_CLI dtls=1 \ |
| 7421 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7422 | 0 \ |
| 7423 | -c "Read from server: 1 bytes read" |
| 7424 | |
| 7425 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7426 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7427 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7428 | "$P_CLI dtls=1 \ |
| 7429 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7430 | 0 \ |
| 7431 | -c "Read from server: 1 bytes read" |
| 7432 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7433 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7434 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7435 | # How many fragments do we expect to write $1 bytes? |
| 7436 | fragments_for_write() { |
| 7437 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 7438 | } |
| 7439 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7440 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7441 | "$P_SRV force_version=tls12" \ |
| 7442 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7443 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7444 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7445 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7446 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7447 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7448 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7449 | "$P_SRV force_version=tls12" \ |
| 7450 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7451 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7452 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7453 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7454 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7455 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7456 | "$P_SRV force_version=tls12" \ |
| 7457 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7458 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7459 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7460 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7461 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7462 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7463 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7464 | "$P_SRV force_version=tls12" \ |
| 7465 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7466 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7467 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7468 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7469 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7470 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7471 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7472 | "$P_SRV force_version=tls12" \ |
| 7473 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7474 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7475 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7476 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7477 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7478 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7479 | # 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] | 7480 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7481 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7482 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7483 | 0 \ |
| 7484 | -c "Read from server: 16384 bytes read" |
| 7485 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7486 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7487 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7488 | "$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] | 7489 | 0 \ |
| 7490 | -s "16384 bytes written in 1 fragments" \ |
| 7491 | -c "Read from server: 16384 bytes read" |
| 7492 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7493 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7494 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7495 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7496 | 0 \ |
| 7497 | -c "Read from server: 16384 bytes read" |
| 7498 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7499 | 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] | 7500 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 7501 | "$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] | 7502 | 0 \ |
| 7503 | -s "16384 bytes written in 1 fragments" \ |
| 7504 | -c "Read from server: 16384 bytes read" |
| 7505 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7506 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7507 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7508 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7509 | 0 \ |
| 7510 | -c "Read from server: 16384 bytes read" |
| 7511 | |
| 7512 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
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-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7515 | 0 \ |
| 7516 | -c "Read from server: 16384 bytes read" |
| 7517 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7518 | # Tests for restartable ECC |
| 7519 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7520 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 7521 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7522 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7523 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7525 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7526 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7527 | "$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] | 7528 | 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] | 7529 | debug_level=1" \ |
| 7530 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7531 | -C "x509_verify_cert.*4b00" \ |
| 7532 | -C "mbedtls_pk_verify.*4b00" \ |
| 7533 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7534 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7535 | |
| 7536 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7537 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7538 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7539 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7540 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7541 | "$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] | 7542 | 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] | 7543 | debug_level=1 ec_max_ops=0" \ |
| 7544 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7545 | -C "x509_verify_cert.*4b00" \ |
| 7546 | -C "mbedtls_pk_verify.*4b00" \ |
| 7547 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7548 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7549 | |
| 7550 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7551 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7553 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7554 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7555 | "$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] | 7556 | 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] | 7557 | debug_level=1 ec_max_ops=65535" \ |
| 7558 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7559 | -C "x509_verify_cert.*4b00" \ |
| 7560 | -C "mbedtls_pk_verify.*4b00" \ |
| 7561 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7562 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7563 | |
| 7564 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7565 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7567 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7568 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7569 | "$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] | 7570 | 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] | 7571 | debug_level=1 ec_max_ops=1000" \ |
| 7572 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7573 | -c "x509_verify_cert.*4b00" \ |
| 7574 | -c "mbedtls_pk_verify.*4b00" \ |
| 7575 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7576 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7577 | |
| 7578 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7579 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7581 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7582 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7583 | crt_file=data_files/server5-badsign.crt \ |
| 7584 | key_file=data_files/server5.key" \ |
| 7585 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7586 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7587 | debug_level=1 ec_max_ops=1000" \ |
| 7588 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7589 | -c "x509_verify_cert.*4b00" \ |
| 7590 | -C "mbedtls_pk_verify.*4b00" \ |
| 7591 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7592 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7593 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7594 | -c "! mbedtls_ssl_handshake returned" \ |
| 7595 | -c "X509 - Certificate verification failed" |
| 7596 | |
| 7597 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7598 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7600 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7601 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7602 | crt_file=data_files/server5-badsign.crt \ |
| 7603 | key_file=data_files/server5.key" \ |
| 7604 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7605 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7606 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7607 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7608 | -c "x509_verify_cert.*4b00" \ |
| 7609 | -c "mbedtls_pk_verify.*4b00" \ |
| 7610 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7611 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7612 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7613 | -C "! mbedtls_ssl_handshake returned" \ |
| 7614 | -C "X509 - Certificate verification failed" |
| 7615 | |
| 7616 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7617 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7619 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7620 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7621 | crt_file=data_files/server5-badsign.crt \ |
| 7622 | key_file=data_files/server5.key" \ |
| 7623 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7624 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7625 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7626 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7627 | -C "x509_verify_cert.*4b00" \ |
| 7628 | -c "mbedtls_pk_verify.*4b00" \ |
| 7629 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7630 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7631 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7632 | -C "! mbedtls_ssl_handshake returned" \ |
| 7633 | -C "X509 - Certificate verification failed" |
| 7634 | |
| 7635 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7636 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7638 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7639 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7640 | "$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] | 7641 | 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] | 7642 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7643 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7644 | -c "x509_verify_cert.*4b00" \ |
| 7645 | -c "mbedtls_pk_verify.*4b00" \ |
| 7646 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7647 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7648 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7649 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7650 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7652 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7653 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7654 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7655 | debug_level=1 ec_max_ops=1000" \ |
| 7656 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7657 | -c "x509_verify_cert.*4b00" \ |
| 7658 | -c "mbedtls_pk_verify.*4b00" \ |
| 7659 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7660 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7661 | |
| 7662 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7663 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7665 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7666 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7667 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7668 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7669 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7670 | -C "x509_verify_cert.*4b00" \ |
| 7671 | -C "mbedtls_pk_verify.*4b00" \ |
| 7672 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7673 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7674 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7675 | # Tests of asynchronous private key support in SSL |
| 7676 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7677 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7679 | run_test "SSL async private: sign, delay=0" \ |
| 7680 | "$P_SRV \ |
| 7681 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7682 | "$P_CLI" \ |
| 7683 | 0 \ |
| 7684 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7685 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7686 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7687 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7689 | run_test "SSL async private: sign, delay=1" \ |
| 7690 | "$P_SRV \ |
| 7691 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7692 | "$P_CLI" \ |
| 7693 | 0 \ |
| 7694 | -s "Async sign callback: using key slot " \ |
| 7695 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7696 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7697 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7698 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7700 | run_test "SSL async private: sign, delay=2" \ |
| 7701 | "$P_SRV \ |
| 7702 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7703 | "$P_CLI" \ |
| 7704 | 0 \ |
| 7705 | -s "Async sign callback: using key slot " \ |
| 7706 | -U "Async sign callback: using key slot " \ |
| 7707 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7708 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7709 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7710 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7711 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 7712 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7714 | run_test "SSL async private: sign, SNI" \ |
| 7715 | "$P_SRV debug_level=3 \ |
| 7716 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7717 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7718 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7719 | "$P_CLI server_name=polarssl.example" \ |
| 7720 | 0 \ |
| 7721 | -s "Async sign callback: using key slot " \ |
| 7722 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7723 | -s "parse ServerName extension" \ |
| 7724 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7725 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7726 | |
| 7727 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7729 | run_test "SSL async private: decrypt, delay=0" \ |
| 7730 | "$P_SRV \ |
| 7731 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7732 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7733 | 0 \ |
| 7734 | -s "Async decrypt callback: using key slot " \ |
| 7735 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7736 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7737 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7739 | run_test "SSL async private: decrypt, delay=1" \ |
| 7740 | "$P_SRV \ |
| 7741 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7742 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7743 | 0 \ |
| 7744 | -s "Async decrypt callback: using key slot " \ |
| 7745 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7746 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7747 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7748 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7750 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7751 | "$P_SRV psk=abc123 \ |
| 7752 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7753 | "$P_CLI psk=abc123 \ |
| 7754 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7755 | 0 \ |
| 7756 | -s "Async decrypt callback: using key slot " \ |
| 7757 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7758 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7759 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7761 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7762 | "$P_SRV psk=abc123 \ |
| 7763 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7764 | "$P_CLI psk=abc123 \ |
| 7765 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7766 | 0 \ |
| 7767 | -s "Async decrypt callback: using key slot " \ |
| 7768 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7769 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7770 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7771 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7773 | run_test "SSL async private: sign callback not present" \ |
| 7774 | "$P_SRV \ |
| 7775 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7776 | "$P_CLI; [ \$? -eq 1 ] && |
| 7777 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7778 | 0 \ |
| 7779 | -S "Async sign callback" \ |
| 7780 | -s "! mbedtls_ssl_handshake returned" \ |
| 7781 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7782 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7783 | -s "Successful connection" |
| 7784 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7785 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7787 | run_test "SSL async private: decrypt callback not present" \ |
| 7788 | "$P_SRV debug_level=1 \ |
| 7789 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7790 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7791 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7792 | 0 \ |
| 7793 | -S "Async decrypt callback" \ |
| 7794 | -s "! mbedtls_ssl_handshake returned" \ |
| 7795 | -s "got no RSA private key" \ |
| 7796 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7797 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7798 | |
| 7799 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7800 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7802 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7803 | "$P_SRV \ |
| 7804 | async_operations=s async_private_delay1=1 \ |
| 7805 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7806 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7807 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7808 | 0 \ |
| 7809 | -s "Async sign callback: using key slot 0," \ |
| 7810 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7811 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7812 | |
| 7813 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7814 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7816 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7817 | "$P_SRV \ |
| 7818 | async_operations=s async_private_delay2=1 \ |
| 7819 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7820 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7821 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7822 | 0 \ |
| 7823 | -s "Async sign callback: using key slot 0," \ |
| 7824 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7825 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7826 | |
| 7827 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7828 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7830 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7831 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7832 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7833 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7834 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7835 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7836 | 0 \ |
| 7837 | -s "Async sign callback: using key slot 1," \ |
| 7838 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7839 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7840 | |
| 7841 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7842 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7844 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7845 | "$P_SRV \ |
| 7846 | async_operations=s async_private_delay1=1 \ |
| 7847 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7848 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7849 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7850 | 0 \ |
| 7851 | -s "Async sign callback: no key matches this certificate." |
| 7852 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7853 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7855 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7856 | "$P_SRV \ |
| 7857 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7858 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7859 | "$P_CLI" \ |
| 7860 | 1 \ |
| 7861 | -s "Async sign callback: injected error" \ |
| 7862 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7863 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7864 | -s "! mbedtls_ssl_handshake returned" |
| 7865 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7866 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7868 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7869 | "$P_SRV \ |
| 7870 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7871 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7872 | "$P_CLI" \ |
| 7873 | 1 \ |
| 7874 | -s "Async sign callback: using key slot " \ |
| 7875 | -S "Async resume" \ |
| 7876 | -s "Async cancel" |
| 7877 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7878 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7880 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7881 | "$P_SRV \ |
| 7882 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7883 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7884 | "$P_CLI" \ |
| 7885 | 1 \ |
| 7886 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7887 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7888 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7889 | -s "! mbedtls_ssl_handshake returned" |
| 7890 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7891 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7893 | run_test "SSL async private: decrypt, error in start" \ |
| 7894 | "$P_SRV \ |
| 7895 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7896 | async_private_error=1" \ |
| 7897 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7898 | 1 \ |
| 7899 | -s "Async decrypt callback: injected error" \ |
| 7900 | -S "Async resume" \ |
| 7901 | -S "Async cancel" \ |
| 7902 | -s "! mbedtls_ssl_handshake returned" |
| 7903 | |
| 7904 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7906 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7907 | "$P_SRV \ |
| 7908 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7909 | async_private_error=2" \ |
| 7910 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7911 | 1 \ |
| 7912 | -s "Async decrypt callback: using key slot " \ |
| 7913 | -S "Async resume" \ |
| 7914 | -s "Async cancel" |
| 7915 | |
| 7916 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7918 | run_test "SSL async private: decrypt, error in resume" \ |
| 7919 | "$P_SRV \ |
| 7920 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7921 | async_private_error=3" \ |
| 7922 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7923 | 1 \ |
| 7924 | -s "Async decrypt callback: using key slot " \ |
| 7925 | -s "Async resume callback: decrypt done but injected error" \ |
| 7926 | -S "Async cancel" \ |
| 7927 | -s "! mbedtls_ssl_handshake returned" |
| 7928 | |
| 7929 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7931 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7932 | "$P_SRV \ |
| 7933 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7934 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7935 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7936 | 0 \ |
| 7937 | -s "Async cancel" \ |
| 7938 | -s "! mbedtls_ssl_handshake returned" \ |
| 7939 | -s "Async resume" \ |
| 7940 | -s "Successful connection" |
| 7941 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7942 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7944 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7945 | "$P_SRV \ |
| 7946 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7947 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7948 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7949 | 0 \ |
| 7950 | -s "! mbedtls_ssl_handshake returned" \ |
| 7951 | -s "Async resume" \ |
| 7952 | -s "Successful connection" |
| 7953 | |
| 7954 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7955 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7957 | 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] | 7958 | "$P_SRV \ |
| 7959 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7960 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7961 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7962 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7963 | [ \$? -eq 1 ] && |
| 7964 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7965 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7966 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7967 | -S "Async resume" \ |
| 7968 | -s "Async cancel" \ |
| 7969 | -s "! mbedtls_ssl_handshake returned" \ |
| 7970 | -s "Async sign callback: no key matches this certificate." \ |
| 7971 | -s "Successful connection" |
| 7972 | |
| 7973 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7974 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7976 | 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] | 7977 | "$P_SRV \ |
| 7978 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7979 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7980 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7981 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7982 | [ \$? -eq 1 ] && |
| 7983 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7984 | 0 \ |
| 7985 | -s "Async resume" \ |
| 7986 | -s "! mbedtls_ssl_handshake returned" \ |
| 7987 | -s "Async sign callback: no key matches this certificate." \ |
| 7988 | -s "Successful connection" |
| 7989 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7990 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7991 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7993 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7994 | "$P_SRV \ |
| 7995 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7996 | exchanges=2 renegotiation=1" \ |
| 7997 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7998 | 0 \ |
| 7999 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8000 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8001 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8002 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8003 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8005 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8006 | "$P_SRV \ |
| 8007 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8008 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8009 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8010 | 0 \ |
| 8011 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8012 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8013 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8014 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8015 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8017 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8018 | "$P_SRV \ |
| 8019 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8020 | exchanges=2 renegotiation=1" \ |
| 8021 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8022 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8023 | 0 \ |
| 8024 | -s "Async decrypt callback: using key slot " \ |
| 8025 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8026 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8027 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8028 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8030 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8031 | "$P_SRV \ |
| 8032 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8033 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8034 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8035 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8036 | 0 \ |
| 8037 | -s "Async decrypt callback: using key slot " \ |
| 8038 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8039 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8040 | # Tests for ECC extensions (rfc 4492) |
| 8041 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8042 | requires_config_enabled MBEDTLS_AES_C |
| 8043 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8044 | requires_config_enabled MBEDTLS_SHA256_C |
| 8045 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8047 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8048 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8049 | "$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] | 8050 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8051 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8052 | -C "client hello, adding supported_point_formats extension" \ |
| 8053 | -S "found supported elliptic curves extension" \ |
| 8054 | -S "found supported point formats extension" |
| 8055 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8056 | requires_config_enabled MBEDTLS_AES_C |
| 8057 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8058 | requires_config_enabled MBEDTLS_SHA256_C |
| 8059 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8061 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8062 | "$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] | 8063 | "$P_CLI debug_level=3" \ |
| 8064 | 0 \ |
| 8065 | -C "found supported_point_formats extension" \ |
| 8066 | -S "server hello, supported_point_formats extension" |
| 8067 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8068 | requires_config_enabled MBEDTLS_AES_C |
| 8069 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8070 | requires_config_enabled MBEDTLS_SHA256_C |
| 8071 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8073 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8074 | "$P_SRV debug_level=3" \ |
| 8075 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8076 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8077 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8078 | -c "client hello, adding supported_point_formats extension" \ |
| 8079 | -s "found supported elliptic curves extension" \ |
| 8080 | -s "found supported point formats extension" |
| 8081 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8082 | requires_config_enabled MBEDTLS_AES_C |
| 8083 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8084 | requires_config_enabled MBEDTLS_SHA256_C |
| 8085 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8087 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8088 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8089 | "$P_CLI debug_level=3" \ |
| 8090 | 0 \ |
| 8091 | -c "found supported_point_formats extension" \ |
| 8092 | -s "server hello, supported_point_formats extension" |
| 8093 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8094 | # Tests for DTLS HelloVerifyRequest |
| 8095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8097 | run_test "DTLS cookie: enabled" \ |
| 8098 | "$P_SRV dtls=1 debug_level=2" \ |
| 8099 | "$P_CLI dtls=1 debug_level=2" \ |
| 8100 | 0 \ |
| 8101 | -s "cookie verification failed" \ |
| 8102 | -s "cookie verification passed" \ |
| 8103 | -S "cookie verification skipped" \ |
| 8104 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8105 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8106 | -S "SSL - The requested feature is not available" |
| 8107 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8109 | run_test "DTLS cookie: disabled" \ |
| 8110 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8111 | "$P_CLI dtls=1 debug_level=2" \ |
| 8112 | 0 \ |
| 8113 | -S "cookie verification failed" \ |
| 8114 | -S "cookie verification passed" \ |
| 8115 | -s "cookie verification skipped" \ |
| 8116 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8117 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8118 | -S "SSL - The requested feature is not available" |
| 8119 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8121 | run_test "DTLS cookie: default (failing)" \ |
| 8122 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8123 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8124 | 1 \ |
| 8125 | -s "cookie verification failed" \ |
| 8126 | -S "cookie verification passed" \ |
| 8127 | -S "cookie verification skipped" \ |
| 8128 | -C "received hello verify request" \ |
| 8129 | -S "hello verification requested" \ |
| 8130 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8131 | |
| 8132 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8134 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8135 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8136 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8137 | 0 \ |
| 8138 | -s "cookie verification failed" \ |
| 8139 | -s "cookie verification passed" \ |
| 8140 | -S "cookie verification skipped" \ |
| 8141 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8142 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8143 | -S "SSL - The requested feature is not available" |
| 8144 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8146 | run_test "DTLS cookie: enabled, nbio" \ |
| 8147 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8148 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8149 | 0 \ |
| 8150 | -s "cookie verification failed" \ |
| 8151 | -s "cookie verification passed" \ |
| 8152 | -S "cookie verification skipped" \ |
| 8153 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8154 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8155 | -S "SSL - The requested feature is not available" |
| 8156 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8157 | # Tests for client reconnecting from the same port with DTLS |
| 8158 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8159 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8161 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8162 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8163 | "$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] | 8164 | 0 \ |
| 8165 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8166 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8167 | -S "Client initiated reconnection from same port" |
| 8168 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8169 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8171 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8172 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8173 | "$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] | 8174 | 0 \ |
| 8175 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8176 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8177 | -s "Client initiated reconnection from same port" |
| 8178 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8179 | 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] | 8180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8181 | 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] | 8182 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 8183 | "$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] | 8184 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8185 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8186 | -s "Client initiated reconnection from same port" |
| 8187 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8188 | 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] | 8189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8190 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 8191 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 8192 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 8193 | 0 \ |
| 8194 | -S "The operation timed out" \ |
| 8195 | -s "Client initiated reconnection from same port" |
| 8196 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8198 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 8199 | "$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] | 8200 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 8201 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8202 | -s "The operation timed out" \ |
| 8203 | -S "Client initiated reconnection from same port" |
| 8204 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 8206 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 8207 | -p "$P_PXY inject_clihlo=1" \ |
| 8208 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 8209 | "$P_CLI dtls=1 exchanges=2" \ |
| 8210 | 0 \ |
| 8211 | -s "possible client reconnect from the same port" \ |
| 8212 | -S "Client initiated reconnection from same port" |
| 8213 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8214 | # Tests for various cases of client authentication with DTLS |
| 8215 | # (focused on handshake flows and message parsing) |
| 8216 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8218 | run_test "DTLS client auth: required" \ |
| 8219 | "$P_SRV dtls=1 auth_mode=required" \ |
| 8220 | "$P_CLI dtls=1" \ |
| 8221 | 0 \ |
| 8222 | -s "Verifying peer X.509 certificate... ok" |
| 8223 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8225 | run_test "DTLS client auth: optional, client has no cert" \ |
| 8226 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 8227 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 8228 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8229 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8232 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8233 | "$P_SRV dtls=1 auth_mode=none" \ |
| 8234 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 8235 | 0 \ |
| 8236 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8237 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8238 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 8240 | run_test "DTLS wrong PSK: badmac alert" \ |
| 8241 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 8242 | "$P_CLI dtls=1 psk=abc124" \ |
| 8243 | 1 \ |
| 8244 | -s "SSL - Verification of the message MAC failed" \ |
| 8245 | -c "SSL - A fatal alert message was received from our peer" |
| 8246 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8247 | # Tests for receiving fragmented handshake messages with DTLS |
| 8248 | |
| 8249 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8251 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 8252 | "$G_SRV -u --mtu 2048 -a" \ |
| 8253 | "$P_CLI dtls=1 debug_level=2" \ |
| 8254 | 0 \ |
| 8255 | -C "found fragmented DTLS handshake message" \ |
| 8256 | -C "error" |
| 8257 | |
| 8258 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8260 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8261 | "$G_SRV -u --mtu 512" \ |
| 8262 | "$P_CLI dtls=1 debug_level=2" \ |
| 8263 | 0 \ |
| 8264 | -c "found fragmented DTLS handshake message" \ |
| 8265 | -C "error" |
| 8266 | |
| 8267 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8269 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8270 | "$G_SRV -u --mtu 128" \ |
| 8271 | "$P_CLI dtls=1 debug_level=2" \ |
| 8272 | 0 \ |
| 8273 | -c "found fragmented DTLS handshake message" \ |
| 8274 | -C "error" |
| 8275 | |
| 8276 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8278 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8279 | "$G_SRV -u --mtu 128" \ |
| 8280 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8281 | 0 \ |
| 8282 | -c "found fragmented DTLS handshake message" \ |
| 8283 | -C "error" |
| 8284 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8285 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8286 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8288 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8289 | "$G_SRV -u --mtu 256" \ |
| 8290 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8291 | 0 \ |
| 8292 | -c "found fragmented DTLS handshake message" \ |
| 8293 | -c "client hello, adding renegotiation extension" \ |
| 8294 | -c "found renegotiation extension" \ |
| 8295 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8296 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8297 | -C "error" \ |
| 8298 | -s "Extra-header:" |
| 8299 | |
| 8300 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8301 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8303 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8304 | "$G_SRV -u --mtu 256" \ |
| 8305 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8306 | 0 \ |
| 8307 | -c "found fragmented DTLS handshake message" \ |
| 8308 | -c "client hello, adding renegotiation extension" \ |
| 8309 | -c "found renegotiation extension" \ |
| 8310 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8311 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8312 | -C "error" \ |
| 8313 | -s "Extra-header:" |
| 8314 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8316 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8317 | "$O_SRV -dtls -mtu 2048" \ |
| 8318 | "$P_CLI dtls=1 debug_level=2" \ |
| 8319 | 0 \ |
| 8320 | -C "found fragmented DTLS handshake message" \ |
| 8321 | -C "error" |
| 8322 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8324 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8325 | "$O_SRV -dtls -mtu 768" \ |
| 8326 | "$P_CLI dtls=1 debug_level=2" \ |
| 8327 | 0 \ |
| 8328 | -c "found fragmented DTLS handshake message" \ |
| 8329 | -C "error" |
| 8330 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8332 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 8333 | "$O_SRV -dtls -mtu 256" \ |
| 8334 | "$P_CLI dtls=1 debug_level=2" \ |
| 8335 | 0 \ |
| 8336 | -c "found fragmented DTLS handshake message" \ |
| 8337 | -C "error" |
| 8338 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8340 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8341 | "$O_SRV -dtls -mtu 256" \ |
| 8342 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8343 | 0 \ |
| 8344 | -c "found fragmented DTLS handshake message" \ |
| 8345 | -C "error" |
| 8346 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8347 | # Tests for sending fragmented handshake messages with DTLS |
| 8348 | # |
| 8349 | # Use client auth when we need the client to send large messages, |
| 8350 | # and use large cert chains on both sides too (the long chains we have all use |
| 8351 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8352 | # Sizes reached (UDP payload): |
| 8353 | # - 2037B for server certificate |
| 8354 | # - 1542B for client certificate |
| 8355 | # - 1013B for newsessionticket |
| 8356 | # - all others below 512B |
| 8357 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8358 | |
| 8359 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8360 | requires_config_enabled MBEDTLS_RSA_C |
| 8361 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8362 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8363 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8365 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8366 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8367 | crt_file=data_files/server7_int-ca.crt \ |
| 8368 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8369 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8370 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8371 | "$P_CLI dtls=1 debug_level=2 \ |
| 8372 | crt_file=data_files/server8_int-ca2.crt \ |
| 8373 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8374 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8375 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8376 | 0 \ |
| 8377 | -S "found fragmented DTLS handshake message" \ |
| 8378 | -C "found fragmented DTLS handshake message" \ |
| 8379 | -C "error" |
| 8380 | |
| 8381 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8382 | requires_config_enabled MBEDTLS_RSA_C |
| 8383 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8384 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8385 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8387 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8388 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8389 | crt_file=data_files/server7_int-ca.crt \ |
| 8390 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8391 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8392 | max_frag_len=1024" \ |
| 8393 | "$P_CLI dtls=1 debug_level=2 \ |
| 8394 | crt_file=data_files/server8_int-ca2.crt \ |
| 8395 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8396 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8397 | max_frag_len=2048" \ |
| 8398 | 0 \ |
| 8399 | -S "found fragmented DTLS handshake message" \ |
| 8400 | -c "found fragmented DTLS handshake message" \ |
| 8401 | -C "error" |
| 8402 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8403 | # With the MFL extension, the server has no way of forcing |
| 8404 | # the client to not exceed a certain MTU; hence, the following |
| 8405 | # test can't be replicated with an MTU proxy such as the one |
| 8406 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8407 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8408 | requires_config_enabled MBEDTLS_RSA_C |
| 8409 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8410 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8411 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8413 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8414 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8415 | crt_file=data_files/server7_int-ca.crt \ |
| 8416 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8417 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8418 | max_frag_len=512" \ |
| 8419 | "$P_CLI dtls=1 debug_level=2 \ |
| 8420 | crt_file=data_files/server8_int-ca2.crt \ |
| 8421 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8422 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8423 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8424 | 0 \ |
| 8425 | -S "found fragmented DTLS handshake message" \ |
| 8426 | -c "found fragmented DTLS handshake message" \ |
| 8427 | -C "error" |
| 8428 | |
| 8429 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8430 | requires_config_enabled MBEDTLS_RSA_C |
| 8431 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8432 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8433 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8435 | 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] | 8436 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8437 | crt_file=data_files/server7_int-ca.crt \ |
| 8438 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8439 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8440 | max_frag_len=2048" \ |
| 8441 | "$P_CLI dtls=1 debug_level=2 \ |
| 8442 | crt_file=data_files/server8_int-ca2.crt \ |
| 8443 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8444 | hs_timeout=2500-60000 \ |
| 8445 | max_frag_len=1024" \ |
| 8446 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8447 | -S "found fragmented DTLS handshake message" \ |
| 8448 | -c "found fragmented DTLS handshake message" \ |
| 8449 | -C "error" |
| 8450 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8451 | # While not required by the standard defining the MFL extension |
| 8452 | # (according to which it only applies to records, not to datagrams), |
| 8453 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8454 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8455 | # to the peer. |
| 8456 | # The next test checks that no datagrams significantly larger than the |
| 8457 | # negotiated MFL are sent. |
| 8458 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8459 | requires_config_enabled MBEDTLS_RSA_C |
| 8460 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8461 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8462 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8464 | 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] | 8465 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8466 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8467 | crt_file=data_files/server7_int-ca.crt \ |
| 8468 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8469 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8470 | max_frag_len=2048" \ |
| 8471 | "$P_CLI dtls=1 debug_level=2 \ |
| 8472 | crt_file=data_files/server8_int-ca2.crt \ |
| 8473 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8474 | hs_timeout=2500-60000 \ |
| 8475 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8476 | 0 \ |
| 8477 | -S "found fragmented DTLS handshake message" \ |
| 8478 | -c "found fragmented DTLS handshake message" \ |
| 8479 | -C "error" |
| 8480 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8481 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8482 | requires_config_enabled MBEDTLS_RSA_C |
| 8483 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8484 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8485 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8487 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8488 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8489 | crt_file=data_files/server7_int-ca.crt \ |
| 8490 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8491 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8492 | max_frag_len=2048" \ |
| 8493 | "$P_CLI dtls=1 debug_level=2 \ |
| 8494 | crt_file=data_files/server8_int-ca2.crt \ |
| 8495 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8496 | hs_timeout=2500-60000 \ |
| 8497 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8498 | 0 \ |
| 8499 | -s "found fragmented DTLS handshake message" \ |
| 8500 | -c "found fragmented DTLS handshake message" \ |
| 8501 | -C "error" |
| 8502 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8503 | # While not required by the standard defining the MFL extension |
| 8504 | # (according to which it only applies to records, not to datagrams), |
| 8505 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8506 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8507 | # to the peer. |
| 8508 | # The next test checks that no datagrams significantly larger than the |
| 8509 | # negotiated MFL are sent. |
| 8510 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8511 | requires_config_enabled MBEDTLS_RSA_C |
| 8512 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8513 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8514 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8516 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8517 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8518 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8519 | crt_file=data_files/server7_int-ca.crt \ |
| 8520 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8521 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8522 | max_frag_len=2048" \ |
| 8523 | "$P_CLI dtls=1 debug_level=2 \ |
| 8524 | crt_file=data_files/server8_int-ca2.crt \ |
| 8525 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8526 | hs_timeout=2500-60000 \ |
| 8527 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8528 | 0 \ |
| 8529 | -s "found fragmented DTLS handshake message" \ |
| 8530 | -c "found fragmented DTLS handshake message" \ |
| 8531 | -C "error" |
| 8532 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8533 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8534 | requires_config_enabled MBEDTLS_RSA_C |
| 8535 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8536 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8538 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8539 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8540 | crt_file=data_files/server7_int-ca.crt \ |
| 8541 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8542 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8543 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8544 | "$P_CLI dtls=1 debug_level=2 \ |
| 8545 | crt_file=data_files/server8_int-ca2.crt \ |
| 8546 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8547 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8548 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8549 | 0 \ |
| 8550 | -S "found fragmented DTLS handshake message" \ |
| 8551 | -C "found fragmented DTLS handshake message" \ |
| 8552 | -C "error" |
| 8553 | |
| 8554 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8555 | requires_config_enabled MBEDTLS_RSA_C |
| 8556 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8557 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8559 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8560 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8561 | crt_file=data_files/server7_int-ca.crt \ |
| 8562 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8563 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8564 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8565 | "$P_CLI dtls=1 debug_level=2 \ |
| 8566 | crt_file=data_files/server8_int-ca2.crt \ |
| 8567 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8568 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8569 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8570 | 0 \ |
| 8571 | -s "found fragmented DTLS handshake message" \ |
| 8572 | -C "found fragmented DTLS handshake message" \ |
| 8573 | -C "error" |
| 8574 | |
| 8575 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8576 | requires_config_enabled MBEDTLS_RSA_C |
| 8577 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8578 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8580 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8581 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8582 | crt_file=data_files/server7_int-ca.crt \ |
| 8583 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8584 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8585 | mtu=512" \ |
| 8586 | "$P_CLI dtls=1 debug_level=2 \ |
| 8587 | crt_file=data_files/server8_int-ca2.crt \ |
| 8588 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8589 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8590 | mtu=2048" \ |
| 8591 | 0 \ |
| 8592 | -S "found fragmented DTLS handshake message" \ |
| 8593 | -c "found fragmented DTLS handshake message" \ |
| 8594 | -C "error" |
| 8595 | |
| 8596 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8597 | requires_config_enabled MBEDTLS_RSA_C |
| 8598 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8599 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8601 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8602 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8603 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8604 | crt_file=data_files/server7_int-ca.crt \ |
| 8605 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8606 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8607 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8608 | "$P_CLI dtls=1 debug_level=2 \ |
| 8609 | crt_file=data_files/server8_int-ca2.crt \ |
| 8610 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8611 | hs_timeout=2500-60000 \ |
| 8612 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8613 | 0 \ |
| 8614 | -s "found fragmented DTLS handshake message" \ |
| 8615 | -c "found fragmented DTLS handshake message" \ |
| 8616 | -C "error" |
| 8617 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8618 | # 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] | 8619 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8620 | requires_config_enabled MBEDTLS_RSA_C |
| 8621 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8622 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8623 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8624 | requires_config_enabled MBEDTLS_AES_C |
| 8625 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8626 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8627 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8628 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8629 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8630 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8631 | crt_file=data_files/server7_int-ca.crt \ |
| 8632 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8633 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8634 | mtu=512" \ |
| 8635 | "$P_CLI dtls=1 debug_level=2 \ |
| 8636 | crt_file=data_files/server8_int-ca2.crt \ |
| 8637 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8638 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8639 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8640 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8641 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8642 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8643 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8644 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8645 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8646 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8647 | # 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] | 8648 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8649 | # retransmissions, but in some cases (like both the server and client using |
| 8650 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8651 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8652 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8653 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8654 | requires_config_enabled MBEDTLS_RSA_C |
| 8655 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8656 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8657 | requires_config_enabled MBEDTLS_AES_C |
| 8658 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8659 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8661 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8662 | -p "$P_PXY mtu=508" \ |
| 8663 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8664 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8665 | key_file=data_files/server7.key \ |
| 8666 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8667 | "$P_CLI dtls=1 debug_level=2 \ |
| 8668 | crt_file=data_files/server8_int-ca2.crt \ |
| 8669 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8670 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8671 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8672 | 0 \ |
| 8673 | -s "found fragmented DTLS handshake message" \ |
| 8674 | -c "found fragmented DTLS handshake message" \ |
| 8675 | -C "error" |
| 8676 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8677 | # 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] | 8678 | only_with_valgrind |
| 8679 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8680 | requires_config_enabled MBEDTLS_RSA_C |
| 8681 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8682 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8683 | requires_config_enabled MBEDTLS_AES_C |
| 8684 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8685 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8687 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8688 | -p "$P_PXY mtu=508" \ |
| 8689 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8690 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8691 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8692 | hs_timeout=250-10000" \ |
| 8693 | "$P_CLI dtls=1 debug_level=2 \ |
| 8694 | crt_file=data_files/server8_int-ca2.crt \ |
| 8695 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8696 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8697 | hs_timeout=250-10000" \ |
| 8698 | 0 \ |
| 8699 | -s "found fragmented DTLS handshake message" \ |
| 8700 | -c "found fragmented DTLS handshake message" \ |
| 8701 | -C "error" |
| 8702 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8703 | # 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] | 8704 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8705 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8706 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8707 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8708 | requires_config_enabled MBEDTLS_RSA_C |
| 8709 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8710 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8712 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8713 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8714 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8715 | crt_file=data_files/server7_int-ca.crt \ |
| 8716 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8717 | hs_timeout=10000-60000 \ |
| 8718 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8719 | "$P_CLI dtls=1 debug_level=2 \ |
| 8720 | crt_file=data_files/server8_int-ca2.crt \ |
| 8721 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8722 | hs_timeout=10000-60000 \ |
| 8723 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8724 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8725 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8726 | -s "found fragmented DTLS handshake message" \ |
| 8727 | -c "found fragmented DTLS handshake message" \ |
| 8728 | -C "error" |
| 8729 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8730 | # 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] | 8731 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8732 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8733 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8734 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8735 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8736 | requires_config_enabled MBEDTLS_RSA_C |
| 8737 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8738 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8739 | requires_config_enabled MBEDTLS_AES_C |
| 8740 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8741 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8743 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8744 | -p "$P_PXY mtu=512" \ |
| 8745 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8746 | crt_file=data_files/server7_int-ca.crt \ |
| 8747 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8748 | hs_timeout=10000-60000 \ |
| 8749 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8750 | "$P_CLI dtls=1 debug_level=2 \ |
| 8751 | crt_file=data_files/server8_int-ca2.crt \ |
| 8752 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8753 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8754 | hs_timeout=10000-60000 \ |
| 8755 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8756 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8757 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8758 | -s "found fragmented DTLS handshake message" \ |
| 8759 | -c "found fragmented DTLS handshake message" \ |
| 8760 | -C "error" |
| 8761 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8762 | not_with_valgrind # spurious autoreduction due to timeout |
| 8763 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8764 | requires_config_enabled MBEDTLS_RSA_C |
| 8765 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8766 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8768 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8769 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8770 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8771 | crt_file=data_files/server7_int-ca.crt \ |
| 8772 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8773 | hs_timeout=10000-60000 \ |
| 8774 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8775 | "$P_CLI dtls=1 debug_level=2 \ |
| 8776 | crt_file=data_files/server8_int-ca2.crt \ |
| 8777 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8778 | hs_timeout=10000-60000 \ |
| 8779 | mtu=1024 nbio=2" \ |
| 8780 | 0 \ |
| 8781 | -S "autoreduction" \ |
| 8782 | -s "found fragmented DTLS handshake message" \ |
| 8783 | -c "found fragmented DTLS handshake message" \ |
| 8784 | -C "error" |
| 8785 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8786 | # 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] | 8787 | not_with_valgrind # spurious autoreduction due to timeout |
| 8788 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8789 | requires_config_enabled MBEDTLS_RSA_C |
| 8790 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8791 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8792 | requires_config_enabled MBEDTLS_AES_C |
| 8793 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8794 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8796 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8797 | -p "$P_PXY mtu=512" \ |
| 8798 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8799 | crt_file=data_files/server7_int-ca.crt \ |
| 8800 | key_file=data_files/server7.key \ |
| 8801 | hs_timeout=10000-60000 \ |
| 8802 | mtu=512 nbio=2" \ |
| 8803 | "$P_CLI dtls=1 debug_level=2 \ |
| 8804 | crt_file=data_files/server8_int-ca2.crt \ |
| 8805 | key_file=data_files/server8.key \ |
| 8806 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8807 | hs_timeout=10000-60000 \ |
| 8808 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8809 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8810 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8811 | -s "found fragmented DTLS handshake message" \ |
| 8812 | -c "found fragmented DTLS handshake message" \ |
| 8813 | -C "error" |
| 8814 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8815 | # 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] | 8816 | # This ensures things still work after session_reset(). |
| 8817 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8818 | # Since we don't support reading fragmented ClientHello yet, |
| 8819 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8820 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8821 | # An autoreduction on the client-side might happen if the server is |
| 8822 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8823 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8824 | # resumed listening, which would result in a spurious autoreduction. |
| 8825 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8826 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8827 | requires_config_enabled MBEDTLS_RSA_C |
| 8828 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8829 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8830 | requires_config_enabled MBEDTLS_AES_C |
| 8831 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8832 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8834 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8835 | -p "$P_PXY mtu=1450" \ |
| 8836 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8837 | crt_file=data_files/server7_int-ca.crt \ |
| 8838 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8839 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8840 | mtu=1450" \ |
| 8841 | "$P_CLI dtls=1 debug_level=2 \ |
| 8842 | crt_file=data_files/server8_int-ca2.crt \ |
| 8843 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8844 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8845 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8846 | 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] | 8847 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8848 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8849 | -s "found fragmented DTLS handshake message" \ |
| 8850 | -c "found fragmented DTLS handshake message" \ |
| 8851 | -C "error" |
| 8852 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8853 | # An autoreduction on the client-side might happen if the server is |
| 8854 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8855 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8856 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8857 | requires_config_enabled MBEDTLS_RSA_C |
| 8858 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8859 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8860 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8861 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8862 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8863 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8865 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8866 | -p "$P_PXY mtu=512" \ |
| 8867 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8868 | crt_file=data_files/server7_int-ca.crt \ |
| 8869 | key_file=data_files/server7.key \ |
| 8870 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8871 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8872 | mtu=512" \ |
| 8873 | "$P_CLI dtls=1 debug_level=2 \ |
| 8874 | crt_file=data_files/server8_int-ca2.crt \ |
| 8875 | key_file=data_files/server8.key \ |
| 8876 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8877 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8878 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8879 | mtu=512" \ |
| 8880 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8881 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8882 | -s "found fragmented DTLS handshake message" \ |
| 8883 | -c "found fragmented DTLS handshake message" \ |
| 8884 | -C "error" |
| 8885 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8886 | # An autoreduction on the client-side might happen if the server is |
| 8887 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8888 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8889 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8890 | requires_config_enabled MBEDTLS_RSA_C |
| 8891 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8892 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8893 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8894 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8895 | requires_config_enabled MBEDTLS_AES_C |
| 8896 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8897 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8898 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8899 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8900 | -p "$P_PXY mtu=512" \ |
| 8901 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8902 | crt_file=data_files/server7_int-ca.crt \ |
| 8903 | key_file=data_files/server7.key \ |
| 8904 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8905 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8906 | mtu=512" \ |
| 8907 | "$P_CLI dtls=1 debug_level=2 \ |
| 8908 | crt_file=data_files/server8_int-ca2.crt \ |
| 8909 | key_file=data_files/server8.key \ |
| 8910 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8911 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8912 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8913 | mtu=512" \ |
| 8914 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8915 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8916 | -s "found fragmented DTLS handshake message" \ |
| 8917 | -c "found fragmented DTLS handshake message" \ |
| 8918 | -C "error" |
| 8919 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8920 | # An autoreduction on the client-side might happen if the server is |
| 8921 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8922 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8923 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8924 | requires_config_enabled MBEDTLS_RSA_C |
| 8925 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8926 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8927 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8928 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8929 | requires_config_enabled MBEDTLS_AES_C |
| 8930 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8931 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8933 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8934 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8935 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8936 | crt_file=data_files/server7_int-ca.crt \ |
| 8937 | key_file=data_files/server7.key \ |
| 8938 | exchanges=2 renegotiation=1 \ |
| 8939 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8940 | hs_timeout=10000-60000 \ |
| 8941 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8942 | "$P_CLI dtls=1 debug_level=2 \ |
| 8943 | crt_file=data_files/server8_int-ca2.crt \ |
| 8944 | key_file=data_files/server8.key \ |
| 8945 | exchanges=2 renegotiation=1 renegotiate=1 \ |
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 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8949 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8950 | -s "found fragmented DTLS handshake message" \ |
| 8951 | -c "found fragmented DTLS handshake message" \ |
| 8952 | -C "error" |
| 8953 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8954 | # An autoreduction on the client-side might happen if the server is |
| 8955 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8956 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8957 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8958 | requires_config_enabled MBEDTLS_RSA_C |
| 8959 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8960 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8961 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8962 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8963 | requires_config_enabled MBEDTLS_AES_C |
| 8964 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8965 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8966 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8968 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8969 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8970 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8971 | crt_file=data_files/server7_int-ca.crt \ |
| 8972 | key_file=data_files/server7.key \ |
| 8973 | exchanges=2 renegotiation=1 \ |
| 8974 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8975 | hs_timeout=10000-60000 \ |
| 8976 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8977 | "$P_CLI dtls=1 debug_level=2 \ |
| 8978 | crt_file=data_files/server8_int-ca2.crt \ |
| 8979 | key_file=data_files/server8.key \ |
| 8980 | exchanges=2 renegotiation=1 renegotiate=1 \ |
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 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8984 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8985 | -s "found fragmented DTLS handshake message" \ |
| 8986 | -c "found fragmented DTLS handshake message" \ |
| 8987 | -C "error" |
| 8988 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8989 | # An autoreduction on the client-side might happen if the server is |
| 8990 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8991 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8992 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8993 | requires_config_enabled MBEDTLS_RSA_C |
| 8994 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8995 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8996 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8997 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8998 | requires_config_enabled MBEDTLS_AES_C |
| 8999 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9000 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9001 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9002 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9003 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9004 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9005 | crt_file=data_files/server7_int-ca.crt \ |
| 9006 | key_file=data_files/server7.key \ |
| 9007 | exchanges=2 renegotiation=1 \ |
| 9008 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9009 | hs_timeout=10000-60000 \ |
| 9010 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9011 | "$P_CLI dtls=1 debug_level=2 \ |
| 9012 | crt_file=data_files/server8_int-ca2.crt \ |
| 9013 | key_file=data_files/server8.key \ |
| 9014 | exchanges=2 renegotiation=1 renegotiate=1 \ |
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 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9018 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9019 | -s "found fragmented DTLS handshake message" \ |
| 9020 | -c "found fragmented DTLS handshake message" \ |
| 9021 | -C "error" |
| 9022 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9023 | # 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] | 9024 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9025 | requires_config_enabled MBEDTLS_RSA_C |
| 9026 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9027 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9028 | requires_config_enabled MBEDTLS_AES_C |
| 9029 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9030 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9031 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9033 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9034 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9035 | "$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] | 9036 | crt_file=data_files/server7_int-ca.crt \ |
| 9037 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9038 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9039 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9040 | crt_file=data_files/server8_int-ca2.crt \ |
| 9041 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9042 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9043 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9044 | 0 \ |
| 9045 | -s "found fragmented DTLS handshake message" \ |
| 9046 | -c "found fragmented DTLS handshake message" \ |
| 9047 | -C "error" |
| 9048 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9049 | # 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] | 9050 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9051 | requires_config_enabled MBEDTLS_RSA_C |
| 9052 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9053 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9054 | requires_config_enabled MBEDTLS_AES_C |
| 9055 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9056 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9057 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9059 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9060 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9061 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9062 | crt_file=data_files/server7_int-ca.crt \ |
| 9063 | key_file=data_files/server7.key \ |
| 9064 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9065 | "$P_CLI dtls=1 debug_level=2 \ |
| 9066 | crt_file=data_files/server8_int-ca2.crt \ |
| 9067 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9068 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9069 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9070 | 0 \ |
| 9071 | -s "found fragmented DTLS handshake message" \ |
| 9072 | -c "found fragmented DTLS handshake message" \ |
| 9073 | -C "error" |
| 9074 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9075 | # interop tests for DTLS fragmentating with reliable connection |
| 9076 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9077 | # here and below we just want to test that the we fragment in a way that |
| 9078 | # pleases other implementations, so we don't need the peer to fragment |
| 9079 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9080 | requires_config_enabled MBEDTLS_RSA_C |
| 9081 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9082 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9083 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9084 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9085 | "$G_SRV -u" \ |
| 9086 | "$P_CLI dtls=1 debug_level=2 \ |
| 9087 | crt_file=data_files/server8_int-ca2.crt \ |
| 9088 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9089 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9090 | 0 \ |
| 9091 | -c "fragmenting handshake message" \ |
| 9092 | -C "error" |
| 9093 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9094 | # We use --insecure for the GnuTLS client because it expects |
| 9095 | # the hostname / IP it connects to to be the name used in the |
| 9096 | # certificate obtained from the server. Here, however, it |
| 9097 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9098 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9099 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9100 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9101 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9102 | requires_config_enabled MBEDTLS_RSA_C |
| 9103 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9104 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9105 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9106 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9107 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9108 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9109 | crt_file=data_files/server7_int-ca.crt \ |
| 9110 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9111 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9112 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9113 | 0 \ |
| 9114 | -s "fragmenting handshake message" |
| 9115 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9116 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9117 | requires_config_enabled MBEDTLS_RSA_C |
| 9118 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9119 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9120 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9121 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9122 | "$P_CLI dtls=1 debug_level=2 \ |
| 9123 | crt_file=data_files/server8_int-ca2.crt \ |
| 9124 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9125 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9126 | 0 \ |
| 9127 | -c "fragmenting handshake message" \ |
| 9128 | -C "error" |
| 9129 | |
| 9130 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9131 | requires_config_enabled MBEDTLS_RSA_C |
| 9132 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9133 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9134 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9135 | "$P_SRV dtls=1 debug_level=2 \ |
| 9136 | crt_file=data_files/server7_int-ca.crt \ |
| 9137 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9138 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9139 | "$O_CLI -dtls1_2" \ |
| 9140 | 0 \ |
| 9141 | -s "fragmenting handshake message" |
| 9142 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9143 | # interop tests for DTLS fragmentating with unreliable connection |
| 9144 | # |
| 9145 | # again we just want to test that the we fragment in a way that |
| 9146 | # pleases other implementations, so we don't need the peer to fragment |
| 9147 | requires_gnutls_next |
| 9148 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9149 | requires_config_enabled MBEDTLS_RSA_C |
| 9150 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9151 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9152 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9153 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9154 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9155 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9156 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9157 | crt_file=data_files/server8_int-ca2.crt \ |
| 9158 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9159 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9160 | 0 \ |
| 9161 | -c "fragmenting handshake message" \ |
| 9162 | -C "error" |
| 9163 | |
| 9164 | requires_gnutls_next |
| 9165 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9166 | requires_config_enabled MBEDTLS_RSA_C |
| 9167 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9168 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9169 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9170 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9171 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9172 | "$P_SRV dtls=1 debug_level=2 \ |
| 9173 | crt_file=data_files/server7_int-ca.crt \ |
| 9174 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9175 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9176 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9177 | 0 \ |
| 9178 | -s "fragmenting handshake message" |
| 9179 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9180 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 9181 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9182 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9183 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9184 | ## (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] | 9185 | skip_next_test |
| 9186 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9187 | requires_config_enabled MBEDTLS_RSA_C |
| 9188 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9189 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9190 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9191 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9192 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9193 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9194 | "$P_CLI dtls=1 debug_level=2 \ |
| 9195 | crt_file=data_files/server8_int-ca2.crt \ |
| 9196 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9197 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9198 | 0 \ |
| 9199 | -c "fragmenting handshake message" \ |
| 9200 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9201 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9202 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9203 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9204 | requires_config_enabled MBEDTLS_RSA_C |
| 9205 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9206 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9207 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9208 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9209 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9210 | "$P_SRV dtls=1 debug_level=2 \ |
| 9211 | crt_file=data_files/server7_int-ca.crt \ |
| 9212 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9213 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9214 | "$O_CLI -dtls1_2" \ |
| 9215 | 0 \ |
| 9216 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9217 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9218 | # Tests for DTLS-SRTP (RFC 5764) |
| 9219 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9221 | run_test "DTLS-SRTP all profiles supported" \ |
| 9222 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9223 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9224 | 0 \ |
| 9225 | -s "found use_srtp extension" \ |
| 9226 | -s "found srtp profile" \ |
| 9227 | -s "selected srtp profile" \ |
| 9228 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9229 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9230 | -c "client hello, adding use_srtp extension" \ |
| 9231 | -c "found use_srtp extension" \ |
| 9232 | -c "found srtp profile" \ |
| 9233 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9234 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9235 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9236 | -C "error" |
| 9237 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9238 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9239 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9241 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9242 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9243 | "$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] | 9244 | 0 \ |
| 9245 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9246 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9247 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9248 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9249 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9250 | -c "client hello, adding use_srtp extension" \ |
| 9251 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9252 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9253 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9254 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9255 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9256 | -C "error" |
| 9257 | |
| 9258 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9260 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9261 | "$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] | 9262 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9263 | 0 \ |
| 9264 | -s "found use_srtp extension" \ |
| 9265 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9266 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9267 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9268 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9269 | -c "client hello, adding use_srtp extension" \ |
| 9270 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9271 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9272 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9273 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9274 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9275 | -C "error" |
| 9276 | |
| 9277 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9279 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9280 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9281 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9282 | 0 \ |
| 9283 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9284 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9285 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9286 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9287 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9288 | -c "client hello, adding use_srtp extension" \ |
| 9289 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9290 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9291 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9292 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9293 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9294 | -C "error" |
| 9295 | |
| 9296 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9298 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9299 | "$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] | 9300 | "$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] | 9301 | 0 \ |
| 9302 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9303 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9304 | -S "selected srtp profile" \ |
| 9305 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9306 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9307 | -c "client hello, adding use_srtp extension" \ |
| 9308 | -C "found use_srtp extension" \ |
| 9309 | -C "found srtp profile" \ |
| 9310 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9311 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9312 | -C "error" |
| 9313 | |
| 9314 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9316 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9317 | "$P_SRV dtls=1 debug_level=3" \ |
| 9318 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9319 | 0 \ |
| 9320 | -s "found use_srtp extension" \ |
| 9321 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9322 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9323 | -c "client hello, adding use_srtp extension" \ |
| 9324 | -C "found use_srtp extension" \ |
| 9325 | -C "found srtp profile" \ |
| 9326 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9327 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9328 | -C "error" |
| 9329 | |
| 9330 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9332 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 9333 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9334 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9335 | 0 \ |
| 9336 | -s "found use_srtp extension" \ |
| 9337 | -s "found srtp profile" \ |
| 9338 | -s "selected srtp profile" \ |
| 9339 | -s "server hello, adding use_srtp extension" \ |
| 9340 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9341 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9342 | -c "client hello, adding use_srtp extension" \ |
| 9343 | -c "found use_srtp extension" \ |
| 9344 | -c "found srtp profile" \ |
| 9345 | -c "selected srtp profile" \ |
| 9346 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9347 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9348 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9349 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9350 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9351 | -C "error" |
| 9352 | |
| 9353 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9355 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9356 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9357 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9358 | 0 \ |
| 9359 | -s "found use_srtp extension" \ |
| 9360 | -s "found srtp profile" \ |
| 9361 | -s "selected srtp profile" \ |
| 9362 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9363 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9364 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9365 | -S "dumping 'using mki' (8 bytes)" \ |
| 9366 | -c "client hello, adding use_srtp extension" \ |
| 9367 | -c "found use_srtp extension" \ |
| 9368 | -c "found srtp profile" \ |
| 9369 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9370 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9371 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9372 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9373 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9374 | -C "dumping 'received mki' (8 bytes)" \ |
| 9375 | -C "error" |
| 9376 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9377 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9378 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9379 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 9380 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9381 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9382 | 0 \ |
| 9383 | -s "found use_srtp extension" \ |
| 9384 | -s "found srtp profile" \ |
| 9385 | -s "selected srtp profile" \ |
| 9386 | -s "server hello, adding use_srtp extension" \ |
| 9387 | -s "DTLS-SRTP key material is"\ |
| 9388 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9389 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 9390 | |
| 9391 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9393 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 9394 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9395 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9396 | 0 \ |
| 9397 | -s "found use_srtp extension" \ |
| 9398 | -s "found srtp profile" \ |
| 9399 | -s "selected srtp profile" \ |
| 9400 | -s "server hello, adding use_srtp extension" \ |
| 9401 | -s "DTLS-SRTP key material is"\ |
| 9402 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9403 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9404 | |
| 9405 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9407 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9408 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9409 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9410 | 0 \ |
| 9411 | -s "found use_srtp extension" \ |
| 9412 | -s "found srtp profile" \ |
| 9413 | -s "selected srtp profile" \ |
| 9414 | -s "server hello, adding use_srtp extension" \ |
| 9415 | -s "DTLS-SRTP key material is"\ |
| 9416 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9417 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9418 | |
| 9419 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9421 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9422 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9423 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9424 | 0 \ |
| 9425 | -s "found use_srtp extension" \ |
| 9426 | -s "found srtp profile" \ |
| 9427 | -s "selected srtp profile" \ |
| 9428 | -s "server hello, adding use_srtp extension" \ |
| 9429 | -s "DTLS-SRTP key material is"\ |
| 9430 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9431 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9432 | |
| 9433 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9435 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9436 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9437 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9438 | 0 \ |
| 9439 | -s "found use_srtp extension" \ |
| 9440 | -s "found srtp profile" \ |
| 9441 | -s "selected srtp profile" \ |
| 9442 | -s "server hello, adding use_srtp extension" \ |
| 9443 | -s "DTLS-SRTP key material is"\ |
| 9444 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9445 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9446 | |
| 9447 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9449 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9450 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9451 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9452 | 0 \ |
| 9453 | -s "found use_srtp extension" \ |
| 9454 | -s "found srtp profile" \ |
| 9455 | -S "selected srtp profile" \ |
| 9456 | -S "server hello, adding use_srtp extension" \ |
| 9457 | -S "DTLS-SRTP key material is"\ |
| 9458 | -C "SRTP Extension negotiated, profile" |
| 9459 | |
| 9460 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9462 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9463 | "$P_SRV dtls=1 debug_level=3" \ |
| 9464 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9465 | 0 \ |
| 9466 | -s "found use_srtp extension" \ |
| 9467 | -S "server hello, adding use_srtp extension" \ |
| 9468 | -S "DTLS-SRTP key material is"\ |
| 9469 | -C "SRTP Extension negotiated, profile" |
| 9470 | |
| 9471 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9473 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 9474 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9475 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9476 | 0 \ |
| 9477 | -c "client hello, adding use_srtp extension" \ |
| 9478 | -c "found use_srtp extension" \ |
| 9479 | -c "found srtp profile" \ |
| 9480 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 9481 | -c "DTLS-SRTP key material is"\ |
| 9482 | -C "error" |
| 9483 | |
| 9484 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9486 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 9487 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9488 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9489 | 0 \ |
| 9490 | -c "client hello, adding use_srtp extension" \ |
| 9491 | -c "found use_srtp extension" \ |
| 9492 | -c "found srtp profile" \ |
| 9493 | -c "selected srtp profile" \ |
| 9494 | -c "DTLS-SRTP key material is"\ |
| 9495 | -C "error" |
| 9496 | |
| 9497 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9499 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 9500 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9501 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9502 | 0 \ |
| 9503 | -c "client hello, adding use_srtp extension" \ |
| 9504 | -c "found use_srtp extension" \ |
| 9505 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9506 | -c "selected srtp profile" \ |
| 9507 | -c "DTLS-SRTP key material is"\ |
| 9508 | -C "error" |
| 9509 | |
| 9510 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9512 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 9513 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9514 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9515 | 0 \ |
| 9516 | -c "client hello, adding use_srtp extension" \ |
| 9517 | -c "found use_srtp extension" \ |
| 9518 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9519 | -c "selected srtp profile" \ |
| 9520 | -c "DTLS-SRTP key material is"\ |
| 9521 | -C "error" |
| 9522 | |
| 9523 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9525 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 9526 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9527 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9528 | 0 \ |
| 9529 | -c "client hello, adding use_srtp extension" \ |
| 9530 | -c "found use_srtp extension" \ |
| 9531 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9532 | -c "selected srtp profile" \ |
| 9533 | -c "DTLS-SRTP key material is"\ |
| 9534 | -C "error" |
| 9535 | |
| 9536 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9538 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 9539 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9540 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 9541 | 0 \ |
| 9542 | -c "client hello, adding use_srtp extension" \ |
| 9543 | -C "found use_srtp extension" \ |
| 9544 | -C "found srtp profile" \ |
| 9545 | -C "selected srtp profile" \ |
| 9546 | -C "DTLS-SRTP key material is"\ |
| 9547 | -C "error" |
| 9548 | |
| 9549 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9550 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9551 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9552 | "$O_SRV -dtls" \ |
| 9553 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9554 | 0 \ |
| 9555 | -c "client hello, adding use_srtp extension" \ |
| 9556 | -C "found use_srtp extension" \ |
| 9557 | -C "found srtp profile" \ |
| 9558 | -C "selected srtp profile" \ |
| 9559 | -C "DTLS-SRTP key material is"\ |
| 9560 | -C "error" |
| 9561 | |
| 9562 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9564 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 9565 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9566 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9567 | 0 \ |
| 9568 | -c "client hello, adding use_srtp extension" \ |
| 9569 | -c "found use_srtp extension" \ |
| 9570 | -c "found srtp profile" \ |
| 9571 | -c "selected srtp profile" \ |
| 9572 | -c "DTLS-SRTP key material is"\ |
| 9573 | -c "DTLS-SRTP no mki value negotiated"\ |
| 9574 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9575 | -C "dumping 'received mki' (8 bytes)" \ |
| 9576 | -C "error" |
| 9577 | |
| 9578 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9579 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9581 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9582 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9583 | "$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] | 9584 | 0 \ |
| 9585 | -s "found use_srtp extension" \ |
| 9586 | -s "found srtp profile" \ |
| 9587 | -s "selected srtp profile" \ |
| 9588 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9589 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9590 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9591 | |
| 9592 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9593 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9595 | 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] | 9596 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9597 | "$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] | 9598 | 0 \ |
| 9599 | -s "found use_srtp extension" \ |
| 9600 | -s "found srtp profile" \ |
| 9601 | -s "selected srtp profile" \ |
| 9602 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9603 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9604 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9605 | |
| 9606 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9607 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9609 | 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] | 9610 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9611 | "$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] | 9612 | 0 \ |
| 9613 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9614 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9615 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9616 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9617 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9618 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9619 | |
| 9620 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9621 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9623 | 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] | 9624 | "$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] | 9625 | "$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] | 9626 | 0 \ |
| 9627 | -s "found use_srtp extension" \ |
| 9628 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9629 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9630 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9631 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9632 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9633 | |
| 9634 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9635 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9637 | 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] | 9638 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9639 | "$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] | 9640 | 0 \ |
| 9641 | -s "found use_srtp extension" \ |
| 9642 | -s "found srtp profile" \ |
| 9643 | -s "selected srtp profile" \ |
| 9644 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9645 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9646 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9647 | |
| 9648 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9649 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9651 | 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] | 9652 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9653 | "$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] | 9654 | 0 \ |
| 9655 | -s "found use_srtp extension" \ |
| 9656 | -s "found srtp profile" \ |
| 9657 | -S "selected srtp profile" \ |
| 9658 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9659 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9660 | -C "SRTP profile:" |
| 9661 | |
| 9662 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9663 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9665 | 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] | 9666 | "$P_SRV dtls=1 debug_level=3" \ |
| 9667 | "$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] | 9668 | 0 \ |
| 9669 | -s "found use_srtp extension" \ |
| 9670 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9671 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9672 | -C "SRTP profile:" |
| 9673 | |
| 9674 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9675 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9677 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9678 | "$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" \ |
| 9679 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9680 | 0 \ |
| 9681 | -c "client hello, adding use_srtp extension" \ |
| 9682 | -c "found use_srtp extension" \ |
| 9683 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9684 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9685 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9686 | -C "error" |
| 9687 | |
| 9688 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9689 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9691 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9692 | "$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" \ |
| 9693 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9694 | 0 \ |
| 9695 | -c "client hello, adding use_srtp extension" \ |
| 9696 | -c "found use_srtp extension" \ |
| 9697 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9698 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9699 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9700 | -C "error" |
| 9701 | |
| 9702 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9703 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9705 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9706 | "$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" \ |
| 9707 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9708 | 0 \ |
| 9709 | -c "client hello, adding use_srtp extension" \ |
| 9710 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9711 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9712 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9713 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9714 | -C "error" |
| 9715 | |
| 9716 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9717 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9719 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9720 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9721 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9722 | 0 \ |
| 9723 | -c "client hello, adding use_srtp extension" \ |
| 9724 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9725 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9726 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9727 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9728 | -C "error" |
| 9729 | |
| 9730 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9731 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9733 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9734 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9735 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9736 | 0 \ |
| 9737 | -c "client hello, adding use_srtp extension" \ |
| 9738 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9739 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9740 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9741 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9742 | -C "error" |
| 9743 | |
| 9744 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9745 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9747 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9748 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9749 | "$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] | 9750 | 0 \ |
| 9751 | -c "client hello, adding use_srtp extension" \ |
| 9752 | -C "found use_srtp extension" \ |
| 9753 | -C "found srtp profile" \ |
| 9754 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9755 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9756 | -C "error" |
| 9757 | |
| 9758 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9759 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9761 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9762 | "$G_SRV -u" \ |
| 9763 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9764 | 0 \ |
| 9765 | -c "client hello, adding use_srtp extension" \ |
| 9766 | -C "found use_srtp extension" \ |
| 9767 | -C "found srtp profile" \ |
| 9768 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9769 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9770 | -C "error" |
| 9771 | |
| 9772 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9773 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9775 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9776 | "$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" \ |
| 9777 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9778 | 0 \ |
| 9779 | -c "client hello, adding use_srtp extension" \ |
| 9780 | -c "found use_srtp extension" \ |
| 9781 | -c "found srtp profile" \ |
| 9782 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9783 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9784 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9785 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9786 | -c "dumping 'received mki' (8 bytes)" \ |
| 9787 | -C "error" |
| 9788 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9789 | # Tests for specific things with "unreliable" UDP connection |
| 9790 | |
| 9791 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9793 | run_test "DTLS proxy: reference" \ |
| 9794 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9795 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9796 | "$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] | 9797 | 0 \ |
| 9798 | -C "replayed record" \ |
| 9799 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9800 | -C "Buffer record from epoch" \ |
| 9801 | -S "Buffer record from epoch" \ |
| 9802 | -C "ssl_buffer_message" \ |
| 9803 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9804 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9805 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9806 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9807 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9808 | -c "HTTP/1.0 200 OK" |
| 9809 | |
| 9810 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9811 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9812 | run_test "DTLS proxy: duplicate every packet" \ |
| 9813 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9814 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9815 | "$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] | 9816 | 0 \ |
| 9817 | -c "replayed record" \ |
| 9818 | -s "replayed record" \ |
| 9819 | -c "record from another epoch" \ |
| 9820 | -s "record from another epoch" \ |
| 9821 | -S "resend" \ |
| 9822 | -s "Extra-header:" \ |
| 9823 | -c "HTTP/1.0 200 OK" |
| 9824 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9825 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9826 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9827 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9828 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9829 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9830 | 0 \ |
| 9831 | -c "replayed record" \ |
| 9832 | -S "replayed record" \ |
| 9833 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9834 | -s "record from another epoch" \ |
| 9835 | -c "resend" \ |
| 9836 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9837 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9838 | -c "HTTP/1.0 200 OK" |
| 9839 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9841 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9842 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9843 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9844 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9845 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9846 | -c "next record in same datagram" \ |
| 9847 | -s "next record in same datagram" |
| 9848 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9850 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9851 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9852 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9853 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9854 | 0 \ |
| 9855 | -c "next record in same datagram" \ |
| 9856 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9857 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9859 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9860 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9861 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9862 | "$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] | 9863 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9864 | -c "discarding invalid record (mac)" \ |
| 9865 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9866 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9867 | -c "HTTP/1.0 200 OK" \ |
| 9868 | -S "too many records with bad MAC" \ |
| 9869 | -S "Verification of the message MAC failed" |
| 9870 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9872 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9873 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9874 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9875 | "$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] | 9876 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9877 | -C "discarding invalid record (mac)" \ |
| 9878 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9879 | -S "Extra-header:" \ |
| 9880 | -C "HTTP/1.0 200 OK" \ |
| 9881 | -s "too many records with bad MAC" \ |
| 9882 | -s "Verification of the message MAC failed" |
| 9883 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9885 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9886 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9887 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9888 | "$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] | 9889 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9890 | -c "discarding invalid record (mac)" \ |
| 9891 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9892 | -s "Extra-header:" \ |
| 9893 | -c "HTTP/1.0 200 OK" \ |
| 9894 | -S "too many records with bad MAC" \ |
| 9895 | -S "Verification of the message MAC failed" |
| 9896 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9898 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9899 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9900 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9901 | "$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] | 9902 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9903 | -c "discarding invalid record (mac)" \ |
| 9904 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9905 | -s "Extra-header:" \ |
| 9906 | -c "HTTP/1.0 200 OK" \ |
| 9907 | -s "too many records with bad MAC" \ |
| 9908 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9909 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9911 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9912 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9913 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9914 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9915 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9916 | -c "record from another epoch" \ |
| 9917 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9918 | -s "Extra-header:" \ |
| 9919 | -c "HTTP/1.0 200 OK" |
| 9920 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9921 | # Tests for reordering support with DTLS |
| 9922 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9923 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9925 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9926 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9927 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9928 | hs_timeout=2500-60000" \ |
| 9929 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9930 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9931 | 0 \ |
| 9932 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9933 | -c "Next handshake message has been buffered - load"\ |
| 9934 | -S "Buffering HS message" \ |
| 9935 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9936 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9937 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9938 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9939 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9940 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9941 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9943 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9944 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9945 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9946 | hs_timeout=2500-60000" \ |
| 9947 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9948 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9949 | 0 \ |
| 9950 | -c "Buffering HS message" \ |
| 9951 | -c "found fragmented DTLS handshake message"\ |
| 9952 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9953 | -c "Next handshake message has been buffered - load"\ |
| 9954 | -S "Buffering HS message" \ |
| 9955 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9956 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9957 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9958 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9959 | -S "Remember CCS message" |
| 9960 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9961 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9962 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9963 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9964 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9965 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9966 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9968 | 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] | 9969 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9970 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9971 | hs_timeout=2500-60000" \ |
| 9972 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9973 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9974 | 0 \ |
| 9975 | -c "Buffering HS message" \ |
| 9976 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9977 | -C "attempt to make space by freeing buffered messages" \ |
| 9978 | -S "Buffering HS message" \ |
| 9979 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9980 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9981 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9982 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9983 | -S "Remember CCS message" |
| 9984 | |
| 9985 | # The size constraints ensure that the delayed certificate message can't |
| 9986 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9987 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9988 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9989 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9990 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9992 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9993 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9994 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9995 | hs_timeout=2500-60000" \ |
| 9996 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9997 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9998 | 0 \ |
| 9999 | -c "Buffering HS message" \ |
| 10000 | -c "attempt to make space by freeing buffered future messages" \ |
| 10001 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10002 | -S "Buffering HS message" \ |
| 10003 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10004 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10005 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10006 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10007 | -S "Remember CCS message" |
| 10008 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10009 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10011 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10012 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10013 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10014 | hs_timeout=2500-60000" \ |
| 10015 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10016 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10017 | 0 \ |
| 10018 | -C "Buffering HS message" \ |
| 10019 | -C "Next handshake message has been buffered - load"\ |
| 10020 | -s "Buffering HS message" \ |
| 10021 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10022 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10023 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10024 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10025 | -S "Remember CCS message" |
| 10026 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10027 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10029 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10030 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10031 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10032 | hs_timeout=2500-60000" \ |
| 10033 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10034 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10035 | 0 \ |
| 10036 | -C "Buffering HS message" \ |
| 10037 | -C "Next handshake message has been buffered - load"\ |
| 10038 | -S "Buffering HS message" \ |
| 10039 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10040 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10041 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10042 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10043 | -S "Remember CCS message" |
| 10044 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10045 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10047 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10048 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10049 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10050 | hs_timeout=2500-60000" \ |
| 10051 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10052 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10053 | 0 \ |
| 10054 | -C "Buffering HS message" \ |
| 10055 | -C "Next handshake message has been buffered - load"\ |
| 10056 | -S "Buffering HS message" \ |
| 10057 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10058 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10059 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10060 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10061 | -s "Remember CCS message" |
| 10062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10064 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10065 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10066 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10067 | hs_timeout=2500-60000" \ |
| 10068 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10069 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10070 | 0 \ |
| 10071 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10072 | -s "Found buffered record from current epoch - load" \ |
| 10073 | -c "Buffer record from epoch 1" \ |
| 10074 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10075 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10076 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10077 | # from the server are delayed, so that the encrypted Finished message |
| 10078 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10079 | # in afterwards, the encrypted Finished message must be freed in order |
| 10080 | # to make space for the NewSessionTicket to be reassembled. |
| 10081 | # This works only in very particular circumstances: |
| 10082 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10083 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10084 | # the encrypted Finished message. |
| 10085 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10086 | # needs to be fragmented. |
| 10087 | # - All messages sent by the server must be small enough to be either sent |
| 10088 | # without fragmentation or be reassembled within the bounds of |
| 10089 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10090 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10091 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10092 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10094 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10095 | -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] | 10096 | "$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] | 10097 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10098 | 0 \ |
| 10099 | -s "Buffer record from epoch 1" \ |
| 10100 | -s "Found buffered record from current epoch - load" \ |
| 10101 | -c "Buffer record from epoch 1" \ |
| 10102 | -C "Found buffered record from current epoch - load" \ |
| 10103 | -c "Enough space available after freeing future epoch record" |
| 10104 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10105 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10106 | |
| 10107 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10109 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10110 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10111 | "$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] | 10112 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10113 | "$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] | 10114 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10115 | 0 \ |
| 10116 | -s "Extra-header:" \ |
| 10117 | -c "HTTP/1.0 200 OK" |
| 10118 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10119 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10121 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10122 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10123 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10124 | "$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] | 10125 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10126 | 0 \ |
| 10127 | -s "Extra-header:" \ |
| 10128 | -c "HTTP/1.0 200 OK" |
| 10129 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10130 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10132 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10133 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10134 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10135 | "$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] | 10136 | 0 \ |
| 10137 | -s "Extra-header:" \ |
| 10138 | -c "HTTP/1.0 200 OK" |
| 10139 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10140 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10142 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10143 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10144 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10145 | "$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] | 10146 | 0 \ |
| 10147 | -s "Extra-header:" \ |
| 10148 | -c "HTTP/1.0 200 OK" |
| 10149 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10150 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10152 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10153 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10154 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10155 | "$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] | 10156 | 0 \ |
| 10157 | -s "Extra-header:" \ |
| 10158 | -c "HTTP/1.0 200 OK" |
| 10159 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10160 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10162 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 10163 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10164 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 10165 | "$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] | 10166 | 0 \ |
| 10167 | -s "Extra-header:" \ |
| 10168 | -c "HTTP/1.0 200 OK" |
| 10169 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10170 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10172 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10173 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10174 | "$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] | 10175 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10176 | "$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] | 10177 | 0 \ |
| 10178 | -s "Extra-header:" \ |
| 10179 | -c "HTTP/1.0 200 OK" |
| 10180 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10181 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10183 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10184 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10185 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10186 | "$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] | 10187 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10188 | "$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] | 10189 | 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] | 10190 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10191 | 0 \ |
| 10192 | -s "a session has been resumed" \ |
| 10193 | -c "a session has been resumed" \ |
| 10194 | -s "Extra-header:" \ |
| 10195 | -c "HTTP/1.0 200 OK" |
| 10196 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10197 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10199 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10200 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10201 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10202 | "$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] | 10203 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10204 | "$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] | 10205 | 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] | 10206 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10207 | 0 \ |
| 10208 | -s "a session has been resumed" \ |
| 10209 | -c "a session has been resumed" \ |
| 10210 | -s "Extra-header:" \ |
| 10211 | -c "HTTP/1.0 200 OK" |
| 10212 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10213 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10214 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10216 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10217 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10218 | "$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] | 10219 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10220 | "$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] | 10221 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10222 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10223 | 0 \ |
| 10224 | -c "=> renegotiate" \ |
| 10225 | -s "=> renegotiate" \ |
| 10226 | -s "Extra-header:" \ |
| 10227 | -c "HTTP/1.0 200 OK" |
| 10228 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10229 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10230 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10232 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10233 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10234 | "$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] | 10235 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10236 | "$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] | 10237 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10238 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10239 | 0 \ |
| 10240 | -c "=> renegotiate" \ |
| 10241 | -s "=> renegotiate" \ |
| 10242 | -s "Extra-header:" \ |
| 10243 | -c "HTTP/1.0 200 OK" |
| 10244 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10245 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10246 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10248 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10249 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10250 | "$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] | 10251 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10252 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10253 | "$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] | 10254 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10255 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10256 | 0 \ |
| 10257 | -c "=> renegotiate" \ |
| 10258 | -s "=> renegotiate" \ |
| 10259 | -s "Extra-header:" \ |
| 10260 | -c "HTTP/1.0 200 OK" |
| 10261 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10262 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10265 | 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] | 10266 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10267 | "$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] | 10268 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10269 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10270 | "$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] | 10271 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10272 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10273 | 0 \ |
| 10274 | -c "=> renegotiate" \ |
| 10275 | -s "=> renegotiate" \ |
| 10276 | -s "Extra-header:" \ |
| 10277 | -c "HTTP/1.0 200 OK" |
| 10278 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10279 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 10280 | ## all versions installed on the CI machines), reported here: |
| 10281 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 10282 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 10283 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 10284 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10285 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10286 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10288 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10289 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10290 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10291 | "$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] | 10292 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10293 | -c "HTTP/1.0 200 OK" |
| 10294 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10295 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10296 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10297 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10299 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10300 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10301 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10302 | "$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] | 10303 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10304 | -c "HTTP/1.0 200 OK" |
| 10305 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10306 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10307 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10308 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10310 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10311 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10312 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10313 | "$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] | 10314 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10315 | -c "HTTP/1.0 200 OK" |
| 10316 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10317 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10318 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10319 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10321 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10322 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10323 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10324 | "$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] | 10325 | 0 \ |
| 10326 | -s "Extra-header:" \ |
| 10327 | -c "Extra-header:" |
| 10328 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10329 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10330 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10331 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10333 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10334 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10335 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10336 | "$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] | 10337 | 0 \ |
| 10338 | -s "Extra-header:" \ |
| 10339 | -c "Extra-header:" |
| 10340 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10341 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10342 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10343 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10345 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10346 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10347 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10348 | "$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] | 10349 | 0 \ |
| 10350 | -s "Extra-header:" \ |
| 10351 | -c "Extra-header:" |
| 10352 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10354 | run_test "export keys functionality" \ |
| 10355 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10356 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10357 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10358 | -c "EAP-TLS key material is:"\ |
| 10359 | -s "EAP-TLS key material is:"\ |
| 10360 | -c "EAP-TLS IV is:" \ |
| 10361 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10362 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 10363 | # openssl feature tests: check if tls1.3 exists. |
| 10364 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10365 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 10366 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 10367 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 10368 | 0 \ |
| 10369 | -c "TLS 1.3" \ |
| 10370 | -s "TLS 1.3" |
| 10371 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 10372 | # 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] | 10373 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 10374 | requires_gnutls_next_no_ticket |
| 10375 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10376 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 10377 | "$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] | 10378 | "$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] | 10379 | 0 \ |
| 10380 | -s "Version: TLS1.3" \ |
| 10381 | -c "Version: TLS1.3" |
| 10382 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 10383 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 10384 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10386 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10387 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10388 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10389 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10390 | "$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] | 10391 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 10392 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10393 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10394 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10395 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10396 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10397 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10398 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10399 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10400 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10401 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10402 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 10403 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 10404 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10405 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 10406 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10407 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 10408 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10409 | -c "=> parse certificate verify" \ |
| 10410 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 10411 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 10412 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 10413 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 10414 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 10415 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 10416 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 10417 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10419 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10420 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10421 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10422 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10423 | "$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] | 10424 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 10425 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10426 | -s "SERVER HELLO was queued" \ |
| 10427 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10428 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10429 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10430 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10431 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10432 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10433 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10434 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10435 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10436 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 10437 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 10438 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10439 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 10440 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10441 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 10442 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10443 | -c "=> parse certificate verify" \ |
| 10444 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 10445 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 10446 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 10447 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 10448 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 10449 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10450 | requires_openssl_tls1_3 |
| 10451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10452 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10453 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10454 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10455 | requires_config_enabled MBEDTLS_SSL_ALPN |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10456 | run_test "TLS 1.3: alpn - openssl" \ |
| 10457 | "$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] | 10458 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10459 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10460 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10461 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10462 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10463 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10464 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10465 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10466 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10467 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10468 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10469 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10470 | -c "<= ssl_tls13_process_server_hello" \ |
| 10471 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10472 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10473 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10474 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10475 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10476 | -c "=> parse certificate verify" \ |
| 10477 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10478 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 10479 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10480 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10481 | -c "HTTP/1.0 200 ok" \ |
| 10482 | -c "Application Layer Protocol is h2" |
| 10483 | |
| 10484 | requires_gnutls_tls1_3 |
| 10485 | requires_gnutls_next_no_ticket |
| 10486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10487 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10488 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10489 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10490 | requires_config_enabled MBEDTLS_SSL_ALPN |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10491 | run_test "TLS 1.3: alpn - gnutls" \ |
| 10492 | "$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] | 10493 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10494 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10495 | -s "SERVER HELLO was queued" \ |
| 10496 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10497 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10498 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10499 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10500 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10501 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10502 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10503 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10504 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10505 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10506 | -c "<= ssl_tls13_process_server_hello" \ |
| 10507 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10508 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10509 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10510 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10511 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10512 | -c "=> parse certificate verify" \ |
| 10513 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10514 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 10515 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10516 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10517 | -c "HTTP/1.0 200 OK" \ |
| 10518 | -c "Application Layer Protocol is h2" |
| 10519 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10521 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10522 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10523 | skip_handshake_stage_check |
| 10524 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10525 | 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] | 10526 | "$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] | 10527 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10528 | 1 \ |
| 10529 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10530 | -S "Version: TLS1.0" \ |
| 10531 | -C "Protocol is TLSv1.0" |
| 10532 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10534 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10535 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10536 | skip_handshake_stage_check |
| 10537 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10538 | 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] | 10539 | "$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] | 10540 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10541 | 1 \ |
| 10542 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10543 | -S "Version: TLS1.1" \ |
| 10544 | -C "Protocol is TLSv1.1" |
| 10545 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10547 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10548 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10549 | skip_handshake_stage_check |
| 10550 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10551 | 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] | 10552 | "$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] | 10553 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10554 | 1 \ |
| 10555 | -s "Client's version: 3.3" \ |
| 10556 | -c "is a fatal alert message (msg 40)" \ |
| 10557 | -S "Version: TLS1.2" \ |
| 10558 | -C "Protocol is TLSv1.2" |
| 10559 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10561 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10562 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10563 | skip_handshake_stage_check |
| 10564 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10565 | 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] | 10566 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10567 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10568 | 1 \ |
| 10569 | -s "fatal protocol_version" \ |
| 10570 | -c "is a fatal alert message (msg 70)" \ |
| 10571 | -S "Version: TLS1.0" \ |
| 10572 | -C "Protocol : TLSv1.0" |
| 10573 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10575 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10576 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10577 | skip_handshake_stage_check |
| 10578 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10579 | 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] | 10580 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10581 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10582 | 1 \ |
| 10583 | -s "fatal protocol_version" \ |
| 10584 | -c "is a fatal alert message (msg 70)" \ |
| 10585 | -S "Version: TLS1.1" \ |
| 10586 | -C "Protocol : TLSv1.1" |
| 10587 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10589 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10590 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10591 | skip_handshake_stage_check |
| 10592 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10593 | 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] | 10594 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10595 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10596 | 1 \ |
| 10597 | -s "fatal protocol_version" \ |
| 10598 | -c "is a fatal alert message (msg 70)" \ |
| 10599 | -S "Version: TLS1.2" \ |
| 10600 | -C "Protocol : TLSv1.2" |
| 10601 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10602 | requires_openssl_tls1_3 |
| 10603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10604 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10605 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10606 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10607 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10608 | "$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] | 10609 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10610 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10611 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10612 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10613 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10614 | -c "HTTP/1.0 200 ok" \ |
| 10615 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10616 | |
| 10617 | requires_gnutls_tls1_3 |
| 10618 | requires_gnutls_next_no_ticket |
| 10619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10620 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10621 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10622 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10623 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10624 | "$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] | 10625 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10626 | 0 \ |
| 10627 | -c "got a certificate request" \ |
| 10628 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 10629 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10630 | -c "HTTP/1.0 200 OK" \ |
| 10631 | -c "Protocol is TLSv1.3" |
| 10632 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10633 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10634 | requires_openssl_tls1_3 |
| 10635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10636 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10637 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10638 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10639 | "$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] | 10640 | "$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] | 10641 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10642 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10643 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10644 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10645 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10646 | |
| 10647 | requires_gnutls_tls1_3 |
| 10648 | requires_gnutls_next_no_ticket |
| 10649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10650 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10651 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10652 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10653 | "$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] | 10654 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 10655 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 10656 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10657 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10658 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10659 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10660 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10661 | |
| 10662 | requires_openssl_tls1_3 |
| 10663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10664 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10665 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10666 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10667 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10668 | "$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] | 10669 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10670 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 10671 | 0 \ |
| 10672 | -c "got a certificate request" \ |
| 10673 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10674 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10675 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10676 | |
| 10677 | requires_gnutls_tls1_3 |
| 10678 | requires_gnutls_next_no_ticket |
| 10679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10680 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10681 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10682 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10683 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10684 | "$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] | 10685 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10686 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 10687 | 0 \ |
| 10688 | -c "got a certificate request" \ |
| 10689 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10690 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10691 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10692 | |
| 10693 | requires_openssl_tls1_3 |
| 10694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10695 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10696 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10697 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10698 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10699 | "$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] | 10700 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10701 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 10702 | 0 \ |
| 10703 | -c "got a certificate request" \ |
| 10704 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10705 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10706 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10707 | |
| 10708 | requires_gnutls_tls1_3 |
| 10709 | requires_gnutls_next_no_ticket |
| 10710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10711 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10712 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10713 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10714 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10715 | "$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] | 10716 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10717 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 10718 | 0 \ |
| 10719 | -c "got a certificate request" \ |
| 10720 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10721 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10722 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10723 | |
| 10724 | requires_openssl_tls1_3 |
| 10725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10726 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10727 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10728 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10729 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10730 | "$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] | 10731 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10732 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 10733 | 0 \ |
| 10734 | -c "got a certificate request" \ |
| 10735 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10736 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10737 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10738 | |
| 10739 | requires_gnutls_tls1_3 |
| 10740 | requires_gnutls_next_no_ticket |
| 10741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10742 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10743 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10744 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10745 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10746 | "$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] | 10747 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10748 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 10749 | 0 \ |
| 10750 | -c "got a certificate request" \ |
| 10751 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10752 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10753 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10754 | |
| 10755 | requires_openssl_tls1_3 |
| 10756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10757 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10758 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10759 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10760 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10761 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10762 | "$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] | 10763 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10764 | 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] | 10765 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10766 | -c "got a certificate request" \ |
| 10767 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10768 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10769 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10770 | |
| 10771 | requires_gnutls_tls1_3 |
| 10772 | requires_gnutls_next_no_ticket |
| 10773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10774 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10775 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10776 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10777 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10778 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10779 | "$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] | 10780 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10781 | 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] | 10782 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10783 | -c "got a certificate request" \ |
| 10784 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10785 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10786 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10787 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10788 | requires_openssl_tls1_3 |
| 10789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10790 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10791 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10792 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10793 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 10794 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 10795 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10796 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 10797 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 10798 | 0 \ |
| 10799 | -c "got a certificate request" \ |
| 10800 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10801 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10802 | -c "Protocol is TLSv1.3" |
| 10803 | |
| 10804 | requires_gnutls_tls1_3 |
| 10805 | requires_gnutls_next_no_ticket |
| 10806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10807 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10808 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10809 | requires_config_enabled MBEDTLS_RSA_C |
| 10810 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10811 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 10812 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10813 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 10814 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 10815 | 0 \ |
| 10816 | -c "got a certificate request" \ |
| 10817 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10818 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10819 | -c "Protocol is TLSv1.3" |
| 10820 | |
| 10821 | requires_openssl_tls1_3 |
| 10822 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10823 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10824 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10825 | requires_config_enabled MBEDTLS_RSA_C |
| 10826 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10827 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 10828 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10829 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 10830 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 10831 | 0 \ |
| 10832 | -c "got a certificate request" \ |
| 10833 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10834 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10835 | -c "Protocol is TLSv1.3" |
| 10836 | |
| 10837 | requires_gnutls_tls1_3 |
| 10838 | requires_gnutls_next_no_ticket |
| 10839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10840 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10841 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10842 | requires_config_enabled MBEDTLS_RSA_C |
| 10843 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10844 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 10845 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10846 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 10847 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 10848 | 0 \ |
| 10849 | -c "got a certificate request" \ |
| 10850 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10851 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10852 | -c "Protocol is TLSv1.3" |
| 10853 | |
| 10854 | requires_openssl_tls1_3 |
| 10855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10856 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10857 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10858 | requires_config_enabled MBEDTLS_RSA_C |
| 10859 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 10860 | 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] | 10861 | "$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] | 10862 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10863 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10864 | 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] | 10865 | 1 \ |
| 10866 | -c "got a certificate request" \ |
| 10867 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10868 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10869 | -c "signature algorithm not in received or offered list." \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 10870 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10871 | |
| 10872 | requires_gnutls_tls1_3 |
| 10873 | requires_gnutls_next_no_ticket |
| 10874 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10875 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10876 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10877 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10878 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10879 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 10880 | "$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] | 10881 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10882 | 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] | 10883 | 1 \ |
| 10884 | -c "got a certificate request" \ |
| 10885 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10886 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10887 | -c "signature algorithm not in received or offered list." \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 10888 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10889 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 10890 | # Test using an opaque private key for client authentication |
| 10891 | requires_openssl_tls1_3 |
| 10892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10893 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10894 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10895 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10896 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 10897 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 10898 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 10899 | 0 \ |
| 10900 | -c "got a certificate request" \ |
| 10901 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10902 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10903 | -c "Protocol is TLSv1.3" |
| 10904 | |
| 10905 | requires_gnutls_tls1_3 |
| 10906 | requires_gnutls_next_no_ticket |
| 10907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10908 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10909 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10910 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10911 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 10912 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 10913 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 10914 | key_file=data_files/cli2.key key_opaque=1" \ |
| 10915 | 0 \ |
| 10916 | -c "got a certificate request" \ |
| 10917 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10918 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10919 | -c "Protocol is TLSv1.3" |
| 10920 | |
| 10921 | requires_openssl_tls1_3 |
| 10922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10923 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10924 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10925 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10926 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10927 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 10928 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10929 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 10930 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 10931 | 0 \ |
| 10932 | -c "got a certificate request" \ |
| 10933 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10934 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10935 | -c "Protocol is TLSv1.3" |
| 10936 | |
| 10937 | requires_gnutls_tls1_3 |
| 10938 | requires_gnutls_next_no_ticket |
| 10939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10940 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10941 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10942 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10943 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10944 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 10945 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10946 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 10947 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 10948 | 0 \ |
| 10949 | -c "got a certificate request" \ |
| 10950 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10951 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10952 | -c "Protocol is TLSv1.3" |
| 10953 | |
| 10954 | requires_openssl_tls1_3 |
| 10955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10956 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10957 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10958 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10959 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10960 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 10961 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10962 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 10963 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 10964 | 0 \ |
| 10965 | -c "got a certificate request" \ |
| 10966 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10967 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10968 | -c "Protocol is TLSv1.3" |
| 10969 | |
| 10970 | requires_gnutls_tls1_3 |
| 10971 | requires_gnutls_next_no_ticket |
| 10972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10973 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10974 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10975 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10976 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10977 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 10978 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10979 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 10980 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 10981 | 0 \ |
| 10982 | -c "got a certificate request" \ |
| 10983 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10984 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10985 | -c "Protocol is TLSv1.3" |
| 10986 | |
| 10987 | requires_openssl_tls1_3 |
| 10988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10989 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10990 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10991 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10992 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10993 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 10994 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10995 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 10996 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 10997 | 0 \ |
| 10998 | -c "got a certificate request" \ |
| 10999 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11000 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11001 | -c "Protocol is TLSv1.3" |
| 11002 | |
| 11003 | requires_gnutls_tls1_3 |
| 11004 | requires_gnutls_next_no_ticket |
| 11005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11006 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11007 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11008 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11009 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11010 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11011 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11012 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11013 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11014 | 0 \ |
| 11015 | -c "got a certificate request" \ |
| 11016 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11017 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11018 | -c "Protocol is TLSv1.3" |
| 11019 | |
| 11020 | requires_openssl_tls1_3 |
| 11021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11022 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11023 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11024 | requires_config_enabled MBEDTLS_RSA_C |
| 11025 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11026 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11027 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11028 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11029 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11030 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11031 | 0 \ |
| 11032 | -c "got a certificate request" \ |
| 11033 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11034 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11035 | -c "Protocol is TLSv1.3" |
| 11036 | |
| 11037 | requires_gnutls_tls1_3 |
| 11038 | requires_gnutls_next_no_ticket |
| 11039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11040 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11041 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11042 | requires_config_enabled MBEDTLS_RSA_C |
| 11043 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11044 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11045 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11046 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11047 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11048 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11049 | 0 \ |
| 11050 | -c "got a certificate request" \ |
| 11051 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11052 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11053 | -c "Protocol is TLSv1.3" |
| 11054 | |
| 11055 | requires_openssl_tls1_3 |
| 11056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11057 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11058 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11059 | requires_config_enabled MBEDTLS_RSA_C |
| 11060 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11061 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11062 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11063 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11064 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11065 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11066 | 0 \ |
| 11067 | -c "got a certificate request" \ |
| 11068 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11069 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11070 | -c "Protocol is TLSv1.3" |
| 11071 | |
| 11072 | requires_gnutls_tls1_3 |
| 11073 | requires_gnutls_next_no_ticket |
| 11074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11075 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11076 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11077 | requires_config_enabled MBEDTLS_RSA_C |
| 11078 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11079 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11080 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 11081 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11082 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11083 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11084 | 0 \ |
| 11085 | -c "got a certificate request" \ |
| 11086 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11087 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11088 | -c "Protocol is TLSv1.3" |
| 11089 | |
| 11090 | requires_openssl_tls1_3 |
| 11091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11092 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11093 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11094 | requires_config_enabled MBEDTLS_RSA_C |
| 11095 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11096 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11097 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 11098 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11099 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11100 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11101 | 0 \ |
| 11102 | -c "got a certificate request" \ |
| 11103 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11104 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11105 | -c "Protocol is TLSv1.3" |
| 11106 | |
| 11107 | requires_gnutls_tls1_3 |
| 11108 | requires_gnutls_next_no_ticket |
| 11109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11110 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11111 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11112 | requires_config_enabled MBEDTLS_RSA_C |
| 11113 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11114 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11115 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 11116 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11117 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11118 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11119 | 0 \ |
| 11120 | -c "got a certificate request" \ |
| 11121 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11122 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11123 | -c "Protocol is TLSv1.3" |
| 11124 | |
| 11125 | requires_openssl_tls1_3 |
| 11126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11127 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11128 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11129 | requires_config_enabled MBEDTLS_RSA_C |
| 11130 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11131 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11132 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 11133 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 11134 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 11135 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11136 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11137 | 1 \ |
| 11138 | -c "got a certificate request" \ |
| 11139 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11140 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11141 | -c "signature algorithm not in received or offered list." \ |
| 11142 | -C "unkown pk type" |
| 11143 | |
| 11144 | requires_gnutls_tls1_3 |
| 11145 | requires_gnutls_next_no_ticket |
| 11146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11147 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11148 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11149 | requires_config_enabled MBEDTLS_RSA_C |
| 11150 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11151 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11152 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 11153 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 11154 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11155 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11156 | 1 \ |
| 11157 | -c "got a certificate request" \ |
| 11158 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11159 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11160 | -c "signature algorithm not in received or offered list." \ |
| 11161 | -C "unkown pk type" |
| 11162 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11164 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11165 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11166 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11167 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11168 | 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] | 11169 | "$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] | 11170 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11171 | 0 \ |
| 11172 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11173 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11174 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11175 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11176 | -c "HTTP/1.0 200 ok" |
| 11177 | |
| 11178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11179 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11180 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11181 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11182 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11183 | 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] | 11184 | "$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] | 11185 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11186 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11187 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11188 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11189 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11190 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11191 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11192 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 11193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11194 | requires_gnutls_tls1_3 |
| 11195 | requires_gnutls_next_no_ticket |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11196 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11197 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11198 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11199 | 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] | 11200 | "$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] | 11201 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11202 | 0 \ |
| 11203 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11204 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11205 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11206 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11207 | -c "HTTP/1.0 200 OK" |
| 11208 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 11209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11210 | requires_gnutls_tls1_3 |
| 11211 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11212 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11213 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11214 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11215 | 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] | 11216 | "$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] | 11217 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11218 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11219 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11220 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11221 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11222 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11223 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11224 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 11225 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11227 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 11228 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 11229 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 11230 | "$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] | 11231 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 11232 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 11233 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11234 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11235 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11236 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 11237 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11238 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11239 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 11240 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11241 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11243 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11244 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11245 | requires_openssl_tls1_3 |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11246 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11247 | "$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] | 11248 | "$O_NEXT_CLI -msg -debug -cert data_files/server5.crt -key data_files/server5.key -tls1_3 -no_middlebox" \ |
XiaokangQian | 9a4e1dd | 2022-05-26 00:58:11 +0000 | [diff] [blame] | 11249 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11250 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11251 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11252 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11253 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11254 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 11255 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11256 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11257 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11258 | -s "=> parse client hello" \ |
| 11259 | -s "<= parse client hello" |
| 11260 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11261 | requires_gnutls_tls1_3 |
| 11262 | requires_gnutls_next_no_ticket |
| 11263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11264 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 11265 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 11266 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 11267 | "$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] | 11268 | "$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] | 11269 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 11270 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11271 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11272 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11273 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 11274 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11275 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11276 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11277 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 11278 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11279 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11280 | requires_gnutls_tls1_3 |
| 11281 | requires_gnutls_next_no_ticket |
| 11282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11283 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11284 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11285 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11286 | "$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" \ |
| 11287 | "$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" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 11288 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11289 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11290 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11291 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11292 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11293 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 11294 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11295 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11296 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11297 | -s "=> parse client hello" \ |
| 11298 | -s "<= parse client hello" |
| 11299 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11301 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11302 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 11303 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11304 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 11305 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 11306 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 11307 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11308 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11309 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11310 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11311 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11312 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11313 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11314 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11315 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11316 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 11317 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11318 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11320 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11321 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11322 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11323 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11324 | "$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" \ |
| 11325 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 11326 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11327 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11328 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11329 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11330 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11331 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11332 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11333 | -s "=> parse client hello" \ |
| 11334 | -s "<= parse client hello" |
| 11335 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 11336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11337 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11338 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11339 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11340 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 11341 | "$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" \ |
| 11342 | "$P_CLI debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 11343 | 1 \ |
| 11344 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11345 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11346 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11347 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11348 | -s "=> write certificate request" \ |
| 11349 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 11350 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11351 | -s "=> parse client hello" \ |
| 11352 | -s "<= parse client hello" |
| 11353 | |
| 11354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11355 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11356 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11357 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11358 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 11359 | "$P_SRV debug_level=4 auth_mode=optional crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 11360 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none key_file=none" \ |
| 11361 | 0 \ |
| 11362 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11363 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11364 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11365 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11366 | -s "=> write certificate request" \ |
| 11367 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11368 | -s "=> parse client hello" \ |
| 11369 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 11370 | |
| 11371 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11372 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11373 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11375 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 11376 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 11377 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 11378 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 11379 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11380 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11381 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11382 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 11383 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11384 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 11385 | -s "=> write hello retry request" \ |
| 11386 | -s "<= write hello retry request" |
| 11387 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 11388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11389 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11390 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11391 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11392 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 11393 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 11394 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 11395 | 1 \ |
| 11396 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11397 | -s "No certificate available." |
| 11398 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 11399 | requires_openssl_tls1_3 |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 11400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11401 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11402 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11403 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 11404 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11405 | "$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 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 11406 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11407 | "$O_NEXT_CLI -msg -debug -servername localhost -CAfile data_files/test-ca_cat12.crt -cert data_files/server5.crt -key data_files/server5.key -tls1_3" \ |
| 11408 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11409 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 11410 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11411 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 11412 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11414 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11415 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11416 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 11417 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11418 | "$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 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 11419 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11420 | "$G_NEXT_CLI localhost -d 4 --sni-hostname=localhost --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS -V" \ |
| 11421 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11422 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 11423 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11424 | |
| 11425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11426 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 11427 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11428 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11429 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 11430 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 11431 | "$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 \ |
| 11432 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 11433 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 11434 | force_version=tls13" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11435 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 11436 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 11437 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 11438 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 11439 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 11440 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 11441 | TEST_SUITE_NAME=${i##*/} |
| 11442 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 11443 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 11444 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 11445 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 11446 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11447 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11449 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11450 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11451 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11452 | 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] | 11453 | "$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] | 11454 | "$P_CLI debug_level=3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11455 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11456 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11457 | -c "HTTP/1.0 200 ok" |
| 11458 | |
| 11459 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11461 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11462 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11463 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11464 | 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] | 11465 | "$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] | 11466 | "$P_CLI debug_level=3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11467 | 1 \ |
| 11468 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 11469 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11470 | requires_gnutls_tls1_3 |
| 11471 | requires_gnutls_next_no_ticket |
| 11472 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11474 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11475 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11476 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11477 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 11478 | "$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] | 11479 | "$P_CLI debug_level=3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11480 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11481 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11482 | -c "HTTP/1.0 200 OK" |
| 11483 | |
| 11484 | requires_gnutls_tls1_3 |
| 11485 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11487 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11488 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11489 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11490 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 11491 | "$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] | 11492 | "$P_CLI debug_level=3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11493 | 1 \ |
| 11494 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 11495 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 11496 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 11498 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 11499 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 11500 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11501 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 11502 | run_tests_memory_after_hanshake |
| 11503 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 11504 | # Final report |
| 11505 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 11506 | echo "------------------------------------------------------------------------" |
| 11507 | |
| 11508 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 11509 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 11510 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 11511 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 11512 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 11513 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 11514 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 11515 | |
| 11516 | exit $FAILS |