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" |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 83 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 84 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 85 | 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] | 86 | 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] | 87 | else |
| 88 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 89 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 90 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 91 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 92 | O_NEXT_CLI=false |
| 93 | fi |
| 94 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 95 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 96 | 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] | 97 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 98 | else |
| 99 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 100 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 101 | fi |
| 102 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 103 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 104 | 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] | 105 | 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] | 106 | else |
| 107 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 108 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 109 | fi |
| 110 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 111 | TESTS=0 |
| 112 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 113 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 114 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 115 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 116 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 117 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 118 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 119 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 120 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 121 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 122 | RUN_TEST_NUMBER='' |
| 123 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 124 | PRESERVE_LOGS=0 |
| 125 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 126 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 127 | # port which is this plus 10000. Each port number may be independently |
| 128 | # overridden by a command line option. |
| 129 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 130 | PXY_PORT=$((SRV_PORT + 10000)) |
| 131 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 132 | print_usage() { |
| 133 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 134 | printf " -h|--help\tPrint this help.\n" |
| 135 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 136 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 137 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 138 | 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] | 139 | 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] | 140 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 141 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 142 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 143 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 144 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 145 | 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] | 146 | } |
| 147 | |
| 148 | get_options() { |
| 149 | while [ $# -gt 0 ]; do |
| 150 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 151 | -f|--filter) |
| 152 | shift; FILTER=$1 |
| 153 | ;; |
| 154 | -e|--exclude) |
| 155 | shift; EXCLUDE=$1 |
| 156 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 157 | -m|--memcheck) |
| 158 | MEMCHECK=1 |
| 159 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 160 | -n|--number) |
| 161 | shift; RUN_TEST_NUMBER=$1 |
| 162 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 163 | -s|--show-numbers) |
| 164 | SHOW_TEST_NUMBER=1 |
| 165 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 166 | -p|--preserve-logs) |
| 167 | PRESERVE_LOGS=1 |
| 168 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 169 | --port) |
| 170 | shift; SRV_PORT=$1 |
| 171 | ;; |
| 172 | --proxy-port) |
| 173 | shift; PXY_PORT=$1 |
| 174 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 175 | --seed) |
| 176 | shift; SEED="$1" |
| 177 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 178 | -h|--help) |
| 179 | print_usage |
| 180 | exit 0 |
| 181 | ;; |
| 182 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 183 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 184 | print_usage |
| 185 | exit 1 |
| 186 | ;; |
| 187 | esac |
| 188 | shift |
| 189 | done |
| 190 | } |
| 191 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 192 | # Make the outcome file path relative to the original directory, not |
| 193 | # to .../tests |
| 194 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 195 | [!/]*) |
| 196 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 197 | ;; |
| 198 | esac |
| 199 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 200 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 201 | # testing. Skip non-boolean options (with something other than spaces |
| 202 | # and a comment after "#define SYMBOL"). The variable contains a |
| 203 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 204 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 205 | # Skip next test; use this macro to skip tests which are legitimate |
| 206 | # in theory and expected to be re-introduced at some point, but |
| 207 | # aren't expected to succeed at the moment due to problems outside |
| 208 | # our control (such as bugs in other TLS implementations). |
| 209 | skip_next_test() { |
| 210 | SKIP_NEXT="YES" |
| 211 | } |
| 212 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 213 | # 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] | 214 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 216 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | *) SKIP_NEXT="YES";; |
| 218 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 219 | } |
| 220 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 221 | # 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] | 222 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 223 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 224 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 225 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 226 | } |
| 227 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 228 | requires_all_configs_enabled() { |
| 229 | if ! $P_QUERY -all $* |
| 230 | then |
| 231 | SKIP_NEXT="YES" |
| 232 | fi |
| 233 | } |
| 234 | |
| 235 | requires_all_configs_disabled() { |
| 236 | if $P_QUERY -any $* |
| 237 | then |
| 238 | SKIP_NEXT="YES" |
| 239 | fi |
| 240 | } |
| 241 | |
| 242 | requires_any_configs_enabled() { |
| 243 | if ! $P_QUERY -any $* |
| 244 | then |
| 245 | SKIP_NEXT="YES" |
| 246 | fi |
| 247 | } |
| 248 | |
| 249 | requires_any_configs_disabled() { |
| 250 | if $P_QUERY -all $* |
| 251 | then |
| 252 | SKIP_NEXT="YES" |
| 253 | fi |
| 254 | } |
| 255 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 256 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 257 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 258 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 259 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 260 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 261 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 262 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 263 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 264 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 265 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 266 | then |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 267 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 268 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 269 | then |
| 270 | SKIP_NEXT="YES" |
| 271 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 272 | } |
| 273 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 274 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 275 | # This function uses the query_config command line option to query the |
| 276 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 277 | # program. The command will always return a success value if the |
| 278 | # configuration is defined and the value will be printed to stdout. |
| 279 | # |
| 280 | # Note that if the configuration is not defined or is defined to nothing, |
| 281 | # the output of this function will be an empty string. |
| 282 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 286 | VAL="$( get_config_value_or_default "$1" )" |
| 287 | if [ -z "$VAL" ]; then |
| 288 | # Should never happen |
| 289 | echo "Mbed TLS configuration $1 is not defined" |
| 290 | exit 1 |
| 291 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 292 | SKIP_NEXT="YES" |
| 293 | fi |
| 294 | } |
| 295 | |
| 296 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 297 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 298 | if [ -z "$VAL" ]; then |
| 299 | # Should never happen |
| 300 | echo "Mbed TLS configuration $1 is not defined" |
| 301 | exit 1 |
| 302 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 303 | SKIP_NEXT="YES" |
| 304 | fi |
| 305 | } |
| 306 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 307 | requires_config_value_equals() { |
| 308 | VAL=$( get_config_value_or_default "$1" ) |
| 309 | if [ -z "$VAL" ]; then |
| 310 | # Should never happen |
| 311 | echo "Mbed TLS configuration $1 is not defined" |
| 312 | exit 1 |
| 313 | elif [ "$VAL" -ne "$2" ]; then |
| 314 | SKIP_NEXT="YES" |
| 315 | fi |
| 316 | } |
| 317 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 318 | # Require Mbed TLS to support the given protocol version. |
| 319 | # |
| 320 | # Inputs: |
| 321 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 322 | requires_protocol_version() { |
| 323 | # Support for DTLS is detected separately in detect_dtls(). |
| 324 | case "$1" in |
| 325 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 326 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 327 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 328 | esac |
| 329 | } |
| 330 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 331 | # Space-separated list of ciphersuites supported by this build of |
| 332 | # Mbed TLS. |
| 333 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 334 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 335 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 336 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 337 | case $P_CIPHERSUITES in |
| 338 | *" $1 "*) :;; |
| 339 | *) SKIP_NEXT="YES";; |
| 340 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 341 | } |
| 342 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 343 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 344 | # If CMD (call to a TLS client or server program) requires certain features, |
| 345 | # arrange to only run the following test case if those features are enabled. |
| 346 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 347 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 348 | *\ force_version=*) |
| 349 | tmp="${1##*\ force_version=}" |
| 350 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 351 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 352 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 353 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 354 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 355 | *\ force_ciphersuite=*) |
| 356 | tmp="${1##*\ force_ciphersuite=}" |
| 357 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 358 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 359 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 360 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 361 | case " $1 " in |
| 362 | *[-_\ =]tickets=[^0]*) |
| 363 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 364 | esac |
| 365 | case " $1 " in |
| 366 | *[-_\ =]alpn=*) |
| 367 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 368 | esac |
| 369 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 370 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 371 | } |
| 372 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 373 | requires_certificate_authentication () { |
| 374 | if [ "$PSK_ONLY" = "YES" ]; then |
| 375 | SKIP_NEXT="YES" |
| 376 | fi |
| 377 | } |
| 378 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 379 | adapt_cmd_for_psk () { |
| 380 | case "$2" in |
| 381 | *openssl*) s='-psk abc123 -nocert';; |
| 382 | *gnutls-*) s='--pskkey=abc123';; |
| 383 | *) s='psk=abc123';; |
| 384 | esac |
| 385 | eval $1='"$2 $s"' |
| 386 | unset s |
| 387 | } |
| 388 | |
| 389 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 390 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 391 | # |
| 392 | # If not running in a PSK-only build, do nothing. |
| 393 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 394 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 395 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 396 | # a pre-shared key, do nothing. |
| 397 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 398 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 399 | # |
| 400 | # Inputs: |
| 401 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 402 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 403 | # * "$@": options passed to run_test. |
| 404 | # |
| 405 | # Outputs: |
| 406 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 407 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 408 | maybe_adapt_for_psk() { |
| 409 | if [ "$PSK_ONLY" != "YES" ]; then |
| 410 | return |
| 411 | fi |
| 412 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 413 | return |
| 414 | fi |
| 415 | case "$CLI_CMD $SRV_CMD" in |
| 416 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 417 | return;; |
| 418 | *force_ciphersuite*) |
| 419 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 420 | # PSK cipher suite could be substituted, but we're not ready for |
| 421 | # that yet. |
| 422 | SKIP_NEXT="YES" |
| 423 | return;; |
| 424 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 425 | # The test case involves certificates. PSK won't do. |
| 426 | SKIP_NEXT="YES" |
| 427 | return;; |
| 428 | esac |
| 429 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 430 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 431 | } |
| 432 | |
| 433 | case " $CONFIGS_ENABLED " in |
| 434 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 435 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 436 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 437 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 438 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 439 | *) PSK_ONLY="NO";; |
| 440 | esac |
| 441 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 442 | HAS_ALG_SHA_1="NO" |
| 443 | HAS_ALG_SHA_224="NO" |
| 444 | HAS_ALG_SHA_256="NO" |
| 445 | HAS_ALG_SHA_384="NO" |
| 446 | HAS_ALG_SHA_512="NO" |
| 447 | |
| 448 | check_for_hash_alg() |
| 449 | { |
| 450 | CURR_ALG="INVALID"; |
| 451 | USE_PSA="NO" |
| 452 | case $CONFIGS_ENABLED in |
| 453 | *" MBEDTLS_USE_PSA_CRYPTO"[\ =]*) |
| 454 | USE_PSA="YES"; |
| 455 | ;; |
| 456 | *) :;; |
| 457 | esac |
| 458 | if [ $USE_PSA = "YES" ]; then |
| 459 | CURR_ALG=PSA_WANT_ALG_${1} |
| 460 | else |
| 461 | CURR_ALG=MBEDTLS_${1}_C |
| 462 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 463 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 464 | fi |
| 465 | |
| 466 | case $CONFIGS_ENABLED in |
| 467 | *" $CURR_ALG"[\ =]*) |
| 468 | return 0 |
| 469 | ;; |
| 470 | *) :;; |
| 471 | esac |
| 472 | return 1 |
| 473 | } |
| 474 | |
| 475 | populate_enabled_hash_algs() |
| 476 | { |
| 477 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 478 | if check_for_hash_alg "$hash_alg"; then |
| 479 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 480 | eval ${hash_alg_variable}=YES |
| 481 | fi |
| 482 | done |
| 483 | } |
| 484 | |
| 485 | # skip next test if the given hash alg is not supported |
| 486 | requires_hash_alg() { |
| 487 | HASH_DEFINE="Invalid" |
| 488 | HAS_HASH_ALG="NO" |
| 489 | case $1 in |
| 490 | SHA_1):;; |
| 491 | SHA_224):;; |
| 492 | SHA_256):;; |
| 493 | SHA_384):;; |
| 494 | SHA_512):;; |
| 495 | *) |
| 496 | echo "Unsupported hash alg - $1" |
| 497 | exit 1 |
| 498 | ;; |
| 499 | esac |
| 500 | |
| 501 | HASH_DEFINE=HAS_ALG_${1} |
| 502 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 503 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 504 | then |
| 505 | SKIP_NEXT="YES" |
| 506 | fi |
| 507 | } |
| 508 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 509 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 510 | requires_openssl_with_fallback_scsv() { |
| 511 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 512 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 513 | then |
| 514 | OPENSSL_HAS_FBSCSV="YES" |
| 515 | else |
| 516 | OPENSSL_HAS_FBSCSV="NO" |
| 517 | fi |
| 518 | fi |
| 519 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 520 | SKIP_NEXT="YES" |
| 521 | fi |
| 522 | } |
| 523 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 524 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 525 | requires_max_content_len() { |
| 526 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 527 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 528 | } |
| 529 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 530 | # skip next test if GnuTLS isn't available |
| 531 | requires_gnutls() { |
| 532 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 533 | 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] | 534 | GNUTLS_AVAILABLE="YES" |
| 535 | else |
| 536 | GNUTLS_AVAILABLE="NO" |
| 537 | fi |
| 538 | fi |
| 539 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 540 | SKIP_NEXT="YES" |
| 541 | fi |
| 542 | } |
| 543 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 544 | # skip next test if GnuTLS-next isn't available |
| 545 | requires_gnutls_next() { |
| 546 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 547 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 548 | GNUTLS_NEXT_AVAILABLE="YES" |
| 549 | else |
| 550 | GNUTLS_NEXT_AVAILABLE="NO" |
| 551 | fi |
| 552 | fi |
| 553 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 554 | SKIP_NEXT="YES" |
| 555 | fi |
| 556 | } |
| 557 | |
| 558 | # skip next test if OpenSSL-legacy isn't available |
| 559 | requires_openssl_legacy() { |
| 560 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 561 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 562 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 563 | else |
| 564 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 565 | fi |
| 566 | fi |
| 567 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 568 | SKIP_NEXT="YES" |
| 569 | fi |
| 570 | } |
| 571 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 572 | requires_openssl_next() { |
| 573 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 574 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 575 | OPENSSL_NEXT_AVAILABLE="YES" |
| 576 | else |
| 577 | OPENSSL_NEXT_AVAILABLE="NO" |
| 578 | fi |
| 579 | fi |
| 580 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 581 | SKIP_NEXT="YES" |
| 582 | fi |
| 583 | } |
| 584 | |
| 585 | # skip next test if tls1_3 is not available |
| 586 | requires_openssl_tls1_3() { |
| 587 | requires_openssl_next |
| 588 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 589 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 590 | fi |
| 591 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 592 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 593 | then |
| 594 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 595 | else |
| 596 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 597 | fi |
| 598 | fi |
| 599 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 600 | SKIP_NEXT="YES" |
| 601 | fi |
| 602 | } |
| 603 | |
| 604 | # skip next test if tls1_3 is not available |
| 605 | requires_gnutls_tls1_3() { |
| 606 | requires_gnutls_next |
| 607 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 608 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 609 | fi |
| 610 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 611 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 612 | then |
| 613 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 614 | else |
| 615 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 616 | fi |
| 617 | fi |
| 618 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 619 | SKIP_NEXT="YES" |
| 620 | fi |
| 621 | } |
| 622 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 623 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 624 | requires_gnutls_next_no_ticket() { |
| 625 | requires_gnutls_next |
| 626 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 627 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 628 | fi |
| 629 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 630 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 631 | then |
| 632 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 633 | else |
| 634 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 635 | fi |
| 636 | fi |
| 637 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 638 | SKIP_NEXT="YES" |
| 639 | fi |
| 640 | } |
| 641 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 642 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 643 | requires_gnutls_next_disable_tls13_compat() { |
| 644 | requires_gnutls_next |
| 645 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 646 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 647 | fi |
| 648 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 649 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 650 | then |
| 651 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 652 | else |
| 653 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 654 | fi |
| 655 | fi |
| 656 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 657 | SKIP_NEXT="YES" |
| 658 | fi |
| 659 | } |
| 660 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 661 | # skip next test if IPv6 isn't available on this host |
| 662 | requires_ipv6() { |
| 663 | if [ -z "${HAS_IPV6:-}" ]; then |
| 664 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 665 | SRV_PID=$! |
| 666 | sleep 1 |
| 667 | kill $SRV_PID >/dev/null 2>&1 |
| 668 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 669 | HAS_IPV6="NO" |
| 670 | else |
| 671 | HAS_IPV6="YES" |
| 672 | fi |
| 673 | rm -r $SRV_OUT |
| 674 | fi |
| 675 | |
| 676 | if [ "$HAS_IPV6" = "NO" ]; then |
| 677 | SKIP_NEXT="YES" |
| 678 | fi |
| 679 | } |
| 680 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 681 | # skip next test if it's i686 or uname is not available |
| 682 | requires_not_i686() { |
| 683 | if [ -z "${IS_I686:-}" ]; then |
| 684 | IS_I686="YES" |
| 685 | if which "uname" >/dev/null 2>&1; then |
| 686 | if [ -z "$(uname -a | grep i686)" ]; then |
| 687 | IS_I686="NO" |
| 688 | fi |
| 689 | fi |
| 690 | fi |
| 691 | if [ "$IS_I686" = "YES" ]; then |
| 692 | SKIP_NEXT="YES" |
| 693 | fi |
| 694 | } |
| 695 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 696 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 697 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 698 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 699 | 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] | 700 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 701 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 702 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 703 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 704 | fi |
| 705 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 706 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 707 | fi |
| 708 | |
| 709 | # skip the next test if the SSL output buffer is less than 16KB |
| 710 | requires_full_size_output_buffer() { |
| 711 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 712 | SKIP_NEXT="YES" |
| 713 | fi |
| 714 | } |
| 715 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 716 | # skip the next test if valgrind is in use |
| 717 | not_with_valgrind() { |
| 718 | if [ "$MEMCHECK" -gt 0 ]; then |
| 719 | SKIP_NEXT="YES" |
| 720 | fi |
| 721 | } |
| 722 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 723 | # skip the next test if valgrind is NOT in use |
| 724 | only_with_valgrind() { |
| 725 | if [ "$MEMCHECK" -eq 0 ]; then |
| 726 | SKIP_NEXT="YES" |
| 727 | fi |
| 728 | } |
| 729 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 730 | # 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] | 731 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 732 | CLI_DELAY_FACTOR=$1 |
| 733 | } |
| 734 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 735 | # wait for the given seconds after the client finished in the next test |
| 736 | server_needs_more_time() { |
| 737 | SRV_DELAY_SECONDS=$1 |
| 738 | } |
| 739 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 740 | # print_name <name> |
| 741 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 742 | TESTS=$(( $TESTS + 1 )) |
| 743 | LINE="" |
| 744 | |
| 745 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 746 | LINE="$TESTS " |
| 747 | fi |
| 748 | |
| 749 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 750 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 751 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 752 | for i in `seq 1 $LEN`; do printf '.'; done |
| 753 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 754 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 755 | } |
| 756 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 757 | # record_outcome <outcome> [<failure-reason>] |
| 758 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 759 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 760 | record_outcome() { |
| 761 | echo "$1" |
| 762 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 763 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 764 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 765 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 766 | "$1" "${2-}" \ |
| 767 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 768 | fi |
| 769 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 770 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 771 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 772 | # True if the presence of the given pattern in a log definitely indicates |
| 773 | # that the test has failed. False if the presence is inconclusive. |
| 774 | # |
| 775 | # Inputs: |
| 776 | # * $1: pattern found in the logs |
| 777 | # * $TIMES_LEFT: >0 if retrying is an option |
| 778 | # |
| 779 | # Outputs: |
| 780 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 781 | # unchanged otherwise. |
| 782 | # * Return value: 1 if the pattern is inconclusive, |
| 783 | # 0 if the failure is definitive. |
| 784 | log_pattern_presence_is_conclusive() { |
| 785 | # If we've run out of attempts, then don't retry no matter what. |
| 786 | if [ $TIMES_LEFT -eq 0 ]; then |
| 787 | return 0 |
| 788 | fi |
| 789 | case $1 in |
| 790 | "resend") |
| 791 | # An undesired resend may have been caused by the OS dropping or |
| 792 | # delaying a packet at an inopportune time. |
| 793 | outcome="RETRY(resend)" |
| 794 | return 1;; |
| 795 | esac |
| 796 | } |
| 797 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 798 | # fail <message> |
| 799 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 800 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 801 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 802 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 803 | mv $SRV_OUT o-srv-${TESTS}.log |
| 804 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 805 | if [ -n "$PXY_CMD" ]; then |
| 806 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 807 | fi |
| 808 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 809 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 810 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 811 | echo " ! server output:" |
| 812 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 813 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 814 | echo " ! client output:" |
| 815 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 816 | if [ -n "$PXY_CMD" ]; then |
| 817 | echo " ! ========================================================" |
| 818 | echo " ! proxy output:" |
| 819 | cat o-pxy-${TESTS}.log |
| 820 | fi |
| 821 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 822 | fi |
| 823 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 824 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 825 | } |
| 826 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 827 | # is_polar <cmd_line> |
| 828 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 829 | case "$1" in |
| 830 | *ssl_client2*) true;; |
| 831 | *ssl_server2*) true;; |
| 832 | *) false;; |
| 833 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 834 | } |
| 835 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 836 | # openssl s_server doesn't have -www with DTLS |
| 837 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 838 | case "$SRV_CMD" in |
| 839 | *s_server*-dtls*) |
| 840 | NEEDS_INPUT=1 |
| 841 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 842 | *) NEEDS_INPUT=0;; |
| 843 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 844 | } |
| 845 | |
| 846 | # provide input to commands that need it |
| 847 | provide_input() { |
| 848 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 849 | return |
| 850 | fi |
| 851 | |
| 852 | while true; do |
| 853 | echo "HTTP/1.0 200 OK" |
| 854 | sleep 1 |
| 855 | done |
| 856 | } |
| 857 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 858 | # has_mem_err <log_file_name> |
| 859 | has_mem_err() { |
| 860 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 861 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 862 | then |
| 863 | return 1 # false: does not have errors |
| 864 | else |
| 865 | return 0 # true: has errors |
| 866 | fi |
| 867 | } |
| 868 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 869 | # 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] | 870 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 871 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 872 | newline=' |
| 873 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 874 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 875 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 876 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 877 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 878 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 879 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 880 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 881 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 882 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 883 | # When we use a proxy, it will be listening on the same port we |
| 884 | # 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] | 885 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 886 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 887 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 888 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 889 | echo "$3 START TIMEOUT" |
| 890 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 891 | break |
| 892 | fi |
| 893 | # Linux and *BSD support decimal arguments to sleep. On other |
| 894 | # OSes this may be a tight loop. |
| 895 | sleep 0.1 2>/dev/null || true |
| 896 | done |
| 897 | } |
| 898 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 899 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 900 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 901 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 902 | } |
| 903 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 904 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 905 | # Wait for server process $2 to be listening on port $1. |
| 906 | wait_server_start() { |
| 907 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 908 | } |
| 909 | |
| 910 | # Wait for proxy process $2 to be listening on port $1. |
| 911 | wait_proxy_start() { |
| 912 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 913 | } |
| 914 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 915 | # 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] | 916 | # 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] | 917 | # acceptable bounds |
| 918 | check_server_hello_time() { |
| 919 | # 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] | 920 | 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] | 921 | # Get the Unix timestamp for now |
| 922 | CUR_TIME=$(date +'%s') |
| 923 | THRESHOLD_IN_SECS=300 |
| 924 | |
| 925 | # Check if the ServerHello time was printed |
| 926 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 927 | return 1 |
| 928 | fi |
| 929 | |
| 930 | # Check the time in ServerHello is within acceptable bounds |
| 931 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 932 | # The time in ServerHello is at least 5 minutes before now |
| 933 | return 1 |
| 934 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 935 | # 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] | 936 | return 1 |
| 937 | else |
| 938 | return 0 |
| 939 | fi |
| 940 | } |
| 941 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 942 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 943 | handshake_memory_get() { |
| 944 | OUTPUT_VARIABLE="$1" |
| 945 | OUTPUT_FILE="$2" |
| 946 | |
| 947 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 948 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 949 | |
| 950 | # Check if memory usage was read |
| 951 | if [ -z "$MEM_USAGE" ]; then |
| 952 | echo "Error: Can not read the value of handshake memory usage" |
| 953 | return 1 |
| 954 | else |
| 955 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 956 | return 0 |
| 957 | fi |
| 958 | } |
| 959 | |
| 960 | # Get handshake memory usage from server or client output and check if this value |
| 961 | # is not higher than the maximum given by the first argument |
| 962 | handshake_memory_check() { |
| 963 | MAX_MEMORY="$1" |
| 964 | OUTPUT_FILE="$2" |
| 965 | |
| 966 | # Get memory usage |
| 967 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 968 | return 1 |
| 969 | fi |
| 970 | |
| 971 | # Check if memory usage is below max value |
| 972 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 973 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 974 | "but should be below $MAX_MEMORY bytes" |
| 975 | return 1 |
| 976 | else |
| 977 | return 0 |
| 978 | fi |
| 979 | } |
| 980 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 981 | # wait for client to terminate and set CLI_EXIT |
| 982 | # must be called right after starting the client |
| 983 | wait_client_done() { |
| 984 | CLI_PID=$! |
| 985 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 986 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 987 | CLI_DELAY_FACTOR=1 |
| 988 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 989 | ( 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] | 990 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 991 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 992 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 993 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 994 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 995 | CLI_EXIT=$? |
| 996 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 997 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 998 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 999 | |
| 1000 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1001 | |
| 1002 | sleep $SRV_DELAY_SECONDS |
| 1003 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1004 | } |
| 1005 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1006 | # check if the given command uses dtls and sets global variable DTLS |
| 1007 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1008 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1009 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1010 | *) DTLS=0;; |
| 1011 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1012 | } |
| 1013 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1014 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1015 | is_gnutls() { |
| 1016 | case "$1" in |
| 1017 | *gnutls-cli*) |
| 1018 | CMD_IS_GNUTLS=1 |
| 1019 | ;; |
| 1020 | *gnutls-serv*) |
| 1021 | CMD_IS_GNUTLS=1 |
| 1022 | ;; |
| 1023 | *) |
| 1024 | CMD_IS_GNUTLS=0 |
| 1025 | ;; |
| 1026 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1027 | } |
| 1028 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1029 | # Generate random psk_list argument for ssl_server2 |
| 1030 | get_srv_psk_list () |
| 1031 | { |
| 1032 | case $(( TESTS % 3 )) in |
| 1033 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1034 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1035 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1036 | esac |
| 1037 | } |
| 1038 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1039 | # Determine what calc_verify trace is to be expected, if any. |
| 1040 | # |
| 1041 | # calc_verify is only called for two things: to calculate the |
| 1042 | # extended master secret, and to process client authentication. |
| 1043 | # |
| 1044 | # Warning: the current implementation assumes that extended_ms is not |
| 1045 | # disabled on the client or on the server. |
| 1046 | # |
| 1047 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1048 | # * $1: the value of the server auth_mode parameter. |
| 1049 | # 'required' if client authentication is expected, |
| 1050 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1051 | # * $CONFIGS_ENABLED |
| 1052 | # |
| 1053 | # Outputs: |
| 1054 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1055 | set_maybe_calc_verify() { |
| 1056 | maybe_calc_verify= |
| 1057 | case $CONFIGS_ENABLED in |
| 1058 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1059 | *) |
| 1060 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1061 | ''|none) return;; |
| 1062 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1063 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1064 | esac |
| 1065 | esac |
| 1066 | case $CONFIGS_ENABLED in |
| 1067 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1068 | *) maybe_calc_verify="<= calc verify";; |
| 1069 | esac |
| 1070 | } |
| 1071 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1072 | # Compare file content |
| 1073 | # Usage: find_in_both pattern file1 file2 |
| 1074 | # extract from file1 the first line matching the pattern |
| 1075 | # check in file2 that the same line can be found |
| 1076 | find_in_both() { |
| 1077 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1078 | if [ -z "$srv_pattern" ]; then |
| 1079 | return 1; |
| 1080 | fi |
| 1081 | |
| 1082 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1083 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1084 | else |
| 1085 | return 1; |
| 1086 | fi |
| 1087 | } |
| 1088 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1089 | SKIP_HANDSHAKE_CHECK="NO" |
| 1090 | skip_handshake_stage_check() { |
| 1091 | SKIP_HANDSHAKE_CHECK="YES" |
| 1092 | } |
| 1093 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1094 | # Analyze the commands that will be used in a test. |
| 1095 | # |
| 1096 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1097 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1098 | # |
| 1099 | # Inputs: |
| 1100 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1101 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1102 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1103 | # |
| 1104 | # Outputs: |
| 1105 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1106 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1107 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1108 | # 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] | 1109 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1110 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1111 | case " $SRV_CMD " in |
| 1112 | *' server_addr=::1 '*) |
| 1113 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1114 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1115 | fi |
| 1116 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1117 | # update CMD_IS_GNUTLS variable |
| 1118 | is_gnutls "$SRV_CMD" |
| 1119 | |
| 1120 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1121 | # set the default priority |
| 1122 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1123 | case "$SRV_CMD" in |
| 1124 | *--priority*) :;; |
| 1125 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1126 | esac |
| 1127 | fi |
| 1128 | |
| 1129 | # update CMD_IS_GNUTLS variable |
| 1130 | is_gnutls "$CLI_CMD" |
| 1131 | |
| 1132 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1133 | # set the default priority |
| 1134 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1135 | case "$CLI_CMD" in |
| 1136 | *--priority*) :;; |
| 1137 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1138 | esac |
| 1139 | fi |
| 1140 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1141 | # fix client port |
| 1142 | if [ -n "$PXY_CMD" ]; then |
| 1143 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1144 | else |
| 1145 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1146 | fi |
| 1147 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1148 | # prepend valgrind to our commands if active |
| 1149 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1150 | if is_polar "$SRV_CMD"; then |
| 1151 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1152 | fi |
| 1153 | if is_polar "$CLI_CMD"; then |
| 1154 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1155 | fi |
| 1156 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1157 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1158 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1159 | # Check for failure conditions after a test case. |
| 1160 | # |
| 1161 | # Inputs from run_test: |
| 1162 | # * positional parameters: test options (see run_test documentation) |
| 1163 | # * $CLI_EXIT: client return code |
| 1164 | # * $CLI_EXPECT: expected client return code |
| 1165 | # * $SRV_RET: server return code |
| 1166 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1167 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1168 | # |
| 1169 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1170 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1171 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1172 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1173 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1174 | if [ $TIMES_LEFT -gt 0 ] && |
| 1175 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1176 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1177 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1178 | return |
| 1179 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1180 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1181 | # 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] | 1182 | # (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] | 1183 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1184 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1185 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1186 | then |
| 1187 | if is_polar "$SRV_CMD"; then |
| 1188 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1189 | else |
| 1190 | fail "server or client failed to reach handshake stage" |
| 1191 | return |
| 1192 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1193 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1194 | if is_polar "$CLI_CMD"; then |
| 1195 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1196 | else |
| 1197 | fail "server or client failed to reach handshake stage" |
| 1198 | return |
| 1199 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1200 | fi |
| 1201 | fi |
| 1202 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1203 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1204 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1205 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1206 | # care anyway), in case e.g. the server reports a memory leak. |
| 1207 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1208 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1209 | return |
| 1210 | fi |
| 1211 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1212 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1213 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1214 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1215 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1216 | 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] | 1217 | return |
| 1218 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1219 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1220 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1221 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1222 | # 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] | 1223 | while [ $# -gt 0 ] |
| 1224 | do |
| 1225 | case $1 in |
| 1226 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1227 | 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] | 1228 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1229 | return |
| 1230 | fi |
| 1231 | ;; |
| 1232 | |
| 1233 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1234 | 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] | 1235 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1236 | return |
| 1237 | fi |
| 1238 | ;; |
| 1239 | |
| 1240 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1241 | 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] | 1242 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1243 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1244 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1245 | return |
| 1246 | fi |
| 1247 | ;; |
| 1248 | |
| 1249 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1250 | 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] | 1251 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1252 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1253 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1254 | return |
| 1255 | fi |
| 1256 | ;; |
| 1257 | |
| 1258 | # The filtering in the following two options (-u and -U) do the following |
| 1259 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1260 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1261 | # - keep one of each non-unique line |
| 1262 | # - count how many lines remain |
| 1263 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1264 | # if there were no duplicates. |
| 1265 | "-U") |
| 1266 | 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 |
| 1267 | fail "lines following pattern '$2' must be unique in Server output" |
| 1268 | return |
| 1269 | fi |
| 1270 | ;; |
| 1271 | |
| 1272 | "-u") |
| 1273 | 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 |
| 1274 | 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] | 1275 | return |
| 1276 | fi |
| 1277 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1278 | "-F") |
| 1279 | if ! $2 "$SRV_OUT"; then |
| 1280 | fail "function call to '$2' failed on Server output" |
| 1281 | return |
| 1282 | fi |
| 1283 | ;; |
| 1284 | "-f") |
| 1285 | if ! $2 "$CLI_OUT"; then |
| 1286 | fail "function call to '$2' failed on Client output" |
| 1287 | return |
| 1288 | fi |
| 1289 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1290 | "-g") |
| 1291 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1292 | fail "function call to '$2' failed on Server and Client output" |
| 1293 | return |
| 1294 | fi |
| 1295 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1296 | |
| 1297 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1298 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1299 | exit 1 |
| 1300 | esac |
| 1301 | shift 2 |
| 1302 | done |
| 1303 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1304 | # check valgrind's results |
| 1305 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1306 | 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] | 1307 | fail "Server has memory errors" |
| 1308 | return |
| 1309 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1310 | 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] | 1311 | fail "Client has memory errors" |
| 1312 | return |
| 1313 | fi |
| 1314 | fi |
| 1315 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1316 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1317 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1318 | } |
| 1319 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1320 | # Run the current test case: start the server and if applicable the proxy, run |
| 1321 | # the client, wait for all processes to finish or time out. |
| 1322 | # |
| 1323 | # Inputs: |
| 1324 | # * $NAME: test case name |
| 1325 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1326 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1327 | # |
| 1328 | # Outputs: |
| 1329 | # * $CLI_EXIT: client return code |
| 1330 | # * $SRV_RET: server return code |
| 1331 | do_run_test_once() { |
| 1332 | # run the commands |
| 1333 | if [ -n "$PXY_CMD" ]; then |
| 1334 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1335 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1336 | PXY_PID=$! |
| 1337 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1338 | fi |
| 1339 | |
| 1340 | check_osrv_dtls |
| 1341 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1342 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1343 | SRV_PID=$! |
| 1344 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1345 | |
| 1346 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1347 | # The client must be a subprocess of the script in order for killing it to |
| 1348 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1349 | # not at the end of the line: the latter approach will spawn eval as a |
| 1350 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1351 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1352 | wait_client_done |
| 1353 | |
| 1354 | sleep 0.05 |
| 1355 | |
| 1356 | # terminate the server (and the proxy) |
| 1357 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1358 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1359 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1360 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1361 | SRV_RET=$? |
| 1362 | |
| 1363 | if [ -n "$PXY_CMD" ]; then |
| 1364 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1365 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1366 | fi |
| 1367 | } |
| 1368 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1369 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1370 | # Options: -s pattern pattern that must be present in server output |
| 1371 | # -c pattern pattern that must be present in client output |
| 1372 | # -u pattern lines after pattern must be unique in client output |
| 1373 | # -f call shell function on client output |
| 1374 | # -S pattern pattern that must be absent in server output |
| 1375 | # -C pattern pattern that must be absent in client output |
| 1376 | # -U pattern lines after pattern must be unique in server output |
| 1377 | # -F call shell function on server output |
| 1378 | # -g call shell function on server and client output |
| 1379 | run_test() { |
| 1380 | NAME="$1" |
| 1381 | shift 1 |
| 1382 | |
| 1383 | if is_excluded "$NAME"; then |
| 1384 | SKIP_NEXT="NO" |
| 1385 | # There was no request to run the test, so don't record its outcome. |
| 1386 | return |
| 1387 | fi |
| 1388 | |
| 1389 | print_name "$NAME" |
| 1390 | |
| 1391 | # Do we only run numbered tests? |
| 1392 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1393 | case ",$RUN_TEST_NUMBER," in |
| 1394 | *",$TESTS,"*) :;; |
| 1395 | *) SKIP_NEXT="YES";; |
| 1396 | esac |
| 1397 | fi |
| 1398 | |
| 1399 | # does this test use a proxy? |
| 1400 | if [ "X$1" = "X-p" ]; then |
| 1401 | PXY_CMD="$2" |
| 1402 | shift 2 |
| 1403 | else |
| 1404 | PXY_CMD="" |
| 1405 | fi |
| 1406 | |
| 1407 | # get commands and client output |
| 1408 | SRV_CMD="$1" |
| 1409 | CLI_CMD="$2" |
| 1410 | CLI_EXPECT="$3" |
| 1411 | shift 3 |
| 1412 | |
| 1413 | # Check if test uses files |
| 1414 | case "$SRV_CMD $CLI_CMD" in |
| 1415 | *data_files/*) |
| 1416 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1417 | esac |
| 1418 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1419 | # Check if the test uses DTLS. |
| 1420 | detect_dtls "$SRV_CMD" |
| 1421 | if [ "$DTLS" -eq 1 ]; then |
| 1422 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1423 | fi |
| 1424 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1425 | # If the client or server requires certain features that can be detected |
| 1426 | # from their command-line arguments, check that they're enabled. |
| 1427 | detect_required_features "$SRV_CMD" "$@" |
| 1428 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1429 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1430 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1431 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1432 | |
| 1433 | # should we skip? |
| 1434 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1435 | SKIP_NEXT="NO" |
| 1436 | record_outcome "SKIP" |
| 1437 | SKIPS=$(( $SKIPS + 1 )) |
| 1438 | return |
| 1439 | fi |
| 1440 | |
| 1441 | analyze_test_commands "$@" |
| 1442 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1443 | # One regular run and two retries |
| 1444 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1445 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1446 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1447 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1448 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1449 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1450 | check_test_failure "$@" |
| 1451 | case $outcome in |
| 1452 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1453 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1454 | FAIL) return;; |
| 1455 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1456 | done |
| 1457 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1458 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1459 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1460 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1461 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1462 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1463 | if [ -n "$PXY_CMD" ]; then |
| 1464 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1465 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1466 | fi |
| 1467 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1468 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1469 | } |
| 1470 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1471 | run_test_psa() { |
| 1472 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1473 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1474 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1475 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1476 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1477 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1478 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1479 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1480 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1481 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1482 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1483 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1484 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1485 | -S "error" \ |
| 1486 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1487 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1488 | } |
| 1489 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1490 | run_test_psa_force_curve() { |
| 1491 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1492 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1493 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1494 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1495 | "$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] | 1496 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1497 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1498 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1499 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1500 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1501 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1502 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1503 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1504 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1505 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1506 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1507 | } |
| 1508 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1509 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1510 | # a maximum fragment length. |
| 1511 | # first argument ($1) is MFL for SSL client |
| 1512 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1513 | run_test_memory_after_hanshake_with_mfl() |
| 1514 | { |
| 1515 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1516 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1517 | |
| 1518 | # Leave some margin for robustness |
| 1519 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1520 | |
| 1521 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1522 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1523 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1524 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1525 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1526 | 0 \ |
| 1527 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1528 | } |
| 1529 | |
| 1530 | |
| 1531 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1532 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1533 | run_tests_memory_after_hanshake() |
| 1534 | { |
| 1535 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1536 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1537 | |
| 1538 | # first test with default MFU is to get reference memory usage |
| 1539 | MEMORY_USAGE_MFL_16K=0 |
| 1540 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1541 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1542 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1543 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1544 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1545 | 0 \ |
| 1546 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1547 | |
| 1548 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1549 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1550 | |
| 1551 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1552 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1553 | |
| 1554 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1555 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1556 | |
| 1557 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1558 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1559 | } |
| 1560 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1561 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1562 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1563 | rm -f context_srv.txt |
| 1564 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1565 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1566 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1567 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1568 | 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] | 1569 | exit 1 |
| 1570 | } |
| 1571 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1572 | # |
| 1573 | # MAIN |
| 1574 | # |
| 1575 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1576 | get_options "$@" |
| 1577 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1578 | populate_enabled_hash_algs |
| 1579 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1580 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1581 | # patterns rather than regular expressions, use a case statement instead |
| 1582 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1583 | # detects simple cases: plain substring, everything, nothing. |
| 1584 | # |
| 1585 | # As an exception, the character '.' is treated as an ordinary character |
| 1586 | # if it is the only special character in the string. This is because it's |
| 1587 | # rare to need "any one character", but needing a literal '.' is common |
| 1588 | # (e.g. '-f "DTLS 1.2"'). |
| 1589 | need_grep= |
| 1590 | case "$FILTER" in |
| 1591 | '^$') simple_filter=;; |
| 1592 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1593 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1594 | need_grep=1;; |
| 1595 | *) # No regexp or shell-pattern special character |
| 1596 | simple_filter="*$FILTER*";; |
| 1597 | esac |
| 1598 | case "$EXCLUDE" in |
| 1599 | '^$') simple_exclude=;; |
| 1600 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1601 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1602 | need_grep=1;; |
| 1603 | *) # No regexp or shell-pattern special character |
| 1604 | simple_exclude="*$EXCLUDE*";; |
| 1605 | esac |
| 1606 | if [ -n "$need_grep" ]; then |
| 1607 | is_excluded () { |
| 1608 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1609 | } |
| 1610 | else |
| 1611 | is_excluded () { |
| 1612 | case "$1" in |
| 1613 | $simple_exclude) true;; |
| 1614 | $simple_filter) false;; |
| 1615 | *) true;; |
| 1616 | esac |
| 1617 | } |
| 1618 | fi |
| 1619 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1620 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1621 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1622 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1623 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1624 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1625 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1626 | exit 1 |
| 1627 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1628 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1629 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1630 | exit 1 |
| 1631 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1632 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1633 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1634 | exit 1 |
| 1635 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1636 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1637 | if which valgrind >/dev/null 2>&1; then :; else |
| 1638 | echo "Memcheck not possible. Valgrind not found" |
| 1639 | exit 1 |
| 1640 | fi |
| 1641 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1642 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1643 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1644 | exit 1 |
| 1645 | fi |
| 1646 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1647 | # used by watchdog |
| 1648 | MAIN_PID="$$" |
| 1649 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1650 | # We use somewhat arbitrary delays for tests: |
| 1651 | # - how long do we wait for the server to start (when lsof not available)? |
| 1652 | # - how long do we allow for the client to finish? |
| 1653 | # (not to check performance, just to avoid waiting indefinitely) |
| 1654 | # Things are slower with valgrind, so give extra time here. |
| 1655 | # |
| 1656 | # Note: without lsof, there is a trade-off between the running time of this |
| 1657 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1658 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1659 | # 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] | 1660 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1661 | START_DELAY=6 |
| 1662 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1663 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1664 | START_DELAY=2 |
| 1665 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1666 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1667 | |
| 1668 | # some particular tests need more time: |
| 1669 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1670 | # - for the server, we sleep for a number of seconds after the client exits |
| 1671 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1672 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1673 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1674 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1675 | # 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] | 1676 | # +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] | 1677 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1678 | # 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] | 1679 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1680 | 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] | 1681 | 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] | 1682 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1683 | 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] | 1684 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1685 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1686 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1687 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1688 | 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] | 1689 | 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] | 1690 | fi |
| 1691 | |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1692 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 1693 | # low-security ones. This covers not just cipher suites but also protocol |
| 1694 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 1695 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 1696 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 1697 | # a way to discover it from -help, so check the openssl version. |
| 1698 | case $($OPENSSL_CMD version) in |
| 1699 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 1700 | *) |
| 1701 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 1702 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 1703 | ;; |
| 1704 | esac |
| 1705 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1706 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1707 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1708 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 1709 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1710 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1711 | 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] | 1712 | fi |
| 1713 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1714 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1715 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1716 | 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] | 1717 | fi |
| 1718 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1719 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1720 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1721 | 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] | 1722 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1723 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1724 | # Allow SHA-1, because many of our test certificates use it |
| 1725 | P_SRV="$P_SRV allow_sha1=1" |
| 1726 | P_CLI="$P_CLI allow_sha1=1" |
| 1727 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1728 | # Also pick a unique name for intermediate files |
| 1729 | SRV_OUT="srv_out.$$" |
| 1730 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1731 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1732 | SESSION="session.$$" |
| 1733 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1734 | SKIP_NEXT="NO" |
| 1735 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1736 | trap cleanup INT TERM HUP |
| 1737 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1738 | # Basic test |
| 1739 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1740 | # Checks that: |
| 1741 | # - 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] | 1742 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1744 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1745 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1746 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1747 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1748 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1749 | "$P_CLI" \ |
| 1750 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1751 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1752 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1753 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1754 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1755 | -S "error" \ |
| 1756 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1757 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1759 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1760 | run_test "Default, DTLS" \ |
| 1761 | "$P_SRV dtls=1" \ |
| 1762 | "$P_CLI dtls=1" \ |
| 1763 | 0 \ |
| 1764 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1765 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1768 | run_test "TLS client auth: required" \ |
| 1769 | "$P_SRV auth_mode=required" \ |
| 1770 | "$P_CLI" \ |
| 1771 | 0 \ |
| 1772 | -s "Verifying peer X.509 certificate... ok" |
| 1773 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1775 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1776 | "$P_SRV" \ |
| 1777 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1778 | 0 \ |
| 1779 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1780 | -c "Key size is 256" |
| 1781 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1783 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1784 | "$P_SRV" \ |
| 1785 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1786 | 0 \ |
| 1787 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1788 | -c "Key size is 128" |
| 1789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1791 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1792 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1793 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1794 | run_test "TLS: password protected client key" \ |
| 1795 | "$P_SRV auth_mode=required" \ |
| 1796 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1797 | 0 |
| 1798 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1800 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1801 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1802 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1803 | run_test "TLS: password protected server key" \ |
| 1804 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1805 | "$P_CLI" \ |
| 1806 | 0 |
| 1807 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1809 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1810 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1811 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1812 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1813 | run_test "TLS: password protected server key, two certificates" \ |
| 1814 | "$P_SRV \ |
| 1815 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1816 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1817 | "$P_CLI" \ |
| 1818 | 0 |
| 1819 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1821 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1822 | run_test "CA callback on client" \ |
| 1823 | "$P_SRV debug_level=3" \ |
| 1824 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1825 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1826 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1827 | -S "error" \ |
| 1828 | -C "error" |
| 1829 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1831 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1832 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1833 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1834 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1835 | run_test "CA callback on server" \ |
| 1836 | "$P_SRV auth_mode=required" \ |
| 1837 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1838 | key_file=data_files/server5.key" \ |
| 1839 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1840 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1841 | -s "Verifying peer X.509 certificate... ok" \ |
| 1842 | -S "error" \ |
| 1843 | -C "error" |
| 1844 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1845 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1847 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1848 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1849 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1850 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1851 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1852 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1853 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1854 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1855 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1856 | 0 \ |
| 1857 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1858 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1859 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1860 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1861 | -S "error" \ |
| 1862 | -C "error" |
| 1863 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1864 | # Test using a RSA opaque private key for client authentication |
| 1865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1866 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1867 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1868 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1869 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1870 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1871 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1872 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1873 | key_file=data_files/server2.key" \ |
| 1874 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1875 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1876 | 0 \ |
| 1877 | -c "key type: Opaque" \ |
| 1878 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1879 | -s "Verifying peer X.509 certificate... ok" \ |
| 1880 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1881 | -S "error" \ |
| 1882 | -C "error" |
| 1883 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 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_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1888 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1889 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1890 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1891 | key_file=data_files/server2.key" \ |
| 1892 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1893 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1894 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1895 | 0 \ |
| 1896 | -c "key type: Opaque" \ |
| 1897 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1898 | -s "Verifying peer X.509 certificate... ok" \ |
| 1899 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1900 | -S "error" \ |
| 1901 | -C "error" |
| 1902 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1903 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1906 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1907 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1908 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1909 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1910 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1911 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1912 | "$P_CLI" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1913 | 0 \ |
| 1914 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1915 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1916 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1917 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1918 | -S "error" \ |
| 1919 | -C "error" |
| 1920 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1922 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1923 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1924 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1925 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1926 | run_test "Opaque key for server authentication: ECDH-" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1927 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1928 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1929 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1930 | "$P_CLI" \ |
| 1931 | 0 \ |
| 1932 | -c "Verifying peer X.509 certificate... ok" \ |
| 1933 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1934 | -s "key types: Opaque, none" \ |
| 1935 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1936 | -S "error" \ |
| 1937 | -C "error" |
| 1938 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1940 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1941 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1942 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1943 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1944 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1945 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 1946 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 1947 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1948 | debug_level=1" \ |
| 1949 | "$P_CLI" \ |
| 1950 | 1 \ |
| 1951 | -s "key types: Opaque, none" \ |
| 1952 | -s "error" \ |
| 1953 | -c "error" \ |
| 1954 | -c "Public key type mismatch" |
| 1955 | |
| 1956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1957 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1958 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1959 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1960 | requires_config_enabled MBEDTLS_RSA_C |
| 1961 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1962 | requires_hash_alg SHA_256 |
| 1963 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 1964 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1965 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 1966 | debug_level=1" \ |
| 1967 | "$P_CLI" \ |
| 1968 | 1 \ |
| 1969 | -s "key types: Opaque, none" \ |
| 1970 | -s "error" \ |
| 1971 | -c "error" \ |
| 1972 | -c "Public key type mismatch" |
| 1973 | |
| 1974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1975 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1976 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1977 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1978 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1979 | requires_hash_alg SHA_256 |
| 1980 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1981 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1982 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1983 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1984 | "$P_CLI" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1985 | 1 \ |
| 1986 | -s "key types: Opaque, none" \ |
| 1987 | -s "got ciphersuites in common, but none of them usable" \ |
| 1988 | -s "error" \ |
| 1989 | -c "error" |
| 1990 | |
| 1991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1992 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1993 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1994 | requires_config_enabled MBEDTLS_ECDSA_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 1995 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1996 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1997 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1998 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1999 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2000 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2001 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2002 | "$P_CLI" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2003 | 1 \ |
| 2004 | -s "key types: Opaque, none" \ |
| 2005 | -s "got ciphersuites in common, but none of them usable" \ |
| 2006 | -s "error" \ |
| 2007 | -c "error" |
| 2008 | |
| 2009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2010 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2011 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2012 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2013 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2014 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2015 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2016 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2017 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 2018 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2019 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2020 | 1 \ |
| 2021 | -s "key types: Opaque, none" \ |
| 2022 | -s "got ciphersuites in common, but none of them usable" \ |
| 2023 | -s "error" \ |
| 2024 | -c "error" |
| 2025 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2027 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2028 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2029 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2030 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2031 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2032 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2033 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2034 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2035 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2036 | key_opaque_algs2=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2037 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2038 | 0 \ |
| 2039 | -c "Verifying peer X.509 certificate... ok" \ |
| 2040 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2041 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2042 | -s "key types: Opaque, Opaque" \ |
| 2043 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2044 | -S "error" \ |
| 2045 | -C "error" |
| 2046 | |
| 2047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2048 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2049 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2050 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2051 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2052 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2053 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2054 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2055 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2056 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2057 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2058 | "$P_CLI force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2059 | 0 \ |
| 2060 | -c "Verifying peer X.509 certificate... ok" \ |
| 2061 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2062 | -c "CN=Polarssl Test EC CA" \ |
| 2063 | -s "key types: Opaque, Opaque" \ |
| 2064 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2065 | -S "error" \ |
| 2066 | -C "error" |
| 2067 | |
| 2068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2069 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2070 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2071 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2072 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2073 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2074 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2075 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2076 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2077 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2078 | crt_file2=data_files/server2-sha256.crt \ |
| 2079 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2080 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2081 | 0 \ |
| 2082 | -c "Verifying peer X.509 certificate... ok" \ |
| 2083 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2084 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2085 | -s "key types: Opaque, Opaque" \ |
| 2086 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2087 | -S "error" \ |
| 2088 | -C "error" |
| 2089 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2091 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2092 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2093 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2094 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2095 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2096 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2097 | -s "The SSL configuration is tls13 only" \ |
| 2098 | -c "key type: Opaque" \ |
| 2099 | -s "key types: Opaque, Opaque" \ |
| 2100 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2101 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2102 | |
| 2103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2104 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2105 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2106 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2107 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2108 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2109 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2110 | -s "The SSL configuration is tls13 only" \ |
| 2111 | -c "key type: Opaque" \ |
| 2112 | -s "key types: Opaque, Opaque" \ |
| 2113 | -C "error" \ |
| 2114 | -S "error" \ |
| 2115 | |
| 2116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2117 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2118 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2119 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
| 2120 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
| 2121 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2122 | 0 \ |
| 2123 | -s "The SSL configuration is tls13 only" \ |
| 2124 | -s "key types: Opaque, Opaque" \ |
| 2125 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2126 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2127 | -C "error" \ |
| 2128 | -S "error" \ |
| 2129 | |
| 2130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2131 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2132 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2133 | run_test "TLS 1.3 opaque key: 2 keys on server, suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2134 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs2=ecdsa-sign,none key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2135 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2136 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2137 | -s "The SSL configuration is tls13 only" \ |
| 2138 | -c "key type: Opaque" \ |
| 2139 | -s "key types: Opaque, Opaque" \ |
| 2140 | -C "error" \ |
| 2141 | -S "error" \ |
| 2142 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2143 | # Test using a RSA opaque private key for server authentication |
| 2144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2145 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2146 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2147 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2148 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2149 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2150 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2151 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2152 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2153 | "$P_CLI" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2154 | 0 \ |
| 2155 | -c "Verifying peer X.509 certificate... ok" \ |
| 2156 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2157 | -s "key types: Opaque, none" \ |
| 2158 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2159 | -S "error" \ |
| 2160 | -C "error" |
| 2161 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2163 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2164 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2165 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2166 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2167 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2168 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2169 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2170 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2171 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2172 | 0 \ |
| 2173 | -c "Verifying peer X.509 certificate... ok" \ |
| 2174 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2175 | -s "key types: Opaque, none" \ |
| 2176 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2177 | -S "error" \ |
| 2178 | -C "error" |
| 2179 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2181 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2182 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2183 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2184 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2185 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2186 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2187 | psk=abc123 psk_identity=foo" \ |
| 2188 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 2189 | psk=abc123 psk_identity=foo" \ |
| 2190 | 0 \ |
| 2191 | -c "Verifying peer X.509 certificate... ok" \ |
| 2192 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2193 | -s "key types: Opaque, Opaque" \ |
| 2194 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2195 | -S "error" \ |
| 2196 | -C "error" |
| 2197 | |
| 2198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2199 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2200 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2201 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2202 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2203 | run_test "Opaque key for server authentication: RSA-" \ |
| 2204 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
| 2205 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
| 2206 | 0 \ |
| 2207 | -c "Verifying peer X.509 certificate... ok" \ |
| 2208 | -c "Ciphersuite is TLS-RSA-" \ |
| 2209 | -s "key types: Opaque, Opaque" \ |
| 2210 | -s "Ciphersuite is TLS-RSA-" \ |
| 2211 | -S "error" \ |
| 2212 | -C "error" |
| 2213 | |
| 2214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2215 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2216 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2217 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2218 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2219 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2220 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2221 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2222 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2223 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2224 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2225 | 1 \ |
| 2226 | -s "key types: Opaque, none" \ |
| 2227 | -s "got ciphersuites in common, but none of them usable" \ |
| 2228 | -s "error" \ |
| 2229 | -c "error" |
| 2230 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2232 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2233 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2234 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2235 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2236 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2237 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2238 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2239 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2240 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2241 | crt_file2=data_files/server4.crt \ |
| 2242 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2243 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2244 | 0 \ |
| 2245 | -c "Verifying peer X.509 certificate... ok" \ |
| 2246 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2247 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2248 | -s "key types: Opaque, Opaque" \ |
| 2249 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2250 | -S "error" \ |
| 2251 | -C "error" |
| 2252 | |
| 2253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2254 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2255 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2256 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2257 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2258 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2259 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2260 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2261 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2262 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2263 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2264 | crt_file2=data_files/server4.crt \ |
| 2265 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2266 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2267 | 0 \ |
| 2268 | -c "Verifying peer X.509 certificate... ok" \ |
| 2269 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2270 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2271 | -s "key types: Opaque, Opaque" \ |
| 2272 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2273 | -S "error" \ |
| 2274 | -C "error" |
| 2275 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2276 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2278 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2279 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2280 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2281 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2282 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2283 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2284 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2285 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2286 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2287 | 0 \ |
| 2288 | -c "key type: Opaque" \ |
| 2289 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2290 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2291 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2292 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2293 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2294 | -S "error" \ |
| 2295 | -C "error" |
| 2296 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2297 | # Test using a RSA opaque private key for client/server authentication |
| 2298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2299 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2300 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2301 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2302 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2303 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2304 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2305 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2306 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2307 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2308 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2309 | 0 \ |
| 2310 | -c "key type: Opaque" \ |
| 2311 | -c "Verifying peer X.509 certificate... ok" \ |
| 2312 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2313 | -s "key types: Opaque, none" \ |
| 2314 | -s "Verifying peer X.509 certificate... ok" \ |
| 2315 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2316 | -S "error" \ |
| 2317 | -C "error" |
| 2318 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2320 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2321 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2322 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2323 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2324 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2325 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2326 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2327 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2328 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2329 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2330 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2331 | 0 \ |
| 2332 | -c "key type: Opaque" \ |
| 2333 | -c "Verifying peer X.509 certificate... ok" \ |
| 2334 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2335 | -s "key types: Opaque, none" \ |
| 2336 | -s "Verifying peer X.509 certificate... ok" \ |
| 2337 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2338 | -S "error" \ |
| 2339 | -C "error" |
| 2340 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2341 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2342 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2343 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2344 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2345 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2346 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2347 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2348 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2349 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2350 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2351 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2352 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2353 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2354 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2355 | run_test_psa_force_curve "secp521r1" |
| 2356 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2357 | run_test_psa_force_curve "brainpoolP512r1" |
| 2358 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2359 | run_test_psa_force_curve "secp384r1" |
| 2360 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2361 | run_test_psa_force_curve "brainpoolP384r1" |
| 2362 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2363 | run_test_psa_force_curve "secp256r1" |
| 2364 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2365 | run_test_psa_force_curve "secp256k1" |
| 2366 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2367 | run_test_psa_force_curve "brainpoolP256r1" |
| 2368 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2369 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2370 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2371 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2372 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2373 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2374 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2375 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2376 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2377 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2378 | run_test_psa_force_curve "secp192r1" |
| 2379 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2380 | run_test_psa_force_curve "secp192k1" |
| 2381 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2382 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2384 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2385 | run_test "ServerHello contains gmt_unix_time" \ |
| 2386 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2387 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2388 | 0 \ |
| 2389 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2390 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2391 | |
| 2392 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2394 | run_test "Unique IV in GCM" \ |
| 2395 | "$P_SRV exchanges=20 debug_level=4" \ |
| 2396 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2397 | 0 \ |
| 2398 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2399 | -U "IV used" |
| 2400 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2401 | # Test for correctness of sent single supported algorithm |
| 2402 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2404 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2405 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2407 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2408 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2409 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2410 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2411 | "$P_CLI sig_algs=ecdsa_secp256r1_sha256 debug_level=3" \ |
| 2412 | 0 \ |
| 2413 | -c "Supported Signature Algorithm found: 04 03" |
| 2414 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2416 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2417 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2418 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2419 | requires_hash_alg SHA_256 |
| 2420 | run_test "Single supported algorithm sending: openssl client" \ |
| 2421 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2422 | "$O_CLI -cert data_files/server6.crt \ |
| 2423 | -key data_files/server6.key" \ |
| 2424 | 0 |
| 2425 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2426 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2428 | run_test "Configuration-specific CRT verification callback" \ |
| 2429 | "$P_SRV debug_level=3" \ |
| 2430 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 2431 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2432 | -S "error" \ |
| 2433 | -c "Verify requested for " \ |
| 2434 | -c "Use configuration-specific verification callback" \ |
| 2435 | -C "Use context-specific verification callback" \ |
| 2436 | -C "error" |
| 2437 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2439 | run_test "Context-specific CRT verification callback" \ |
| 2440 | "$P_SRV debug_level=3" \ |
| 2441 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 2442 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2443 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2444 | -c "Verify requested for " \ |
| 2445 | -c "Use context-specific verification callback" \ |
| 2446 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2447 | -C "error" |
| 2448 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2449 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2451 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2452 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2453 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2454 | 1 \ |
| 2455 | -c "The certificate is signed with an unacceptable hash" |
| 2456 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2458 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2459 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2460 | "$P_CLI allow_sha1=1" \ |
| 2461 | 0 |
| 2462 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2464 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2465 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2466 | "$P_CLI allow_sha1=0" \ |
| 2467 | 0 |
| 2468 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2470 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2471 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2472 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2473 | 1 \ |
| 2474 | -s "The certificate is signed with an unacceptable hash" |
| 2475 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2477 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 2478 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2479 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2480 | 0 |
| 2481 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2483 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2484 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2485 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2486 | 0 |
| 2487 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2488 | # Dummy TLS 1.3 test |
| 2489 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2490 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2493 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2494 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2495 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2496 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2497 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2498 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2499 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2502 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2503 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2504 | 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] | 2505 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2506 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2507 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2508 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2511 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2512 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2513 | 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] | 2514 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2515 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2516 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2517 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2520 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2521 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2522 | run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2523 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2524 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 2525 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2526 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2529 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2530 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2531 | run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2532 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2533 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2534 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2535 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2539 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2540 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2541 | "$P_SRV tls13_kex_modes=all" \ |
| 2542 | "$P_CLI tls13_kex_modes=all" \ |
| 2543 | 0 |
| 2544 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2545 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2547 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2548 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2549 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2550 | 0 \ |
| 2551 | -c "next record in same datagram" \ |
| 2552 | -s "next record in same datagram" |
| 2553 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2555 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2556 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2557 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2558 | 0 \ |
| 2559 | -s "next record in same datagram" \ |
| 2560 | -C "next record in same datagram" |
| 2561 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2563 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2564 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2565 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2566 | 0 \ |
| 2567 | -S "next record in same datagram" \ |
| 2568 | -c "next record in same datagram" |
| 2569 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2571 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2572 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2573 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2574 | 0 \ |
| 2575 | -S "next record in same datagram" \ |
| 2576 | -C "next record in same datagram" |
| 2577 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2578 | # Tests for Context serialization |
| 2579 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2581 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2582 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2583 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2584 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2585 | 0 \ |
| 2586 | -c "Deserializing connection..." \ |
| 2587 | -S "Deserializing connection..." |
| 2588 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2590 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2591 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2592 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2593 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2594 | 0 \ |
| 2595 | -c "Deserializing connection..." \ |
| 2596 | -S "Deserializing connection..." |
| 2597 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2598 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2599 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2600 | run_test "Context serialization, client serializes, GCM" \ |
| 2601 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2602 | "$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] | 2603 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2604 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2605 | -S "Deserializing connection..." |
| 2606 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2608 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2609 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2610 | run_test "Context serialization, client serializes, with CID" \ |
| 2611 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2612 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2613 | 0 \ |
| 2614 | -c "Deserializing connection..." \ |
| 2615 | -S "Deserializing connection..." |
| 2616 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2618 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2619 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2620 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2621 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2622 | 0 \ |
| 2623 | -C "Deserializing connection..." \ |
| 2624 | -s "Deserializing connection..." |
| 2625 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2627 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2628 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2629 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2630 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2631 | 0 \ |
| 2632 | -C "Deserializing connection..." \ |
| 2633 | -s "Deserializing connection..." |
| 2634 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2636 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2637 | run_test "Context serialization, server serializes, GCM" \ |
| 2638 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2639 | "$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] | 2640 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2641 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2642 | -s "Deserializing connection..." |
| 2643 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2645 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2646 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2647 | run_test "Context serialization, server serializes, with CID" \ |
| 2648 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2649 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2650 | 0 \ |
| 2651 | -C "Deserializing connection..." \ |
| 2652 | -s "Deserializing connection..." |
| 2653 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2655 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2656 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2657 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2658 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2659 | 0 \ |
| 2660 | -c "Deserializing connection..." \ |
| 2661 | -s "Deserializing connection..." |
| 2662 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2664 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2665 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2666 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2667 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2668 | 0 \ |
| 2669 | -c "Deserializing connection..." \ |
| 2670 | -s "Deserializing connection..." |
| 2671 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2673 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2674 | run_test "Context serialization, both serialize, GCM" \ |
| 2675 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2676 | "$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] | 2677 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2678 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2679 | -s "Deserializing connection..." |
| 2680 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2682 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2683 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2684 | run_test "Context serialization, both serialize, with CID" \ |
| 2685 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2686 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2687 | 0 \ |
| 2688 | -c "Deserializing connection..." \ |
| 2689 | -s "Deserializing connection..." |
| 2690 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2691 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2692 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2693 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2694 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2695 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2696 | 0 \ |
| 2697 | -c "Deserializing connection..." \ |
| 2698 | -S "Deserializing connection..." |
| 2699 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2701 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2702 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2703 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2704 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2705 | 0 \ |
| 2706 | -c "Deserializing connection..." \ |
| 2707 | -S "Deserializing connection..." |
| 2708 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2710 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2711 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2712 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2713 | "$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] | 2714 | 0 \ |
| 2715 | -c "Deserializing connection..." \ |
| 2716 | -S "Deserializing connection..." |
| 2717 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2719 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2720 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2721 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2722 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2723 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2724 | 0 \ |
| 2725 | -c "Deserializing connection..." \ |
| 2726 | -S "Deserializing connection..." |
| 2727 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2729 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2730 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2731 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2732 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2733 | 0 \ |
| 2734 | -C "Deserializing connection..." \ |
| 2735 | -s "Deserializing connection..." |
| 2736 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2738 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2739 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2740 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2741 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2742 | 0 \ |
| 2743 | -C "Deserializing connection..." \ |
| 2744 | -s "Deserializing connection..." |
| 2745 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2747 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2748 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2749 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2750 | "$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] | 2751 | 0 \ |
| 2752 | -C "Deserializing connection..." \ |
| 2753 | -s "Deserializing connection..." |
| 2754 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2756 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2757 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2758 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2759 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2760 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2761 | 0 \ |
| 2762 | -C "Deserializing connection..." \ |
| 2763 | -s "Deserializing connection..." |
| 2764 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2766 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2767 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2768 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2769 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2770 | 0 \ |
| 2771 | -c "Deserializing connection..." \ |
| 2772 | -s "Deserializing connection..." |
| 2773 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2775 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2776 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2777 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2778 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2779 | 0 \ |
| 2780 | -c "Deserializing connection..." \ |
| 2781 | -s "Deserializing connection..." |
| 2782 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2784 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2785 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2786 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2787 | "$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] | 2788 | 0 \ |
| 2789 | -c "Deserializing connection..." \ |
| 2790 | -s "Deserializing connection..." |
| 2791 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2793 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2794 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2795 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2796 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2797 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2798 | 0 \ |
| 2799 | -c "Deserializing connection..." \ |
| 2800 | -s "Deserializing connection..." |
| 2801 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2804 | run_test "Saving the serialized context to a file" \ |
| 2805 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2806 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2807 | 0 \ |
| 2808 | -s "Save serialized context to a file... ok" \ |
| 2809 | -c "Save serialized context to a file... ok" |
| 2810 | rm -f context_srv.txt |
| 2811 | rm -f context_cli.txt |
| 2812 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2813 | # Tests for DTLS Connection ID extension |
| 2814 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2815 | # So far, the CID API isn't implemented, so we can't |
| 2816 | # grep for output witnessing its use. This needs to be |
| 2817 | # changed once the CID extension is implemented. |
| 2818 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2820 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2821 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2822 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2823 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2824 | 0 \ |
| 2825 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2826 | -s "found CID extension" \ |
| 2827 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2828 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2829 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2830 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2831 | -C "found CID extension" \ |
| 2832 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2833 | -C "Copy CIDs into SSL transform" \ |
| 2834 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2835 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2837 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2838 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2839 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2840 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2841 | 0 \ |
| 2842 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2843 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2844 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2845 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2846 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2847 | -C "found CID extension" \ |
| 2848 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2849 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2850 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2851 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2853 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2854 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2855 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2856 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2857 | 0 \ |
| 2858 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2859 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2860 | -c "client hello, adding CID extension" \ |
| 2861 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2862 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2863 | -s "server hello, adding CID extension" \ |
| 2864 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2865 | -c "Use of CID extension negotiated" \ |
| 2866 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2867 | -c "Copy CIDs into SSL transform" \ |
| 2868 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2869 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2870 | -s "Use of Connection ID has been negotiated" \ |
| 2871 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +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 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2876 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2877 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2878 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2879 | 0 \ |
| 2880 | -c "Enable use of CID extension." \ |
| 2881 | -s "Enable use of CID extension." \ |
| 2882 | -c "client hello, adding CID extension" \ |
| 2883 | -s "found CID extension" \ |
| 2884 | -s "Use of CID extension negotiated" \ |
| 2885 | -s "server hello, adding CID extension" \ |
| 2886 | -c "found CID extension" \ |
| 2887 | -c "Use of CID extension negotiated" \ |
| 2888 | -s "Copy CIDs into SSL transform" \ |
| 2889 | -c "Copy CIDs into SSL transform" \ |
| 2890 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2891 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2892 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2893 | -c "Use of Connection ID has been negotiated" \ |
| 2894 | -c "ignoring unexpected CID" \ |
| 2895 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2896 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2898 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2899 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2900 | -p "$P_PXY mtu=800" \ |
| 2901 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2902 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2903 | 0 \ |
| 2904 | -c "Enable use of CID extension." \ |
| 2905 | -s "Enable use of CID extension." \ |
| 2906 | -c "client hello, adding CID extension" \ |
| 2907 | -s "found CID extension" \ |
| 2908 | -s "Use of CID extension negotiated" \ |
| 2909 | -s "server hello, adding CID extension" \ |
| 2910 | -c "found CID extension" \ |
| 2911 | -c "Use of CID extension negotiated" \ |
| 2912 | -s "Copy CIDs into SSL transform" \ |
| 2913 | -c "Copy CIDs into SSL transform" \ |
| 2914 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2915 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2916 | -s "Use of Connection ID has been negotiated" \ |
| 2917 | -c "Use of Connection ID has been negotiated" |
| 2918 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2920 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2921 | 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] | 2922 | -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] | 2923 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2924 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2925 | 0 \ |
| 2926 | -c "Enable use of CID extension." \ |
| 2927 | -s "Enable use of CID extension." \ |
| 2928 | -c "client hello, adding CID extension" \ |
| 2929 | -s "found CID extension" \ |
| 2930 | -s "Use of CID extension negotiated" \ |
| 2931 | -s "server hello, adding CID extension" \ |
| 2932 | -c "found CID extension" \ |
| 2933 | -c "Use of CID extension negotiated" \ |
| 2934 | -s "Copy CIDs into SSL transform" \ |
| 2935 | -c "Copy CIDs into SSL transform" \ |
| 2936 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2937 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2938 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2939 | -c "Use of Connection ID has been negotiated" \ |
| 2940 | -c "ignoring unexpected CID" \ |
| 2941 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2942 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2944 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2945 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2946 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2947 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2948 | 0 \ |
| 2949 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2950 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2951 | -c "client hello, adding CID extension" \ |
| 2952 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2953 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2954 | -s "server hello, adding CID extension" \ |
| 2955 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2956 | -c "Use of CID extension negotiated" \ |
| 2957 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2958 | -c "Copy CIDs into SSL transform" \ |
| 2959 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2960 | -s "Peer CID (length 0 Bytes):" \ |
| 2961 | -s "Use of Connection ID has been negotiated" \ |
| 2962 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2963 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2965 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2966 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2967 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2968 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2969 | 0 \ |
| 2970 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2971 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2972 | -c "client hello, adding CID extension" \ |
| 2973 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2974 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2975 | -s "server hello, adding CID extension" \ |
| 2976 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2977 | -c "Use of CID extension negotiated" \ |
| 2978 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2979 | -c "Copy CIDs into SSL transform" \ |
| 2980 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2981 | -c "Peer CID (length 0 Bytes):" \ |
| 2982 | -s "Use of Connection ID has been negotiated" \ |
| 2983 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2984 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2986 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2987 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2988 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2989 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2990 | 0 \ |
| 2991 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2992 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2993 | -c "client hello, adding CID extension" \ |
| 2994 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2995 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2996 | -s "server hello, adding CID extension" \ |
| 2997 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2998 | -c "Use of CID extension negotiated" \ |
| 2999 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3000 | -c "Copy CIDs into SSL transform" \ |
| 3001 | -S "Use of Connection ID has been negotiated" \ |
| 3002 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3003 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3005 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3006 | 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] | 3007 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3008 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3009 | 0 \ |
| 3010 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3011 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3012 | -c "client hello, adding CID extension" \ |
| 3013 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3014 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3015 | -s "server hello, adding CID extension" \ |
| 3016 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3017 | -c "Use of CID extension negotiated" \ |
| 3018 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3019 | -c "Copy CIDs into SSL transform" \ |
| 3020 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3021 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3022 | -s "Use of Connection ID has been negotiated" \ |
| 3023 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3024 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3026 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3027 | 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] | 3028 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3029 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3030 | 0 \ |
| 3031 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3032 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3033 | -c "client hello, adding CID extension" \ |
| 3034 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3035 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3036 | -s "server hello, adding CID extension" \ |
| 3037 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3038 | -c "Use of CID extension negotiated" \ |
| 3039 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3040 | -c "Copy CIDs into SSL transform" \ |
| 3041 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3042 | -s "Peer CID (length 0 Bytes):" \ |
| 3043 | -s "Use of Connection ID has been negotiated" \ |
| 3044 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3045 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3047 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3048 | 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] | 3049 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3050 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3051 | 0 \ |
| 3052 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3053 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3054 | -c "client hello, adding CID extension" \ |
| 3055 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3056 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3057 | -s "server hello, adding CID extension" \ |
| 3058 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3059 | -c "Use of CID extension negotiated" \ |
| 3060 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3061 | -c "Copy CIDs into SSL transform" \ |
| 3062 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3063 | -c "Peer CID (length 0 Bytes):" \ |
| 3064 | -s "Use of Connection ID has been negotiated" \ |
| 3065 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3066 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3068 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3069 | 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] | 3070 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3071 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3072 | 0 \ |
| 3073 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3074 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3075 | -c "client hello, adding CID extension" \ |
| 3076 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3077 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3078 | -s "server hello, adding CID extension" \ |
| 3079 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3080 | -c "Use of CID extension negotiated" \ |
| 3081 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3082 | -c "Copy CIDs into SSL transform" \ |
| 3083 | -S "Use of Connection ID has been negotiated" \ |
| 3084 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3087 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3088 | 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] | 3089 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3090 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3091 | 0 \ |
| 3092 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3093 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3094 | -c "client hello, adding CID extension" \ |
| 3095 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3096 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3097 | -s "server hello, adding CID extension" \ |
| 3098 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3099 | -c "Use of CID extension negotiated" \ |
| 3100 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3101 | -c "Copy CIDs into SSL transform" \ |
| 3102 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3103 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3104 | -s "Use of Connection ID has been negotiated" \ |
| 3105 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3106 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3108 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3109 | 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] | 3110 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3111 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3112 | 0 \ |
| 3113 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3114 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3115 | -c "client hello, adding CID extension" \ |
| 3116 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3117 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3118 | -s "server hello, adding CID extension" \ |
| 3119 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3120 | -c "Use of CID extension negotiated" \ |
| 3121 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3122 | -c "Copy CIDs into SSL transform" \ |
| 3123 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3124 | -s "Peer CID (length 0 Bytes):" \ |
| 3125 | -s "Use of Connection ID has been negotiated" \ |
| 3126 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3127 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3129 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3130 | 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] | 3131 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3132 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3133 | 0 \ |
| 3134 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3135 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3136 | -c "client hello, adding CID extension" \ |
| 3137 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3138 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3139 | -s "server hello, adding CID extension" \ |
| 3140 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3141 | -c "Use of CID extension negotiated" \ |
| 3142 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3143 | -c "Copy CIDs into SSL transform" \ |
| 3144 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3145 | -c "Peer CID (length 0 Bytes):" \ |
| 3146 | -s "Use of Connection ID has been negotiated" \ |
| 3147 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3148 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3150 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3151 | 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] | 3152 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3153 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3154 | 0 \ |
| 3155 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3156 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3157 | -c "client hello, adding CID extension" \ |
| 3158 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3159 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3160 | -s "server hello, adding CID extension" \ |
| 3161 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3162 | -c "Use of CID extension negotiated" \ |
| 3163 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3164 | -c "Copy CIDs into SSL transform" \ |
| 3165 | -S "Use of Connection ID has been negotiated" \ |
| 3166 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3167 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3169 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3170 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3171 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3172 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3173 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3174 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3175 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3176 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3177 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3178 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3179 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3180 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3181 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3182 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3183 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3185 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3186 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3187 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3188 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3189 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3190 | 0 \ |
| 3191 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3192 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3193 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3194 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3195 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3196 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3197 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3198 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3199 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3201 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3203 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3204 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3205 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3206 | 0 \ |
| 3207 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3208 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3209 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3210 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3211 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3212 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3213 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3214 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3215 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3217 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3218 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3219 | 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] | 3220 | -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] | 3221 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3222 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3223 | 0 \ |
| 3224 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3225 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3226 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3227 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3228 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3229 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3230 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3231 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3232 | -c "ignoring unexpected CID" \ |
| 3233 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3234 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3235 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3236 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3237 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3238 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3239 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3240 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3241 | 0 \ |
| 3242 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3243 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3244 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3245 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3246 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3247 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3248 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3249 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3250 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3252 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3253 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3254 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3255 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3256 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3257 | 0 \ |
| 3258 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3259 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3260 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3261 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3262 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3263 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3264 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3265 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3266 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3268 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3269 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3270 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3271 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3272 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3273 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3274 | 0 \ |
| 3275 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3276 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3277 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3278 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3279 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3280 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3281 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3282 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3283 | -c "ignoring unexpected CID" \ |
| 3284 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3285 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3287 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3288 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3289 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3290 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3291 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3292 | 0 \ |
| 3293 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3294 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3295 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3296 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3297 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3298 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3299 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3301 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3302 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3303 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3304 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3305 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3306 | 0 \ |
| 3307 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3308 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3309 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3310 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3311 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3312 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3313 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3315 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3317 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3318 | -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] | 3319 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3320 | "$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" \ |
| 3321 | 0 \ |
| 3322 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3323 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3324 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3325 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3326 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3327 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3328 | -c "ignoring unexpected CID" \ |
| 3329 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3330 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3333 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3334 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3335 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3336 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3337 | 0 \ |
| 3338 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3339 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3340 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3341 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3342 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3343 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3344 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3345 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3346 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3347 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3349 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3350 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3351 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3352 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3353 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3354 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3355 | 0 \ |
| 3356 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3357 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3358 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3359 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3360 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3361 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3362 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3363 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3364 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3365 | -c "ignoring unexpected CID" \ |
| 3366 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3367 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3369 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3370 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3371 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3372 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3373 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3374 | 0 \ |
| 3375 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3376 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3377 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3378 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3379 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3380 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3381 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3382 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3383 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3384 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3387 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3388 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3389 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3390 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3391 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3392 | 0 \ |
| 3393 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3394 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3395 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3396 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3397 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3398 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3399 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3400 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3401 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3402 | -c "ignoring unexpected CID" \ |
| 3403 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3404 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3405 | # 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] | 3406 | # tests check that the buffer contents are reallocated when the message is |
| 3407 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3410 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3411 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3412 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3413 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3414 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3415 | 0 \ |
| 3416 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3417 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3418 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3419 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3420 | -s "Reallocating in_buf" \ |
| 3421 | -s "Reallocating out_buf" |
| 3422 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3424 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3425 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3426 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3427 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3428 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3429 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3430 | 0 \ |
| 3431 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3432 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3433 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3434 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3435 | -s "Reallocating in_buf" \ |
| 3436 | -s "Reallocating out_buf" |
| 3437 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3438 | # Tests for Encrypt-then-MAC extension |
| 3439 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3441 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3442 | "$P_SRV debug_level=3 \ |
| 3443 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3444 | "$P_CLI debug_level=3" \ |
| 3445 | 0 \ |
| 3446 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3447 | -s "found encrypt then mac extension" \ |
| 3448 | -s "server hello, adding encrypt then mac extension" \ |
| 3449 | -c "found encrypt_then_mac extension" \ |
| 3450 | -c "using encrypt then mac" \ |
| 3451 | -s "using encrypt then mac" |
| 3452 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3454 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3455 | "$P_SRV debug_level=3 etm=0 \ |
| 3456 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3457 | "$P_CLI debug_level=3 etm=1" \ |
| 3458 | 0 \ |
| 3459 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3460 | -s "found encrypt then mac extension" \ |
| 3461 | -S "server hello, adding encrypt then mac extension" \ |
| 3462 | -C "found encrypt_then_mac extension" \ |
| 3463 | -C "using encrypt then mac" \ |
| 3464 | -S "using encrypt then mac" |
| 3465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3467 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3468 | "$P_SRV debug_level=3 etm=1 \ |
| 3469 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3470 | "$P_CLI debug_level=3 etm=1" \ |
| 3471 | 0 \ |
| 3472 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3473 | -s "found encrypt then mac extension" \ |
| 3474 | -S "server hello, adding encrypt then mac extension" \ |
| 3475 | -C "found encrypt_then_mac extension" \ |
| 3476 | -C "using encrypt then mac" \ |
| 3477 | -S "using encrypt then mac" |
| 3478 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3480 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3481 | "$P_SRV debug_level=3 etm=1 \ |
| 3482 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3483 | "$P_CLI debug_level=3 etm=0" \ |
| 3484 | 0 \ |
| 3485 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3486 | -S "found encrypt then mac extension" \ |
| 3487 | -S "server hello, adding encrypt then mac extension" \ |
| 3488 | -C "found encrypt_then_mac extension" \ |
| 3489 | -C "using encrypt then mac" \ |
| 3490 | -S "using encrypt then mac" |
| 3491 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3492 | # Tests for Extended Master Secret extension |
| 3493 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3495 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3496 | run_test "Extended Master Secret: default" \ |
| 3497 | "$P_SRV debug_level=3" \ |
| 3498 | "$P_CLI debug_level=3" \ |
| 3499 | 0 \ |
| 3500 | -c "client hello, adding extended_master_secret extension" \ |
| 3501 | -s "found extended master secret extension" \ |
| 3502 | -s "server hello, adding extended master secret extension" \ |
| 3503 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3504 | -c "session hash for extended master secret" \ |
| 3505 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3506 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3508 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3509 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3510 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3511 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3512 | 0 \ |
| 3513 | -c "client hello, adding extended_master_secret extension" \ |
| 3514 | -s "found extended master secret extension" \ |
| 3515 | -S "server hello, adding extended master secret extension" \ |
| 3516 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3517 | -C "session hash for extended master secret" \ |
| 3518 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3519 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3521 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3522 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3523 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3524 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3525 | 0 \ |
| 3526 | -C "client hello, adding extended_master_secret extension" \ |
| 3527 | -S "found extended master secret extension" \ |
| 3528 | -S "server hello, adding extended master secret extension" \ |
| 3529 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3530 | -C "session hash for extended master secret" \ |
| 3531 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3532 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3533 | # Test sending and receiving empty application data records |
| 3534 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3536 | run_test "Encrypt then MAC: empty application data record" \ |
| 3537 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3538 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3539 | 0 \ |
| 3540 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3541 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3542 | -c "0 bytes written in 1 fragments" |
| 3543 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3545 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3546 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3547 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3548 | 0 \ |
| 3549 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3550 | -c "0 bytes written in 1 fragments" |
| 3551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3553 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3554 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3555 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3556 | 0 \ |
| 3557 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3558 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3559 | -c "0 bytes written in 1 fragments" |
| 3560 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3562 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3563 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3564 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3565 | 0 \ |
| 3566 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3567 | -c "0 bytes written in 1 fragments" |
| 3568 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3569 | # Tests for CBC 1/n-1 record splitting |
| 3570 | |
| 3571 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3572 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3573 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3574 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3575 | 0 \ |
| 3576 | -s "Read from client: 123 bytes read" \ |
| 3577 | -S "Read from client: 1 bytes read" \ |
| 3578 | -S "122 bytes read" |
| 3579 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3580 | # Tests for Session Tickets |
| 3581 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3583 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3584 | "$P_SRV debug_level=3 tickets=1" \ |
| 3585 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3586 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3587 | -c "client hello, adding session ticket extension" \ |
| 3588 | -s "found session ticket extension" \ |
| 3589 | -s "server hello, adding session ticket extension" \ |
| 3590 | -c "found session_ticket extension" \ |
| 3591 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3592 | -S "session successfully restored from cache" \ |
| 3593 | -s "session successfully restored from ticket" \ |
| 3594 | -s "a session has been resumed" \ |
| 3595 | -c "a session has been resumed" |
| 3596 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3598 | run_test "Session resume using tickets: manual rotation" \ |
| 3599 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3600 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3601 | 0 \ |
| 3602 | -c "client hello, adding session ticket extension" \ |
| 3603 | -s "found session ticket extension" \ |
| 3604 | -s "server hello, adding session ticket extension" \ |
| 3605 | -c "found session_ticket extension" \ |
| 3606 | -c "parse new session ticket" \ |
| 3607 | -S "session successfully restored from cache" \ |
| 3608 | -s "session successfully restored from ticket" \ |
| 3609 | -s "a session has been resumed" \ |
| 3610 | -c "a session has been resumed" |
| 3611 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3613 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3614 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3615 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3616 | 0 \ |
| 3617 | -c "client hello, adding session ticket extension" \ |
| 3618 | -s "found session ticket extension" \ |
| 3619 | -s "server hello, adding session ticket extension" \ |
| 3620 | -c "found session_ticket extension" \ |
| 3621 | -c "parse new session ticket" \ |
| 3622 | -S "session successfully restored from cache" \ |
| 3623 | -s "session successfully restored from ticket" \ |
| 3624 | -s "a session has been resumed" \ |
| 3625 | -c "a session has been resumed" |
| 3626 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3627 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3628 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3629 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3630 | "$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] | 3631 | 0 \ |
| 3632 | -c "client hello, adding session ticket extension" \ |
| 3633 | -s "found session ticket extension" \ |
| 3634 | -s "server hello, adding session ticket extension" \ |
| 3635 | -c "found session_ticket extension" \ |
| 3636 | -c "parse new session ticket" \ |
| 3637 | -S "session successfully restored from cache" \ |
| 3638 | -S "session successfully restored from ticket" \ |
| 3639 | -S "a session has been resumed" \ |
| 3640 | -C "a session has been resumed" |
| 3641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3643 | run_test "Session resume using tickets: session copy" \ |
| 3644 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3645 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3646 | 0 \ |
| 3647 | -c "client hello, adding session ticket extension" \ |
| 3648 | -s "found session ticket extension" \ |
| 3649 | -s "server hello, adding session ticket extension" \ |
| 3650 | -c "found session_ticket extension" \ |
| 3651 | -c "parse new session ticket" \ |
| 3652 | -S "session successfully restored from cache" \ |
| 3653 | -s "session successfully restored from ticket" \ |
| 3654 | -s "a session has been resumed" \ |
| 3655 | -c "a session has been resumed" |
| 3656 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3658 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3659 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3660 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3661 | 0 \ |
| 3662 | -c "client hello, adding session ticket extension" \ |
| 3663 | -c "found session_ticket extension" \ |
| 3664 | -c "parse new session ticket" \ |
| 3665 | -c "a session has been resumed" |
| 3666 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3668 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3669 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3670 | "( $O_CLI -sess_out $SESSION; \ |
| 3671 | $O_CLI -sess_in $SESSION; \ |
| 3672 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3673 | 0 \ |
| 3674 | -s "found session ticket extension" \ |
| 3675 | -s "server hello, adding session ticket extension" \ |
| 3676 | -S "session successfully restored from cache" \ |
| 3677 | -s "session successfully restored from ticket" \ |
| 3678 | -s "a session has been resumed" |
| 3679 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3681 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3682 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3683 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3684 | 0 \ |
| 3685 | -c "client hello, adding session ticket extension" \ |
| 3686 | -s "found session ticket extension" \ |
| 3687 | -s "server hello, adding session ticket extension" \ |
| 3688 | -c "found session_ticket extension" \ |
| 3689 | -c "parse new session ticket" \ |
| 3690 | -S "session successfully restored from cache" \ |
| 3691 | -s "session successfully restored from ticket" \ |
| 3692 | -s "a session has been resumed" \ |
| 3693 | -c "a session has been resumed" |
| 3694 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3696 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3697 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3698 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3699 | 0 \ |
| 3700 | -c "client hello, adding session ticket extension" \ |
| 3701 | -s "found session ticket extension" \ |
| 3702 | -s "server hello, adding session ticket extension" \ |
| 3703 | -c "found session_ticket extension" \ |
| 3704 | -c "parse new session ticket" \ |
| 3705 | -S "session successfully restored from cache" \ |
| 3706 | -s "session successfully restored from ticket" \ |
| 3707 | -s "a session has been resumed" \ |
| 3708 | -c "a session has been resumed" |
| 3709 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3711 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3712 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3713 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3714 | 0 \ |
| 3715 | -c "client hello, adding session ticket extension" \ |
| 3716 | -s "found session ticket extension" \ |
| 3717 | -s "server hello, adding session ticket extension" \ |
| 3718 | -c "found session_ticket extension" \ |
| 3719 | -c "parse new session ticket" \ |
| 3720 | -S "session successfully restored from cache" \ |
| 3721 | -s "session successfully restored from ticket" \ |
| 3722 | -s "a session has been resumed" \ |
| 3723 | -c "a session has been resumed" |
| 3724 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3726 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3727 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3728 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3729 | 0 \ |
| 3730 | -c "client hello, adding session ticket extension" \ |
| 3731 | -s "found session ticket extension" \ |
| 3732 | -s "server hello, adding session ticket extension" \ |
| 3733 | -c "found session_ticket extension" \ |
| 3734 | -c "parse new session ticket" \ |
| 3735 | -S "session successfully restored from cache" \ |
| 3736 | -s "session successfully restored from ticket" \ |
| 3737 | -s "a session has been resumed" \ |
| 3738 | -c "a session has been resumed" |
| 3739 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3741 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3742 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3743 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3744 | 0 \ |
| 3745 | -c "client hello, adding session ticket extension" \ |
| 3746 | -s "found session ticket extension" \ |
| 3747 | -s "server hello, adding session ticket extension" \ |
| 3748 | -c "found session_ticket extension" \ |
| 3749 | -c "parse new session ticket" \ |
| 3750 | -S "session successfully restored from cache" \ |
| 3751 | -s "session successfully restored from ticket" \ |
| 3752 | -s "a session has been resumed" \ |
| 3753 | -c "a session has been resumed" |
| 3754 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3756 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3757 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3758 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3759 | 0 \ |
| 3760 | -c "client hello, adding session ticket extension" \ |
| 3761 | -s "found session ticket extension" \ |
| 3762 | -s "server hello, adding session ticket extension" \ |
| 3763 | -c "found session_ticket extension" \ |
| 3764 | -c "parse new session ticket" \ |
| 3765 | -S "session successfully restored from cache" \ |
| 3766 | -s "session successfully restored from ticket" \ |
| 3767 | -s "a session has been resumed" \ |
| 3768 | -c "a session has been resumed" |
| 3769 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3771 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3772 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3773 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3774 | 0 \ |
| 3775 | -c "client hello, adding session ticket extension" \ |
| 3776 | -s "found session ticket extension" \ |
| 3777 | -s "server hello, adding session ticket extension" \ |
| 3778 | -c "found session_ticket extension" \ |
| 3779 | -c "parse new session ticket" \ |
| 3780 | -S "session successfully restored from cache" \ |
| 3781 | -s "session successfully restored from ticket" \ |
| 3782 | -s "a session has been resumed" \ |
| 3783 | -c "a session has been resumed" |
| 3784 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3786 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3787 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3788 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3789 | 0 \ |
| 3790 | -c "client hello, adding session ticket extension" \ |
| 3791 | -s "found session ticket extension" \ |
| 3792 | -s "server hello, adding session ticket extension" \ |
| 3793 | -c "found session_ticket extension" \ |
| 3794 | -c "parse new session ticket" \ |
| 3795 | -S "session successfully restored from cache" \ |
| 3796 | -s "session successfully restored from ticket" \ |
| 3797 | -s "a session has been resumed" \ |
| 3798 | -c "a session has been resumed" |
| 3799 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3801 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3802 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3803 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3804 | 0 \ |
| 3805 | -c "client hello, adding session ticket extension" \ |
| 3806 | -s "found session ticket extension" \ |
| 3807 | -s "server hello, adding session ticket extension" \ |
| 3808 | -c "found session_ticket extension" \ |
| 3809 | -c "parse new session ticket" \ |
| 3810 | -S "session successfully restored from cache" \ |
| 3811 | -s "session successfully restored from ticket" \ |
| 3812 | -s "a session has been resumed" \ |
| 3813 | -c "a session has been resumed" |
| 3814 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3816 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3817 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3818 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3819 | 0 \ |
| 3820 | -c "client hello, adding session ticket extension" \ |
| 3821 | -s "found session ticket extension" \ |
| 3822 | -s "server hello, adding session ticket extension" \ |
| 3823 | -c "found session_ticket extension" \ |
| 3824 | -c "parse new session ticket" \ |
| 3825 | -S "session successfully restored from cache" \ |
| 3826 | -s "session successfully restored from ticket" \ |
| 3827 | -s "a session has been resumed" \ |
| 3828 | -c "a session has been resumed" |
| 3829 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3831 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3832 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3833 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3834 | 0 \ |
| 3835 | -c "client hello, adding session ticket extension" \ |
| 3836 | -s "found session ticket extension" \ |
| 3837 | -s "server hello, adding session ticket extension" \ |
| 3838 | -c "found session_ticket extension" \ |
| 3839 | -c "parse new session ticket" \ |
| 3840 | -S "session successfully restored from cache" \ |
| 3841 | -s "session successfully restored from ticket" \ |
| 3842 | -s "a session has been resumed" \ |
| 3843 | -c "a session has been resumed" |
| 3844 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3846 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3847 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3848 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3849 | 0 \ |
| 3850 | -c "client hello, adding session ticket extension" \ |
| 3851 | -s "found session ticket extension" \ |
| 3852 | -s "server hello, adding session ticket extension" \ |
| 3853 | -c "found session_ticket extension" \ |
| 3854 | -c "parse new session ticket" \ |
| 3855 | -S "session successfully restored from cache" \ |
| 3856 | -s "session successfully restored from ticket" \ |
| 3857 | -s "a session has been resumed" \ |
| 3858 | -c "a session has been resumed" |
| 3859 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3861 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3862 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3863 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3864 | 0 \ |
| 3865 | -c "client hello, adding session ticket extension" \ |
| 3866 | -s "found session ticket extension" \ |
| 3867 | -s "server hello, adding session ticket extension" \ |
| 3868 | -c "found session_ticket extension" \ |
| 3869 | -c "parse new session ticket" \ |
| 3870 | -S "session successfully restored from cache" \ |
| 3871 | -s "session successfully restored from ticket" \ |
| 3872 | -s "a session has been resumed" \ |
| 3873 | -c "a session has been resumed" |
| 3874 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3876 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3877 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3878 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3879 | 0 \ |
| 3880 | -c "client hello, adding session ticket extension" \ |
| 3881 | -s "found session ticket extension" \ |
| 3882 | -s "server hello, adding session ticket extension" \ |
| 3883 | -c "found session_ticket extension" \ |
| 3884 | -c "parse new session ticket" \ |
| 3885 | -S "session successfully restored from cache" \ |
| 3886 | -s "session successfully restored from ticket" \ |
| 3887 | -s "a session has been resumed" \ |
| 3888 | -c "a session has been resumed" |
| 3889 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3890 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3891 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3892 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3893 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3894 | 0 \ |
| 3895 | -c "client hello, adding session ticket extension" \ |
| 3896 | -s "found session ticket extension" \ |
| 3897 | -s "server hello, adding session ticket extension" \ |
| 3898 | -c "found session_ticket extension" \ |
| 3899 | -c "parse new session ticket" \ |
| 3900 | -S "session successfully restored from cache" \ |
| 3901 | -s "session successfully restored from ticket" \ |
| 3902 | -s "a session has been resumed" \ |
| 3903 | -c "a session has been resumed" |
| 3904 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3905 | # Tests for Session Tickets with DTLS |
| 3906 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3908 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3909 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3910 | "$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] | 3911 | 0 \ |
| 3912 | -c "client hello, adding session ticket extension" \ |
| 3913 | -s "found session ticket extension" \ |
| 3914 | -s "server hello, adding session ticket extension" \ |
| 3915 | -c "found session_ticket extension" \ |
| 3916 | -c "parse new session ticket" \ |
| 3917 | -S "session successfully restored from cache" \ |
| 3918 | -s "session successfully restored from ticket" \ |
| 3919 | -s "a session has been resumed" \ |
| 3920 | -c "a session has been resumed" |
| 3921 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3923 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3924 | "$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] | 3925 | "$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] | 3926 | 0 \ |
| 3927 | -c "client hello, adding session ticket extension" \ |
| 3928 | -s "found session ticket extension" \ |
| 3929 | -s "server hello, adding session ticket extension" \ |
| 3930 | -c "found session_ticket extension" \ |
| 3931 | -c "parse new session ticket" \ |
| 3932 | -S "session successfully restored from cache" \ |
| 3933 | -s "session successfully restored from ticket" \ |
| 3934 | -s "a session has been resumed" \ |
| 3935 | -c "a session has been resumed" |
| 3936 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3937 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3938 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3939 | "$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] | 3940 | "$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] | 3941 | 0 \ |
| 3942 | -c "client hello, adding session ticket extension" \ |
| 3943 | -s "found session ticket extension" \ |
| 3944 | -s "server hello, adding session ticket extension" \ |
| 3945 | -c "found session_ticket extension" \ |
| 3946 | -c "parse new session ticket" \ |
| 3947 | -S "session successfully restored from cache" \ |
| 3948 | -S "session successfully restored from ticket" \ |
| 3949 | -S "a session has been resumed" \ |
| 3950 | -C "a session has been resumed" |
| 3951 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3953 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3954 | "$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] | 3955 | "$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] | 3956 | 0 \ |
| 3957 | -c "client hello, adding session ticket extension" \ |
| 3958 | -s "found session ticket extension" \ |
| 3959 | -s "server hello, adding session ticket extension" \ |
| 3960 | -c "found session_ticket extension" \ |
| 3961 | -c "parse new session ticket" \ |
| 3962 | -S "session successfully restored from cache" \ |
| 3963 | -s "session successfully restored from ticket" \ |
| 3964 | -s "a session has been resumed" \ |
| 3965 | -c "a session has been resumed" |
| 3966 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3968 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3969 | "$O_SRV -dtls" \ |
| 3970 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3971 | 0 \ |
| 3972 | -c "client hello, adding session ticket extension" \ |
| 3973 | -c "found session_ticket extension" \ |
| 3974 | -c "parse new session ticket" \ |
| 3975 | -c "a session has been resumed" |
| 3976 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3977 | # 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] | 3978 | # 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] | 3979 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3981 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3982 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3983 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3984 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3985 | rm -f $SESSION )" \ |
| 3986 | 0 \ |
| 3987 | -s "found session ticket extension" \ |
| 3988 | -s "server hello, adding session ticket extension" \ |
| 3989 | -S "session successfully restored from cache" \ |
| 3990 | -s "session successfully restored from ticket" \ |
| 3991 | -s "a session has been resumed" |
| 3992 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3993 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3994 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3996 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3997 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3998 | "$P_SRV debug_level=3 tickets=0" \ |
| 3999 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4000 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4001 | -c "client hello, adding session ticket extension" \ |
| 4002 | -s "found session ticket extension" \ |
| 4003 | -S "server hello, adding session ticket extension" \ |
| 4004 | -C "found session_ticket extension" \ |
| 4005 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4006 | -s "session successfully restored from cache" \ |
| 4007 | -S "session successfully restored from ticket" \ |
| 4008 | -s "a session has been resumed" \ |
| 4009 | -c "a session has been resumed" |
| 4010 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4012 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4013 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4014 | "$P_SRV debug_level=3 tickets=1" \ |
| 4015 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4016 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4017 | -C "client hello, adding session ticket extension" \ |
| 4018 | -S "found session ticket extension" \ |
| 4019 | -S "server hello, adding session ticket extension" \ |
| 4020 | -C "found session_ticket extension" \ |
| 4021 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4022 | -s "session successfully restored from cache" \ |
| 4023 | -S "session successfully restored from ticket" \ |
| 4024 | -s "a session has been resumed" \ |
| 4025 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4026 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4028 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4029 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4030 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 4031 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4032 | 0 \ |
| 4033 | -S "session successfully restored from cache" \ |
| 4034 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4035 | -S "a session has been resumed" \ |
| 4036 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4037 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4038 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4039 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4040 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4041 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 4042 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4043 | 0 \ |
| 4044 | -s "session successfully restored from cache" \ |
| 4045 | -S "session successfully restored from ticket" \ |
| 4046 | -s "a session has been resumed" \ |
| 4047 | -c "a session has been resumed" |
| 4048 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4050 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4051 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4052 | "$P_SRV debug_level=3 tickets=0" \ |
| 4053 | "$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] | 4054 | 0 \ |
| 4055 | -s "session successfully restored from cache" \ |
| 4056 | -S "session successfully restored from ticket" \ |
| 4057 | -s "a session has been resumed" \ |
| 4058 | -c "a session has been resumed" |
| 4059 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4061 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4062 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4063 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 4064 | "$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] | 4065 | 0 \ |
| 4066 | -S "session successfully restored from cache" \ |
| 4067 | -S "session successfully restored from ticket" \ |
| 4068 | -S "a session has been resumed" \ |
| 4069 | -C "a session has been resumed" |
| 4070 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4072 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4073 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4074 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 4075 | "$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] | 4076 | 0 \ |
| 4077 | -s "session successfully restored from cache" \ |
| 4078 | -S "session successfully restored from ticket" \ |
| 4079 | -s "a session has been resumed" \ |
| 4080 | -c "a session has been resumed" |
| 4081 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4083 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4084 | run_test "Session resume using cache: session copy" \ |
| 4085 | "$P_SRV debug_level=3 tickets=0" \ |
| 4086 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 4087 | 0 \ |
| 4088 | -s "session successfully restored from cache" \ |
| 4089 | -S "session successfully restored from ticket" \ |
| 4090 | -s "a session has been resumed" \ |
| 4091 | -c "a session has been resumed" |
| 4092 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4094 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4095 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4096 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4097 | "( $O_CLI -sess_out $SESSION; \ |
| 4098 | $O_CLI -sess_in $SESSION; \ |
| 4099 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4100 | 0 \ |
| 4101 | -s "found session ticket extension" \ |
| 4102 | -S "server hello, adding session ticket extension" \ |
| 4103 | -s "session successfully restored from cache" \ |
| 4104 | -S "session successfully restored from ticket" \ |
| 4105 | -s "a session has been resumed" |
| 4106 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4108 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4109 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4110 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4111 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4112 | 0 \ |
| 4113 | -C "found session_ticket extension" \ |
| 4114 | -C "parse new session ticket" \ |
| 4115 | -c "a session has been resumed" |
| 4116 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4117 | # Tests for Session resume and extensions |
| 4118 | |
| 4119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4120 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4121 | run_test "Session resume and connection ID" \ |
| 4122 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4123 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4124 | 0 \ |
| 4125 | -c "Enable use of CID extension." \ |
| 4126 | -s "Enable use of CID extension." \ |
| 4127 | -c "client hello, adding CID extension" \ |
| 4128 | -s "found CID extension" \ |
| 4129 | -s "Use of CID extension negotiated" \ |
| 4130 | -s "server hello, adding CID extension" \ |
| 4131 | -c "found CID extension" \ |
| 4132 | -c "Use of CID extension negotiated" \ |
| 4133 | -s "Copy CIDs into SSL transform" \ |
| 4134 | -c "Copy CIDs into SSL transform" \ |
| 4135 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4136 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4137 | -s "Use of Connection ID has been negotiated" \ |
| 4138 | -c "Use of Connection ID has been negotiated" |
| 4139 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4140 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4141 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4143 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4144 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4145 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4146 | "$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] | 4147 | 0 \ |
| 4148 | -c "client hello, adding session ticket extension" \ |
| 4149 | -s "found session ticket extension" \ |
| 4150 | -S "server hello, adding session ticket extension" \ |
| 4151 | -C "found session_ticket extension" \ |
| 4152 | -C "parse new session ticket" \ |
| 4153 | -s "session successfully restored from cache" \ |
| 4154 | -S "session successfully restored from ticket" \ |
| 4155 | -s "a session has been resumed" \ |
| 4156 | -c "a session has been resumed" |
| 4157 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4158 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4159 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4160 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4161 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4162 | "$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] | 4163 | 0 \ |
| 4164 | -C "client hello, adding session ticket extension" \ |
| 4165 | -S "found session ticket extension" \ |
| 4166 | -S "server hello, adding session ticket extension" \ |
| 4167 | -C "found session_ticket extension" \ |
| 4168 | -C "parse new session ticket" \ |
| 4169 | -s "session successfully restored from cache" \ |
| 4170 | -S "session successfully restored from ticket" \ |
| 4171 | -s "a session has been resumed" \ |
| 4172 | -c "a session has been resumed" |
| 4173 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4175 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4176 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4177 | "$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] | 4178 | "$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] | 4179 | 0 \ |
| 4180 | -S "session successfully restored from cache" \ |
| 4181 | -S "session successfully restored from ticket" \ |
| 4182 | -S "a session has been resumed" \ |
| 4183 | -C "a session has been resumed" |
| 4184 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4186 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4187 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4188 | "$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] | 4189 | "$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] | 4190 | 0 \ |
| 4191 | -s "session successfully restored from cache" \ |
| 4192 | -S "session successfully restored from ticket" \ |
| 4193 | -s "a session has been resumed" \ |
| 4194 | -c "a session has been resumed" |
| 4195 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4196 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4197 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4198 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4199 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4200 | "$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] | 4201 | 0 \ |
| 4202 | -s "session successfully restored from cache" \ |
| 4203 | -S "session successfully restored from ticket" \ |
| 4204 | -s "a session has been resumed" \ |
| 4205 | -c "a session has been resumed" |
| 4206 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4209 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4210 | "$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] | 4211 | "$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] | 4212 | 0 \ |
| 4213 | -S "session successfully restored from cache" \ |
| 4214 | -S "session successfully restored from ticket" \ |
| 4215 | -S "a session has been resumed" \ |
| 4216 | -C "a session has been resumed" |
| 4217 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4219 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4220 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4221 | "$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] | 4222 | "$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] | 4223 | 0 \ |
| 4224 | -s "session successfully restored from cache" \ |
| 4225 | -S "session successfully restored from ticket" \ |
| 4226 | -s "a session has been resumed" \ |
| 4227 | -c "a session has been resumed" |
| 4228 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4230 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4231 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4232 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4233 | "$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] | 4234 | 0 \ |
| 4235 | -s "session successfully restored from cache" \ |
| 4236 | -S "session successfully restored from ticket" \ |
| 4237 | -s "a session has been resumed" \ |
| 4238 | -c "a session has been resumed" |
| 4239 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4240 | # 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] | 4241 | # 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] | 4242 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4244 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4245 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4246 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4247 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4248 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4249 | rm -f $SESSION )" \ |
| 4250 | 0 \ |
| 4251 | -s "found session ticket extension" \ |
| 4252 | -S "server hello, adding session ticket extension" \ |
| 4253 | -s "session successfully restored from cache" \ |
| 4254 | -S "session successfully restored from ticket" \ |
| 4255 | -s "a session has been resumed" |
| 4256 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4258 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4259 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4260 | "$O_SRV -dtls" \ |
| 4261 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4262 | 0 \ |
| 4263 | -C "found session_ticket extension" \ |
| 4264 | -C "parse new session ticket" \ |
| 4265 | -c "a session has been resumed" |
| 4266 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4267 | # Tests for Max Fragment Length extension |
| 4268 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4269 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4271 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4272 | "$P_SRV debug_level=3" \ |
| 4273 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4274 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4275 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4276 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4277 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4278 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4279 | -C "client hello, adding max_fragment_length extension" \ |
| 4280 | -S "found max fragment length extension" \ |
| 4281 | -S "server hello, max_fragment_length extension" \ |
| 4282 | -C "found max_fragment_length extension" |
| 4283 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4284 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4286 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4287 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4288 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4289 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4290 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4291 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4292 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4293 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4294 | -C "client hello, adding max_fragment_length extension" \ |
| 4295 | -S "found max fragment length extension" \ |
| 4296 | -S "server hello, max_fragment_length extension" \ |
| 4297 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4298 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4299 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4300 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4301 | |
| 4302 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4304 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4305 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4306 | "$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] | 4307 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4308 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4309 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4310 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4311 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4312 | -C "client hello, adding max_fragment_length extension" \ |
| 4313 | -S "found max fragment length extension" \ |
| 4314 | -S "server hello, max_fragment_length extension" \ |
| 4315 | -C "found max_fragment_length extension" \ |
| 4316 | -c "fragment larger than.*maximum " |
| 4317 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4318 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4319 | # (session fragment length will be 16384 regardless of mbedtls |
| 4320 | # content length configuration.) |
| 4321 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4322 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4324 | run_test "Max fragment length: disabled, larger message" \ |
| 4325 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4326 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4327 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4328 | -C "Maximum incoming record payload length is 16384" \ |
| 4329 | -C "Maximum outgoing record payload length is 16384" \ |
| 4330 | -S "Maximum incoming record payload length is 16384" \ |
| 4331 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4332 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4333 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4334 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4335 | |
| 4336 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4338 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4339 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4340 | "$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] | 4341 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4342 | -C "Maximum incoming record payload length is 16384" \ |
| 4343 | -C "Maximum outgoing record payload length is 16384" \ |
| 4344 | -S "Maximum incoming record payload length is 16384" \ |
| 4345 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4346 | -c "fragment larger than.*maximum " |
| 4347 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4348 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4349 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4351 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4352 | "$P_SRV debug_level=3" \ |
| 4353 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4354 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4355 | -c "Maximum incoming record payload length is 4096" \ |
| 4356 | -c "Maximum outgoing record payload length is 4096" \ |
| 4357 | -s "Maximum incoming record payload length is 4096" \ |
| 4358 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4359 | -c "client hello, adding max_fragment_length extension" \ |
| 4360 | -s "found max fragment length extension" \ |
| 4361 | -s "server hello, max_fragment_length extension" \ |
| 4362 | -c "found max_fragment_length extension" |
| 4363 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4364 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4365 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4367 | run_test "Max fragment length: client 512, server 1024" \ |
| 4368 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4369 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4370 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4371 | -c "Maximum incoming record payload length is 512" \ |
| 4372 | -c "Maximum outgoing record payload length is 512" \ |
| 4373 | -s "Maximum incoming record payload length is 512" \ |
| 4374 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4375 | -c "client hello, adding max_fragment_length extension" \ |
| 4376 | -s "found max fragment length extension" \ |
| 4377 | -s "server hello, max_fragment_length extension" \ |
| 4378 | -c "found max_fragment_length extension" |
| 4379 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4380 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4381 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4383 | run_test "Max fragment length: client 512, server 2048" \ |
| 4384 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4385 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4386 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4387 | -c "Maximum incoming record payload length is 512" \ |
| 4388 | -c "Maximum outgoing record payload length is 512" \ |
| 4389 | -s "Maximum incoming record payload length is 512" \ |
| 4390 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4391 | -c "client hello, adding max_fragment_length extension" \ |
| 4392 | -s "found max fragment length extension" \ |
| 4393 | -s "server hello, max_fragment_length extension" \ |
| 4394 | -c "found max_fragment_length extension" |
| 4395 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4396 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4397 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4399 | run_test "Max fragment length: client 512, server 4096" \ |
| 4400 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4401 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4402 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4403 | -c "Maximum incoming record payload length is 512" \ |
| 4404 | -c "Maximum outgoing record payload length is 512" \ |
| 4405 | -s "Maximum incoming record payload length is 512" \ |
| 4406 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4407 | -c "client hello, adding max_fragment_length extension" \ |
| 4408 | -s "found max fragment length extension" \ |
| 4409 | -s "server hello, max_fragment_length extension" \ |
| 4410 | -c "found max_fragment_length extension" |
| 4411 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4412 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4413 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4415 | run_test "Max fragment length: client 1024, server 512" \ |
| 4416 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4417 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4418 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4419 | -c "Maximum incoming record payload length is 1024" \ |
| 4420 | -c "Maximum outgoing record payload length is 1024" \ |
| 4421 | -s "Maximum incoming record payload length is 1024" \ |
| 4422 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4423 | -c "client hello, adding max_fragment_length extension" \ |
| 4424 | -s "found max fragment length extension" \ |
| 4425 | -s "server hello, max_fragment_length extension" \ |
| 4426 | -c "found max_fragment_length extension" |
| 4427 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4428 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4429 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4431 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4432 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4433 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4434 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4435 | -c "Maximum incoming record payload length is 1024" \ |
| 4436 | -c "Maximum outgoing record payload length is 1024" \ |
| 4437 | -s "Maximum incoming record payload length is 1024" \ |
| 4438 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4439 | -c "client hello, adding max_fragment_length extension" \ |
| 4440 | -s "found max fragment length extension" \ |
| 4441 | -s "server hello, max_fragment_length extension" \ |
| 4442 | -c "found max_fragment_length extension" |
| 4443 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4444 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4445 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4447 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4448 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4449 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4450 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4451 | -c "Maximum incoming record payload length is 1024" \ |
| 4452 | -c "Maximum outgoing record payload length is 1024" \ |
| 4453 | -s "Maximum incoming record payload length is 1024" \ |
| 4454 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4455 | -c "client hello, adding max_fragment_length extension" \ |
| 4456 | -s "found max fragment length extension" \ |
| 4457 | -s "server hello, max_fragment_length extension" \ |
| 4458 | -c "found max_fragment_length extension" |
| 4459 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4460 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4461 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4463 | run_test "Max fragment length: client 2048, server 512" \ |
| 4464 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4465 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4466 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4467 | -c "Maximum incoming record payload length is 2048" \ |
| 4468 | -c "Maximum outgoing record payload length is 2048" \ |
| 4469 | -s "Maximum incoming record payload length is 2048" \ |
| 4470 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4471 | -c "client hello, adding max_fragment_length extension" \ |
| 4472 | -s "found max fragment length extension" \ |
| 4473 | -s "server hello, max_fragment_length extension" \ |
| 4474 | -c "found max_fragment_length extension" |
| 4475 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4476 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4477 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4479 | run_test "Max fragment length: client 2048, server 1024" \ |
| 4480 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4481 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4482 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4483 | -c "Maximum incoming record payload length is 2048" \ |
| 4484 | -c "Maximum outgoing record payload length is 2048" \ |
| 4485 | -s "Maximum incoming record payload length is 2048" \ |
| 4486 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4487 | -c "client hello, adding max_fragment_length extension" \ |
| 4488 | -s "found max fragment length extension" \ |
| 4489 | -s "server hello, max_fragment_length extension" \ |
| 4490 | -c "found max_fragment_length extension" |
| 4491 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4492 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4493 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4495 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4496 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4497 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4498 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4499 | -c "Maximum incoming record payload length is 2048" \ |
| 4500 | -c "Maximum outgoing record payload length is 2048" \ |
| 4501 | -s "Maximum incoming record payload length is 2048" \ |
| 4502 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4503 | -c "client hello, adding max_fragment_length extension" \ |
| 4504 | -s "found max fragment length extension" \ |
| 4505 | -s "server hello, max_fragment_length extension" \ |
| 4506 | -c "found max_fragment_length extension" |
| 4507 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4508 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4509 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4511 | run_test "Max fragment length: client 4096, server 512" \ |
| 4512 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4513 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4514 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4515 | -c "Maximum incoming record payload length is 4096" \ |
| 4516 | -c "Maximum outgoing record payload length is 4096" \ |
| 4517 | -s "Maximum incoming record payload length is 4096" \ |
| 4518 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4519 | -c "client hello, adding max_fragment_length extension" \ |
| 4520 | -s "found max fragment length extension" \ |
| 4521 | -s "server hello, max_fragment_length extension" \ |
| 4522 | -c "found max_fragment_length extension" |
| 4523 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4524 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4525 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4527 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4528 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4529 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4530 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4531 | -c "Maximum incoming record payload length is 4096" \ |
| 4532 | -c "Maximum outgoing record payload length is 4096" \ |
| 4533 | -s "Maximum incoming record payload length is 4096" \ |
| 4534 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4535 | -c "client hello, adding max_fragment_length extension" \ |
| 4536 | -s "found max fragment length extension" \ |
| 4537 | -s "server hello, max_fragment_length extension" \ |
| 4538 | -c "found max_fragment_length extension" |
| 4539 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4540 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4541 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4543 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4544 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4545 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4546 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4547 | -c "Maximum incoming record payload length is 4096" \ |
| 4548 | -c "Maximum outgoing record payload length is 4096" \ |
| 4549 | -s "Maximum incoming record payload length is 4096" \ |
| 4550 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4551 | -c "client hello, adding max_fragment_length extension" \ |
| 4552 | -s "found max fragment length extension" \ |
| 4553 | -s "server hello, max_fragment_length extension" \ |
| 4554 | -c "found max_fragment_length extension" |
| 4555 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4556 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4557 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4559 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4560 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4561 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4562 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4563 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4564 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4565 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4566 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4567 | -C "client hello, adding max_fragment_length extension" \ |
| 4568 | -S "found max fragment length extension" \ |
| 4569 | -S "server hello, max_fragment_length extension" \ |
| 4570 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4571 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4572 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4573 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4574 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4575 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4576 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4577 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4578 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4579 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4580 | -c "Maximum incoming record payload length is 4096" \ |
| 4581 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4582 | -c "client hello, adding max_fragment_length extension" \ |
| 4583 | -c "found max_fragment_length extension" |
| 4584 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4585 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4586 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4588 | run_test "Max fragment length: client, message just fits" \ |
| 4589 | "$P_SRV debug_level=3" \ |
| 4590 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4591 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4592 | -c "Maximum incoming record payload length is 2048" \ |
| 4593 | -c "Maximum outgoing record payload length is 2048" \ |
| 4594 | -s "Maximum incoming record payload length is 2048" \ |
| 4595 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4596 | -c "client hello, adding max_fragment_length extension" \ |
| 4597 | -s "found max fragment length extension" \ |
| 4598 | -s "server hello, max_fragment_length extension" \ |
| 4599 | -c "found max_fragment_length extension" \ |
| 4600 | -c "2048 bytes written in 1 fragments" \ |
| 4601 | -s "2048 bytes read" |
| 4602 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4603 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4604 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4606 | run_test "Max fragment length: client, larger message" \ |
| 4607 | "$P_SRV debug_level=3" \ |
| 4608 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4609 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4610 | -c "Maximum incoming record payload length is 2048" \ |
| 4611 | -c "Maximum outgoing record payload length is 2048" \ |
| 4612 | -s "Maximum incoming record payload length is 2048" \ |
| 4613 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4614 | -c "client hello, adding max_fragment_length extension" \ |
| 4615 | -s "found max fragment length extension" \ |
| 4616 | -s "server hello, max_fragment_length extension" \ |
| 4617 | -c "found max_fragment_length extension" \ |
| 4618 | -c "2345 bytes written in 2 fragments" \ |
| 4619 | -s "2048 bytes read" \ |
| 4620 | -s "297 bytes read" |
| 4621 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4622 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4623 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4625 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4626 | "$P_SRV debug_level=3 dtls=1" \ |
| 4627 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4628 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4629 | -c "Maximum incoming record payload length is 2048" \ |
| 4630 | -c "Maximum outgoing record payload length is 2048" \ |
| 4631 | -s "Maximum incoming record payload length is 2048" \ |
| 4632 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4633 | -c "client hello, adding max_fragment_length extension" \ |
| 4634 | -s "found max fragment length extension" \ |
| 4635 | -s "server hello, max_fragment_length extension" \ |
| 4636 | -c "found max_fragment_length extension" \ |
| 4637 | -c "fragment larger than.*maximum" |
| 4638 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4639 | # Tests for renegotiation |
| 4640 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4641 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4643 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4644 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4645 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4646 | 0 \ |
| 4647 | -C "client hello, adding renegotiation extension" \ |
| 4648 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4649 | -S "found renegotiation extension" \ |
| 4650 | -s "server hello, secure renegotiation extension" \ |
| 4651 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4652 | -C "=> renegotiate" \ |
| 4653 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4654 | -S "write hello request" |
| 4655 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4656 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4658 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4659 | "$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] | 4660 | "$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] | 4661 | 0 \ |
| 4662 | -c "client hello, adding renegotiation extension" \ |
| 4663 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4664 | -s "found renegotiation extension" \ |
| 4665 | -s "server hello, secure renegotiation extension" \ |
| 4666 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4667 | -c "=> renegotiate" \ |
| 4668 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4669 | -S "write hello request" |
| 4670 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4671 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4673 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4674 | "$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] | 4675 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4676 | 0 \ |
| 4677 | -c "client hello, adding renegotiation extension" \ |
| 4678 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4679 | -s "found renegotiation extension" \ |
| 4680 | -s "server hello, secure renegotiation extension" \ |
| 4681 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4682 | -c "=> renegotiate" \ |
| 4683 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4684 | -s "write hello request" |
| 4685 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4686 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4687 | # 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] | 4688 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4689 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4691 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4692 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4693 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4694 | 0 \ |
| 4695 | -c "client hello, adding renegotiation extension" \ |
| 4696 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4697 | -s "found renegotiation extension" \ |
| 4698 | -s "server hello, secure renegotiation extension" \ |
| 4699 | -c "found renegotiation extension" \ |
| 4700 | -c "=> renegotiate" \ |
| 4701 | -s "=> renegotiate" \ |
| 4702 | -S "write hello request" \ |
| 4703 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4704 | |
| 4705 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4706 | # 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] | 4707 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4710 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4711 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4712 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4713 | 0 \ |
| 4714 | -c "client hello, adding renegotiation extension" \ |
| 4715 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4716 | -s "found renegotiation extension" \ |
| 4717 | -s "server hello, secure renegotiation extension" \ |
| 4718 | -c "found renegotiation extension" \ |
| 4719 | -c "=> renegotiate" \ |
| 4720 | -s "=> renegotiate" \ |
| 4721 | -s "write hello request" \ |
| 4722 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4723 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4724 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4726 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4727 | "$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] | 4728 | "$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] | 4729 | 0 \ |
| 4730 | -c "client hello, adding renegotiation extension" \ |
| 4731 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4732 | -s "found renegotiation extension" \ |
| 4733 | -s "server hello, secure renegotiation extension" \ |
| 4734 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4735 | -c "=> renegotiate" \ |
| 4736 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4737 | -s "write hello request" |
| 4738 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4740 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4741 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4743 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4744 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4745 | "$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" \ |
| 4746 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4747 | -c "Maximum incoming record payload length is 2048" \ |
| 4748 | -c "Maximum outgoing record payload length is 2048" \ |
| 4749 | -s "Maximum incoming record payload length is 2048" \ |
| 4750 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4751 | -c "client hello, adding max_fragment_length extension" \ |
| 4752 | -s "found max fragment length extension" \ |
| 4753 | -s "server hello, max_fragment_length extension" \ |
| 4754 | -c "found max_fragment_length extension" \ |
| 4755 | -c "client hello, adding renegotiation extension" \ |
| 4756 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4757 | -s "found renegotiation extension" \ |
| 4758 | -s "server hello, secure renegotiation extension" \ |
| 4759 | -c "found renegotiation extension" \ |
| 4760 | -c "=> renegotiate" \ |
| 4761 | -s "=> renegotiate" \ |
| 4762 | -s "write hello request" |
| 4763 | |
| 4764 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4766 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4767 | "$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] | 4768 | "$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] | 4769 | 1 \ |
| 4770 | -c "client hello, adding renegotiation extension" \ |
| 4771 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4772 | -S "found renegotiation extension" \ |
| 4773 | -s "server hello, secure renegotiation extension" \ |
| 4774 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4775 | -c "=> renegotiate" \ |
| 4776 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4777 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4778 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4779 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4780 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4781 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4783 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4784 | "$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] | 4785 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4786 | 0 \ |
| 4787 | -C "client hello, adding renegotiation extension" \ |
| 4788 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4789 | -S "found renegotiation extension" \ |
| 4790 | -s "server hello, secure renegotiation extension" \ |
| 4791 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4792 | -C "=> renegotiate" \ |
| 4793 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4794 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4795 | -S "SSL - An unexpected message was received from our peer" \ |
| 4796 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4797 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4798 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4800 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4801 | "$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] | 4802 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4803 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4804 | 0 \ |
| 4805 | -C "client hello, adding renegotiation extension" \ |
| 4806 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4807 | -S "found renegotiation extension" \ |
| 4808 | -s "server hello, secure renegotiation extension" \ |
| 4809 | -c "found renegotiation extension" \ |
| 4810 | -C "=> renegotiate" \ |
| 4811 | -S "=> renegotiate" \ |
| 4812 | -s "write hello request" \ |
| 4813 | -S "SSL - An unexpected message was received from our peer" \ |
| 4814 | -S "failed" |
| 4815 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4816 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4817 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4819 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4820 | "$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] | 4821 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4822 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4823 | 0 \ |
| 4824 | -C "client hello, adding renegotiation extension" \ |
| 4825 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4826 | -S "found renegotiation extension" \ |
| 4827 | -s "server hello, secure renegotiation extension" \ |
| 4828 | -c "found renegotiation extension" \ |
| 4829 | -C "=> renegotiate" \ |
| 4830 | -S "=> renegotiate" \ |
| 4831 | -s "write hello request" \ |
| 4832 | -S "SSL - An unexpected message was received from our peer" \ |
| 4833 | -S "failed" |
| 4834 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4835 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4837 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4838 | "$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] | 4839 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4840 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4841 | 0 \ |
| 4842 | -C "client hello, adding renegotiation extension" \ |
| 4843 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4844 | -S "found renegotiation extension" \ |
| 4845 | -s "server hello, secure renegotiation extension" \ |
| 4846 | -c "found renegotiation extension" \ |
| 4847 | -C "=> renegotiate" \ |
| 4848 | -S "=> renegotiate" \ |
| 4849 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4850 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4851 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4852 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4854 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4855 | "$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] | 4856 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4857 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4858 | 0 \ |
| 4859 | -c "client hello, adding renegotiation extension" \ |
| 4860 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4861 | -s "found renegotiation extension" \ |
| 4862 | -s "server hello, secure renegotiation extension" \ |
| 4863 | -c "found renegotiation extension" \ |
| 4864 | -c "=> renegotiate" \ |
| 4865 | -s "=> renegotiate" \ |
| 4866 | -s "write hello request" \ |
| 4867 | -S "SSL - An unexpected message was received from our peer" \ |
| 4868 | -S "failed" |
| 4869 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4870 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4872 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4873 | "$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] | 4874 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4875 | 0 \ |
| 4876 | -C "client hello, adding renegotiation extension" \ |
| 4877 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4878 | -S "found renegotiation extension" \ |
| 4879 | -s "server hello, secure renegotiation extension" \ |
| 4880 | -c "found renegotiation extension" \ |
| 4881 | -S "record counter limit reached: renegotiate" \ |
| 4882 | -C "=> renegotiate" \ |
| 4883 | -S "=> renegotiate" \ |
| 4884 | -S "write hello request" \ |
| 4885 | -S "SSL - An unexpected message was received from our peer" \ |
| 4886 | -S "failed" |
| 4887 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4888 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4889 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4890 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4891 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4892 | "$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] | 4893 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4894 | 0 \ |
| 4895 | -c "client hello, adding renegotiation extension" \ |
| 4896 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4897 | -s "found renegotiation extension" \ |
| 4898 | -s "server hello, secure renegotiation extension" \ |
| 4899 | -c "found renegotiation extension" \ |
| 4900 | -s "record counter limit reached: renegotiate" \ |
| 4901 | -c "=> renegotiate" \ |
| 4902 | -s "=> renegotiate" \ |
| 4903 | -s "write hello request" \ |
| 4904 | -S "SSL - An unexpected message was received from our peer" \ |
| 4905 | -S "failed" |
| 4906 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4907 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4909 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4910 | "$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] | 4911 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4912 | 0 \ |
| 4913 | -c "client hello, adding renegotiation extension" \ |
| 4914 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4915 | -s "found renegotiation extension" \ |
| 4916 | -s "server hello, secure renegotiation extension" \ |
| 4917 | -c "found renegotiation extension" \ |
| 4918 | -s "record counter limit reached: renegotiate" \ |
| 4919 | -c "=> renegotiate" \ |
| 4920 | -s "=> renegotiate" \ |
| 4921 | -s "write hello request" \ |
| 4922 | -S "SSL - An unexpected message was received from our peer" \ |
| 4923 | -S "failed" |
| 4924 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4925 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4927 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4928 | "$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] | 4929 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4930 | 0 \ |
| 4931 | -C "client hello, adding renegotiation extension" \ |
| 4932 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4933 | -S "found renegotiation extension" \ |
| 4934 | -s "server hello, secure renegotiation extension" \ |
| 4935 | -c "found renegotiation extension" \ |
| 4936 | -S "record counter limit reached: renegotiate" \ |
| 4937 | -C "=> renegotiate" \ |
| 4938 | -S "=> renegotiate" \ |
| 4939 | -S "write hello request" \ |
| 4940 | -S "SSL - An unexpected message was received from our peer" \ |
| 4941 | -S "failed" |
| 4942 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4943 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4945 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4946 | "$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] | 4947 | "$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] | 4948 | 0 \ |
| 4949 | -c "client hello, adding renegotiation extension" \ |
| 4950 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4951 | -s "found renegotiation extension" \ |
| 4952 | -s "server hello, secure renegotiation extension" \ |
| 4953 | -c "found renegotiation extension" \ |
| 4954 | -c "=> renegotiate" \ |
| 4955 | -s "=> renegotiate" \ |
| 4956 | -S "write hello request" |
| 4957 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4958 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4960 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4961 | "$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] | 4962 | "$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] | 4963 | 0 \ |
| 4964 | -c "client hello, adding renegotiation extension" \ |
| 4965 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4966 | -s "found renegotiation extension" \ |
| 4967 | -s "server hello, secure renegotiation extension" \ |
| 4968 | -c "found renegotiation extension" \ |
| 4969 | -c "=> renegotiate" \ |
| 4970 | -s "=> renegotiate" \ |
| 4971 | -s "write hello request" |
| 4972 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4973 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4975 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4976 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4977 | "$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] | 4978 | 0 \ |
| 4979 | -c "client hello, adding renegotiation extension" \ |
| 4980 | -c "found renegotiation extension" \ |
| 4981 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4982 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4983 | -C "error" \ |
| 4984 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4985 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4986 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4987 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4989 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4990 | "$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] | 4991 | "$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] | 4992 | 0 \ |
| 4993 | -c "client hello, adding renegotiation extension" \ |
| 4994 | -c "found renegotiation extension" \ |
| 4995 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4996 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4997 | -C "error" \ |
| 4998 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4999 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5000 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5001 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5003 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5004 | "$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] | 5005 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5006 | 1 \ |
| 5007 | -c "client hello, adding renegotiation extension" \ |
| 5008 | -C "found renegotiation extension" \ |
| 5009 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5010 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5011 | -c "error" \ |
| 5012 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5013 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5014 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5015 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5017 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5018 | "$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] | 5019 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5020 | allow_legacy=0" \ |
| 5021 | 1 \ |
| 5022 | -c "client hello, adding renegotiation extension" \ |
| 5023 | -C "found renegotiation extension" \ |
| 5024 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5025 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5026 | -c "error" \ |
| 5027 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5028 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5029 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5030 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5032 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5033 | "$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] | 5034 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5035 | allow_legacy=1" \ |
| 5036 | 0 \ |
| 5037 | -c "client hello, adding renegotiation extension" \ |
| 5038 | -C "found renegotiation extension" \ |
| 5039 | -c "=> renegotiate" \ |
| 5040 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5041 | -C "error" \ |
| 5042 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5043 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5044 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5046 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5047 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5048 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5049 | 0 \ |
| 5050 | -c "client hello, adding renegotiation extension" \ |
| 5051 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5052 | -s "found renegotiation extension" \ |
| 5053 | -s "server hello, secure renegotiation extension" \ |
| 5054 | -c "found renegotiation extension" \ |
| 5055 | -c "=> renegotiate" \ |
| 5056 | -s "=> renegotiate" \ |
| 5057 | -S "write hello request" |
| 5058 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5059 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5061 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5062 | "$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] | 5063 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5064 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5065 | 0 \ |
| 5066 | -c "client hello, adding renegotiation extension" \ |
| 5067 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5068 | -s "found renegotiation extension" \ |
| 5069 | -s "server hello, secure renegotiation extension" \ |
| 5070 | -c "found renegotiation extension" \ |
| 5071 | -c "=> renegotiate" \ |
| 5072 | -s "=> renegotiate" \ |
| 5073 | -s "write hello request" |
| 5074 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5075 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5077 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5078 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5079 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5080 | 0 \ |
| 5081 | -c "client hello, adding renegotiation extension" \ |
| 5082 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5083 | -s "found renegotiation extension" \ |
| 5084 | -s "server hello, secure renegotiation extension" \ |
| 5085 | -s "record counter limit reached: renegotiate" \ |
| 5086 | -c "=> renegotiate" \ |
| 5087 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5088 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5089 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5090 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5091 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5093 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5094 | "$G_SRV -u --mtu 4096" \ |
| 5095 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5096 | 0 \ |
| 5097 | -c "client hello, adding renegotiation extension" \ |
| 5098 | -c "found renegotiation extension" \ |
| 5099 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5100 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5101 | -C "error" \ |
| 5102 | -s "Extra-header:" |
| 5103 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5104 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5105 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5106 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5108 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5109 | "$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] | 5110 | "$P_CLI debug_level=3" \ |
| 5111 | 0 \ |
| 5112 | -c "found renegotiation extension" \ |
| 5113 | -C "error" \ |
| 5114 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5115 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5116 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5118 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5119 | "$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] | 5120 | "$P_CLI debug_level=3" \ |
| 5121 | 0 \ |
| 5122 | -C "found renegotiation extension" \ |
| 5123 | -C "error" \ |
| 5124 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5125 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5126 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5128 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5129 | "$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] | 5130 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5131 | 1 \ |
| 5132 | -C "found renegotiation extension" \ |
| 5133 | -c "error" \ |
| 5134 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5135 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5136 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5138 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5139 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5140 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5141 | 0 \ |
| 5142 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5143 | -s "server hello, secure renegotiation extension" |
| 5144 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5145 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5147 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5148 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5149 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5150 | 0 \ |
| 5151 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5152 | -S "server hello, secure renegotiation extension" |
| 5153 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5154 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5156 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5157 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5158 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5159 | 1 \ |
| 5160 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5161 | -S "server hello, secure renegotiation extension" |
| 5162 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5163 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5164 | |
| 5165 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5167 | run_test "DER format: no trailing bytes" \ |
| 5168 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5169 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5170 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5171 | 0 \ |
| 5172 | -c "Handshake was completed" \ |
| 5173 | |
| 5174 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5176 | run_test "DER format: with a trailing zero byte" \ |
| 5177 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5178 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5179 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5180 | 0 \ |
| 5181 | -c "Handshake was completed" \ |
| 5182 | |
| 5183 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5185 | run_test "DER format: with a trailing random byte" \ |
| 5186 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5187 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5188 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5189 | 0 \ |
| 5190 | -c "Handshake was completed" \ |
| 5191 | |
| 5192 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5194 | run_test "DER format: with 2 trailing random bytes" \ |
| 5195 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5196 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5197 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5198 | 0 \ |
| 5199 | -c "Handshake was completed" \ |
| 5200 | |
| 5201 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5203 | run_test "DER format: with 4 trailing random bytes" \ |
| 5204 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5205 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5206 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5207 | 0 \ |
| 5208 | -c "Handshake was completed" \ |
| 5209 | |
| 5210 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5212 | run_test "DER format: with 8 trailing random bytes" \ |
| 5213 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5214 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5215 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5216 | 0 \ |
| 5217 | -c "Handshake was completed" \ |
| 5218 | |
| 5219 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5221 | run_test "DER format: with 9 trailing random bytes" \ |
| 5222 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5223 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5224 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5225 | 0 \ |
| 5226 | -c "Handshake was completed" \ |
| 5227 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5228 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5229 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5230 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5231 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5232 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5233 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5234 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5235 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5236 | 1 \ |
| 5237 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5238 | -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] | 5239 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5240 | -c "X509 - Certificate verification failed" |
| 5241 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5243 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5244 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5245 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5246 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5247 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5248 | 0 \ |
| 5249 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5250 | -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] | 5251 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5252 | -C "X509 - Certificate verification failed" |
| 5253 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5255 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5256 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5257 | "$P_SRV" \ |
| 5258 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5259 | 0 \ |
| 5260 | -c "x509_verify_cert() returned" \ |
| 5261 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5262 | -c "! Certificate verification flags"\ |
| 5263 | -C "! mbedtls_ssl_handshake returned" \ |
| 5264 | -C "X509 - Certificate verification failed" \ |
| 5265 | -C "SSL - No CA Chain is set, but required to operate" |
| 5266 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5267 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5268 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5269 | "$P_SRV" \ |
| 5270 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5271 | 1 \ |
| 5272 | -c "x509_verify_cert() returned" \ |
| 5273 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5274 | -c "! Certificate verification flags"\ |
| 5275 | -c "! mbedtls_ssl_handshake returned" \ |
| 5276 | -c "SSL - No CA Chain is set, but required to operate" |
| 5277 | |
| 5278 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5279 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5280 | # the client informs the server about the supported curves - it does, though, in the |
| 5281 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5282 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5283 | # different means to have the server ignoring the client's supported curve list. |
| 5284 | |
| 5285 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5287 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5288 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5289 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5290 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5291 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5292 | 1 \ |
| 5293 | -c "bad certificate (EC key curve)"\ |
| 5294 | -c "! Certificate verification flags"\ |
| 5295 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5296 | |
| 5297 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5299 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5300 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5301 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5302 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5303 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5304 | 1 \ |
| 5305 | -c "bad certificate (EC key curve)"\ |
| 5306 | -c "! Certificate verification flags"\ |
| 5307 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5308 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5310 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5311 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5312 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5313 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5314 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5315 | 0 \ |
| 5316 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5317 | -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] | 5318 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5319 | -C "X509 - Certificate verification failed" |
| 5320 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5322 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5323 | run_test "Authentication: client SHA256, server required" \ |
| 5324 | "$P_SRV auth_mode=required" \ |
| 5325 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5326 | key_file=data_files/server6.key \ |
| 5327 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5328 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5329 | -c "Supported Signature Algorithm found: 04 " \ |
| 5330 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5331 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5333 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5334 | run_test "Authentication: client SHA384, server required" \ |
| 5335 | "$P_SRV auth_mode=required" \ |
| 5336 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5337 | key_file=data_files/server6.key \ |
| 5338 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5339 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5340 | -c "Supported Signature Algorithm found: 04 " \ |
| 5341 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5342 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5343 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5344 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5345 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5346 | "$P_CLI debug_level=3 crt_file=none \ |
| 5347 | key_file=data_files/server5.key" \ |
| 5348 | 1 \ |
| 5349 | -S "skip write certificate request" \ |
| 5350 | -C "skip parse certificate request" \ |
| 5351 | -c "got a certificate request" \ |
| 5352 | -c "= write certificate$" \ |
| 5353 | -C "skip write certificate$" \ |
| 5354 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5355 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5356 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5357 | -s "No client certification received from the client, but required by the authentication mode" |
| 5358 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5359 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5360 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5361 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5362 | "$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] | 5363 | key_file=data_files/server5.key" \ |
| 5364 | 1 \ |
| 5365 | -S "skip write certificate request" \ |
| 5366 | -C "skip parse certificate request" \ |
| 5367 | -c "got a certificate request" \ |
| 5368 | -C "skip write certificate" \ |
| 5369 | -C "skip write certificate verify" \ |
| 5370 | -S "skip parse certificate verify" \ |
| 5371 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5372 | -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] | 5373 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5374 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5375 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5376 | # We don't check that the client receives the alert because it might |
| 5377 | # detect that its write end of the connection is closed and abort |
| 5378 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5379 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5380 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5381 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5382 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5383 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5384 | key_file=data_files/server5.key" \ |
| 5385 | 0 \ |
| 5386 | -S "skip write certificate request" \ |
| 5387 | -C "skip parse certificate request" \ |
| 5388 | -c "got a certificate request" \ |
| 5389 | -C "skip write certificate" \ |
| 5390 | -C "skip write certificate verify" \ |
| 5391 | -S "skip parse certificate verify" \ |
| 5392 | -S "x509_verify_cert() returned" \ |
| 5393 | -S "! The certificate is not correctly signed" \ |
| 5394 | -S "X509 - Certificate verification failed" |
| 5395 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5396 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5397 | run_test "Authentication: client cert not trusted, server required" \ |
| 5398 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5399 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5400 | key_file=data_files/server5.key" \ |
| 5401 | 1 \ |
| 5402 | -S "skip write certificate request" \ |
| 5403 | -C "skip parse certificate request" \ |
| 5404 | -c "got a certificate request" \ |
| 5405 | -C "skip write certificate" \ |
| 5406 | -C "skip write certificate verify" \ |
| 5407 | -S "skip parse certificate verify" \ |
| 5408 | -s "x509_verify_cert() returned" \ |
| 5409 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5410 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5411 | -s "X509 - Certificate verification failed" |
| 5412 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5413 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5414 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5415 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5416 | "$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] | 5417 | key_file=data_files/server5.key" \ |
| 5418 | 0 \ |
| 5419 | -S "skip write certificate request" \ |
| 5420 | -C "skip parse certificate request" \ |
| 5421 | -c "got a certificate request" \ |
| 5422 | -C "skip write certificate" \ |
| 5423 | -C "skip write certificate verify" \ |
| 5424 | -S "skip parse certificate verify" \ |
| 5425 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5426 | -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] | 5427 | -S "! mbedtls_ssl_handshake returned" \ |
| 5428 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5429 | -S "X509 - Certificate verification failed" |
| 5430 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5431 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5432 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5433 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5434 | "$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] | 5435 | key_file=data_files/server5.key" \ |
| 5436 | 0 \ |
| 5437 | -s "skip write certificate request" \ |
| 5438 | -C "skip parse certificate request" \ |
| 5439 | -c "got no certificate request" \ |
| 5440 | -c "skip write certificate" \ |
| 5441 | -c "skip write certificate verify" \ |
| 5442 | -s "skip parse certificate verify" \ |
| 5443 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5444 | -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] | 5445 | -S "! mbedtls_ssl_handshake returned" \ |
| 5446 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5447 | -S "X509 - Certificate verification failed" |
| 5448 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5449 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5450 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5451 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5452 | "$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] | 5453 | 0 \ |
| 5454 | -S "skip write certificate request" \ |
| 5455 | -C "skip parse certificate request" \ |
| 5456 | -c "got a certificate request" \ |
| 5457 | -C "skip write certificate$" \ |
| 5458 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5459 | -c "skip write certificate verify" \ |
| 5460 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5461 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5462 | -S "! mbedtls_ssl_handshake returned" \ |
| 5463 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5464 | -S "X509 - Certificate verification failed" |
| 5465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5467 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5468 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5469 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5470 | "$O_CLI" \ |
| 5471 | 0 \ |
| 5472 | -S "skip write certificate request" \ |
| 5473 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5474 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5475 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5476 | -S "X509 - Certificate verification failed" |
| 5477 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5479 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5480 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5481 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5482 | "$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] | 5483 | 0 \ |
| 5484 | -C "skip parse certificate request" \ |
| 5485 | -c "got a certificate request" \ |
| 5486 | -C "skip write certificate$" \ |
| 5487 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5488 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5489 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5491 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5492 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5493 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5494 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5495 | 1 \ |
| 5496 | -C "skip parse certificate request" \ |
| 5497 | -c "got a certificate request" \ |
| 5498 | -C "skip write certificate$" \ |
| 5499 | -c "skip write certificate verify" \ |
| 5500 | -c "! mbedtls_ssl_handshake returned" |
| 5501 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5502 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5503 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5504 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5505 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5506 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5507 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5508 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5509 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5510 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5511 | # 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] | 5512 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5513 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5514 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5515 | run_test "Authentication: server max_int chain, client default" \ |
| 5516 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5517 | key_file=data_files/dir-maxpath/09.key" \ |
| 5518 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5519 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5520 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5521 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5522 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5523 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5524 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5525 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5526 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5527 | key_file=data_files/dir-maxpath/10.key" \ |
| 5528 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5529 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5530 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5531 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5532 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5533 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5535 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5536 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5537 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5538 | key_file=data_files/dir-maxpath/10.key" \ |
| 5539 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5540 | auth_mode=optional" \ |
| 5541 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5542 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5543 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5544 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5545 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5547 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5548 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5549 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5550 | key_file=data_files/dir-maxpath/10.key" \ |
| 5551 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5552 | auth_mode=none" \ |
| 5553 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5554 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5555 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5556 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5557 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5558 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5559 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5560 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5561 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5562 | key_file=data_files/dir-maxpath/10.key" \ |
| 5563 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5564 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5565 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5566 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5567 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5568 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5569 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5570 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5571 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5572 | key_file=data_files/dir-maxpath/10.key" \ |
| 5573 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5574 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5575 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5576 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5577 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5578 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5579 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5580 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5581 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5582 | key_file=data_files/dir-maxpath/10.key" \ |
| 5583 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5584 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5585 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5586 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5587 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5588 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5589 | run_test "Authentication: client max_int chain, server required" \ |
| 5590 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5591 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5592 | key_file=data_files/dir-maxpath/09.key" \ |
| 5593 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5594 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5595 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5596 | # Tests for CA list in CertificateRequest messages |
| 5597 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5598 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5599 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5600 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5601 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5602 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5603 | key_file=data_files/server6.key" \ |
| 5604 | 0 \ |
| 5605 | -s "requested DN" |
| 5606 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5608 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5609 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5610 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5611 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5612 | key_file=data_files/server6.key" \ |
| 5613 | 0 \ |
| 5614 | -S "requested DN" |
| 5615 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5617 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5618 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5619 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5620 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5621 | key_file=data_files/server5.key" \ |
| 5622 | 1 \ |
| 5623 | -S "requested DN" \ |
| 5624 | -s "x509_verify_cert() returned" \ |
| 5625 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5626 | -s "! mbedtls_ssl_handshake returned" \ |
| 5627 | -c "! mbedtls_ssl_handshake returned" \ |
| 5628 | -s "X509 - Certificate verification failed" |
| 5629 | |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5631 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5632 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5633 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5634 | crt_file2=data_files/server1.crt \ |
| 5635 | key_file2=data_files/server1.key" \ |
| 5636 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5637 | crt_file=data_files/server6.crt \ |
| 5638 | key_file=data_files/server6.key" \ |
| 5639 | 0 \ |
| 5640 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5641 | |
| 5642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5643 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5644 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5645 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5646 | crt_file2=data_files/server2.crt \ |
| 5647 | key_file2=data_files/server2.key" \ |
| 5648 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5649 | crt_file=data_files/server6.crt \ |
| 5650 | key_file=data_files/server6.key" \ |
| 5651 | 0 \ |
| 5652 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5653 | |
| 5654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5655 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5656 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5657 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5658 | crt_file2=data_files/server1.crt \ |
| 5659 | key_file2=data_files/server1.key" \ |
| 5660 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5661 | crt_file=data_files/server6.crt \ |
| 5662 | key_file=data_files/server6.key" \ |
| 5663 | 0 \ |
| 5664 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5665 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5666 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5667 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5668 | |
| 5669 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5671 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5672 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5673 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5674 | key_file=data_files/server5.key" \ |
| 5675 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5676 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5677 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5678 | -c "x509_verify_cert() returned" \ |
| 5679 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5680 | -c "! mbedtls_ssl_handshake returned" \ |
| 5681 | -c "X509 - Certificate verification failed" |
| 5682 | |
| 5683 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5685 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5686 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5687 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5688 | key_file=data_files/server5.key" \ |
| 5689 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5690 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5691 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5692 | -c "x509_verify_cert() returned" \ |
| 5693 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5694 | -C "! mbedtls_ssl_handshake returned" \ |
| 5695 | -C "X509 - Certificate verification failed" |
| 5696 | |
| 5697 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5698 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5699 | # the client informs the server about the supported curves - it does, though, in the |
| 5700 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5701 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5702 | # different means to have the server ignoring the client's supported curve list. |
| 5703 | |
| 5704 | requires_config_enabled MBEDTLS_ECP_C |
| 5705 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5707 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5708 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5709 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5710 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5711 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5712 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5713 | -c "use CA callback for X.509 CRT verification" \ |
| 5714 | -c "bad certificate (EC key curve)" \ |
| 5715 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5716 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5717 | |
| 5718 | requires_config_enabled MBEDTLS_ECP_C |
| 5719 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5721 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5722 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5723 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5724 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5725 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5726 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5727 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5728 | -c "bad certificate (EC key curve)"\ |
| 5729 | -c "! Certificate verification flags"\ |
| 5730 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5731 | |
| 5732 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5734 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5735 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5736 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5737 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5738 | key_file=data_files/server6.key \ |
| 5739 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5740 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5741 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5742 | -c "Supported Signature Algorithm found: 04 " \ |
| 5743 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5744 | |
| 5745 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5747 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5748 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5749 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5750 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5751 | key_file=data_files/server6.key \ |
| 5752 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5753 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5754 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5755 | -c "Supported Signature Algorithm found: 04 " \ |
| 5756 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5757 | |
| 5758 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5760 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5761 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5762 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5763 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5764 | key_file=data_files/server5.key" \ |
| 5765 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5766 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5767 | -S "skip write certificate request" \ |
| 5768 | -C "skip parse certificate request" \ |
| 5769 | -c "got a certificate request" \ |
| 5770 | -C "skip write certificate" \ |
| 5771 | -C "skip write certificate verify" \ |
| 5772 | -S "skip parse certificate verify" \ |
| 5773 | -s "x509_verify_cert() returned" \ |
| 5774 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5775 | -s "! mbedtls_ssl_handshake returned" \ |
| 5776 | -s "send alert level=2 message=48" \ |
| 5777 | -c "! mbedtls_ssl_handshake returned" \ |
| 5778 | -s "X509 - Certificate verification failed" |
| 5779 | # We don't check that the client receives the alert because it might |
| 5780 | # detect that its write end of the connection is closed and abort |
| 5781 | # before reading the alert message. |
| 5782 | |
| 5783 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5785 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5786 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5787 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5788 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5789 | key_file=data_files/server5.key" \ |
| 5790 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5791 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5792 | -S "skip write certificate request" \ |
| 5793 | -C "skip parse certificate request" \ |
| 5794 | -c "got a certificate request" \ |
| 5795 | -C "skip write certificate" \ |
| 5796 | -C "skip write certificate verify" \ |
| 5797 | -S "skip parse certificate verify" \ |
| 5798 | -s "x509_verify_cert() returned" \ |
| 5799 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5800 | -s "! mbedtls_ssl_handshake returned" \ |
| 5801 | -c "! mbedtls_ssl_handshake returned" \ |
| 5802 | -s "X509 - Certificate verification failed" |
| 5803 | |
| 5804 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5806 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5807 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5808 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5809 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5810 | key_file=data_files/server5.key" \ |
| 5811 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5812 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5813 | -S "skip write certificate request" \ |
| 5814 | -C "skip parse certificate request" \ |
| 5815 | -c "got a certificate request" \ |
| 5816 | -C "skip write certificate" \ |
| 5817 | -C "skip write certificate verify" \ |
| 5818 | -S "skip parse certificate verify" \ |
| 5819 | -s "x509_verify_cert() returned" \ |
| 5820 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5821 | -S "! mbedtls_ssl_handshake returned" \ |
| 5822 | -C "! mbedtls_ssl_handshake returned" \ |
| 5823 | -S "X509 - Certificate verification failed" |
| 5824 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5825 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5826 | requires_full_size_output_buffer |
| 5827 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5829 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5830 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5831 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5832 | key_file=data_files/dir-maxpath/09.key" \ |
| 5833 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5834 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5835 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5836 | -C "X509 - A fatal error occurred" |
| 5837 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5838 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5839 | requires_full_size_output_buffer |
| 5840 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5842 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5843 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5844 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5845 | key_file=data_files/dir-maxpath/10.key" \ |
| 5846 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5847 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5848 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5849 | -c "X509 - A fatal error occurred" |
| 5850 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5851 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5852 | requires_full_size_output_buffer |
| 5853 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5855 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5856 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5857 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5858 | key_file=data_files/dir-maxpath/10.key" \ |
| 5859 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5860 | debug_level=3 auth_mode=optional" \ |
| 5861 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5862 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5863 | -c "X509 - A fatal error occurred" |
| 5864 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5865 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5866 | requires_full_size_output_buffer |
| 5867 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5869 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5870 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5871 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5872 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5873 | key_file=data_files/dir-maxpath/10.key" \ |
| 5874 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5875 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5876 | -s "X509 - A fatal error occurred" |
| 5877 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5878 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5879 | requires_full_size_output_buffer |
| 5880 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5882 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5883 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5884 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5885 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5886 | key_file=data_files/dir-maxpath/10.key" \ |
| 5887 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5888 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5889 | -s "X509 - A fatal error occurred" |
| 5890 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5891 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5892 | requires_full_size_output_buffer |
| 5893 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5895 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5896 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5897 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5898 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5899 | key_file=data_files/dir-maxpath/09.key" \ |
| 5900 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5901 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5902 | -S "X509 - A fatal error occurred" |
| 5903 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5904 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5905 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5906 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5907 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5908 | "$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] | 5909 | key_file=data_files/server5.key \ |
| 5910 | crt_file2=data_files/server5-sha1.crt \ |
| 5911 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5912 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5913 | 0 \ |
| 5914 | -c "signed using.*ECDSA with SHA256" \ |
| 5915 | -C "signed using.*ECDSA with SHA1" |
| 5916 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5917 | # tests for SNI |
| 5918 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5919 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5920 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5921 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5922 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5923 | 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] | 5924 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5925 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5926 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5927 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5928 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5929 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5930 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5931 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5932 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5933 | 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] | 5934 | 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] | 5935 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5936 | 0 \ |
| 5937 | -s "parse ServerName extension" \ |
| 5938 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5939 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5940 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5941 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5942 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5943 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5944 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5945 | 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] | 5946 | 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] | 5947 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5948 | 0 \ |
| 5949 | -s "parse ServerName extension" \ |
| 5950 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5951 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5952 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5953 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5954 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5955 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5956 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5957 | 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] | 5958 | 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] | 5959 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5960 | 1 \ |
| 5961 | -s "parse ServerName extension" \ |
| 5962 | -s "ssl_sni_wrapper() returned" \ |
| 5963 | -s "mbedtls_ssl_handshake returned" \ |
| 5964 | -c "mbedtls_ssl_handshake returned" \ |
| 5965 | -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] | 5966 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5967 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5968 | run_test "SNI: client auth no override: optional" \ |
| 5969 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5970 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5971 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5972 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5973 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5974 | -S "skip write certificate request" \ |
| 5975 | -C "skip parse certificate request" \ |
| 5976 | -c "got a certificate request" \ |
| 5977 | -C "skip write certificate" \ |
| 5978 | -C "skip write certificate verify" \ |
| 5979 | -S "skip parse certificate verify" |
| 5980 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5981 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5982 | run_test "SNI: client auth override: none -> optional" \ |
| 5983 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5984 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5985 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5986 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5987 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5988 | -S "skip write certificate request" \ |
| 5989 | -C "skip parse certificate request" \ |
| 5990 | -c "got a certificate request" \ |
| 5991 | -C "skip write certificate" \ |
| 5992 | -C "skip write certificate verify" \ |
| 5993 | -S "skip parse certificate verify" |
| 5994 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5995 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5996 | run_test "SNI: client auth override: optional -> none" \ |
| 5997 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5998 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5999 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6000 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6001 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6002 | -s "skip write certificate request" \ |
| 6003 | -C "skip parse certificate request" \ |
| 6004 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6005 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6006 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6007 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6008 | run_test "SNI: CA no override" \ |
| 6009 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6010 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6011 | ca_file=data_files/test-ca.crt \ |
| 6012 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6013 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6014 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6015 | 1 \ |
| 6016 | -S "skip write certificate request" \ |
| 6017 | -C "skip parse certificate request" \ |
| 6018 | -c "got a certificate request" \ |
| 6019 | -C "skip write certificate" \ |
| 6020 | -C "skip write certificate verify" \ |
| 6021 | -S "skip parse certificate verify" \ |
| 6022 | -s "x509_verify_cert() returned" \ |
| 6023 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6024 | -S "The certificate has been revoked (is on a CRL)" |
| 6025 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6026 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6027 | run_test "SNI: CA override" \ |
| 6028 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6029 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6030 | ca_file=data_files/test-ca.crt \ |
| 6031 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6032 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6033 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6034 | 0 \ |
| 6035 | -S "skip write certificate request" \ |
| 6036 | -C "skip parse certificate request" \ |
| 6037 | -c "got a certificate request" \ |
| 6038 | -C "skip write certificate" \ |
| 6039 | -C "skip write certificate verify" \ |
| 6040 | -S "skip parse certificate verify" \ |
| 6041 | -S "x509_verify_cert() returned" \ |
| 6042 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6043 | -S "The certificate has been revoked (is on a CRL)" |
| 6044 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6045 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6046 | run_test "SNI: CA override with CRL" \ |
| 6047 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6048 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6049 | ca_file=data_files/test-ca.crt \ |
| 6050 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6051 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6052 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6053 | 1 \ |
| 6054 | -S "skip write certificate request" \ |
| 6055 | -C "skip parse certificate request" \ |
| 6056 | -c "got a certificate request" \ |
| 6057 | -C "skip write certificate" \ |
| 6058 | -C "skip write certificate verify" \ |
| 6059 | -S "skip parse certificate verify" \ |
| 6060 | -s "x509_verify_cert() returned" \ |
| 6061 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6062 | -s "The certificate has been revoked (is on a CRL)" |
| 6063 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6064 | # Tests for SNI and DTLS |
| 6065 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6066 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6068 | run_test "SNI: DTLS, no SNI callback" \ |
| 6069 | "$P_SRV debug_level=3 dtls=1 \ |
| 6070 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6071 | "$P_CLI server_name=localhost dtls=1" \ |
| 6072 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6073 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6074 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6075 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6076 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6078 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6079 | "$P_SRV debug_level=3 dtls=1 \ |
| 6080 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6081 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6082 | "$P_CLI server_name=localhost dtls=1" \ |
| 6083 | 0 \ |
| 6084 | -s "parse ServerName extension" \ |
| 6085 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6086 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6087 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6088 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6090 | run_test "SNI: DTLS, matching cert 2" \ |
| 6091 | "$P_SRV debug_level=3 dtls=1 \ |
| 6092 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6093 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6094 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6095 | 0 \ |
| 6096 | -s "parse ServerName extension" \ |
| 6097 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6098 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6099 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6101 | run_test "SNI: DTLS, no matching cert" \ |
| 6102 | "$P_SRV debug_level=3 dtls=1 \ |
| 6103 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6104 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6105 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6106 | 1 \ |
| 6107 | -s "parse ServerName extension" \ |
| 6108 | -s "ssl_sni_wrapper() returned" \ |
| 6109 | -s "mbedtls_ssl_handshake returned" \ |
| 6110 | -c "mbedtls_ssl_handshake returned" \ |
| 6111 | -c "SSL - A fatal alert message was received from our peer" |
| 6112 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6113 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6114 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6115 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6116 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6117 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6118 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6119 | 0 \ |
| 6120 | -S "skip write certificate request" \ |
| 6121 | -C "skip parse certificate request" \ |
| 6122 | -c "got a certificate request" \ |
| 6123 | -C "skip write certificate" \ |
| 6124 | -C "skip write certificate verify" \ |
| 6125 | -S "skip parse certificate verify" |
| 6126 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6128 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6129 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6130 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6131 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6132 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6133 | 0 \ |
| 6134 | -S "skip write certificate request" \ |
| 6135 | -C "skip parse certificate request" \ |
| 6136 | -c "got a certificate request" \ |
| 6137 | -C "skip write certificate" \ |
| 6138 | -C "skip write certificate verify" \ |
| 6139 | -S "skip parse certificate verify" |
| 6140 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6142 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6143 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6144 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6145 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6146 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6147 | 0 \ |
| 6148 | -s "skip write certificate request" \ |
| 6149 | -C "skip parse certificate request" \ |
| 6150 | -c "got no certificate request" \ |
| 6151 | -c "skip write certificate" \ |
| 6152 | -c "skip write certificate verify" \ |
| 6153 | -s "skip parse certificate verify" |
| 6154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6156 | run_test "SNI: DTLS, CA no override" \ |
| 6157 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6158 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6159 | ca_file=data_files/test-ca.crt \ |
| 6160 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6161 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6162 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6163 | 1 \ |
| 6164 | -S "skip write certificate request" \ |
| 6165 | -C "skip parse certificate request" \ |
| 6166 | -c "got a certificate request" \ |
| 6167 | -C "skip write certificate" \ |
| 6168 | -C "skip write certificate verify" \ |
| 6169 | -S "skip parse certificate verify" \ |
| 6170 | -s "x509_verify_cert() returned" \ |
| 6171 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6172 | -S "The certificate has been revoked (is on a CRL)" |
| 6173 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6175 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6176 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6177 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6178 | ca_file=data_files/test-ca.crt \ |
| 6179 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6180 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6181 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6182 | 0 \ |
| 6183 | -S "skip write certificate request" \ |
| 6184 | -C "skip parse certificate request" \ |
| 6185 | -c "got a certificate request" \ |
| 6186 | -C "skip write certificate" \ |
| 6187 | -C "skip write certificate verify" \ |
| 6188 | -S "skip parse certificate verify" \ |
| 6189 | -S "x509_verify_cert() returned" \ |
| 6190 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6191 | -S "The certificate has been revoked (is on a CRL)" |
| 6192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6194 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6195 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6196 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6197 | ca_file=data_files/test-ca.crt \ |
| 6198 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6199 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6200 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6201 | 1 \ |
| 6202 | -S "skip write certificate request" \ |
| 6203 | -C "skip parse certificate request" \ |
| 6204 | -c "got a certificate request" \ |
| 6205 | -C "skip write certificate" \ |
| 6206 | -C "skip write certificate verify" \ |
| 6207 | -S "skip parse certificate verify" \ |
| 6208 | -s "x509_verify_cert() returned" \ |
| 6209 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6210 | -s "The certificate has been revoked (is on a CRL)" |
| 6211 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6212 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6213 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6214 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6215 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6216 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6217 | "$P_CLI nbio=2 tickets=0" \ |
| 6218 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6219 | -S "mbedtls_ssl_handshake returned" \ |
| 6220 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6221 | -c "Read from server: .* bytes read" |
| 6222 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6223 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6224 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6225 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6226 | "$P_CLI nbio=2 tickets=0" \ |
| 6227 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6228 | -S "mbedtls_ssl_handshake returned" \ |
| 6229 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6230 | -c "Read from server: .* bytes read" |
| 6231 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6233 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6234 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6235 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6236 | "$P_CLI nbio=2 tickets=1" \ |
| 6237 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6238 | -S "mbedtls_ssl_handshake returned" \ |
| 6239 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6240 | -c "Read from server: .* bytes read" |
| 6241 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6243 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6244 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6245 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6246 | "$P_CLI nbio=2 tickets=1" \ |
| 6247 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6248 | -S "mbedtls_ssl_handshake returned" \ |
| 6249 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6250 | -c "Read from server: .* bytes read" |
| 6251 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6253 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6254 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6255 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6256 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6257 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6258 | -S "mbedtls_ssl_handshake returned" \ |
| 6259 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6260 | -c "Read from server: .* bytes read" |
| 6261 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6263 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6264 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6265 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6266 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6267 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6268 | -S "mbedtls_ssl_handshake returned" \ |
| 6269 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6270 | -c "Read from server: .* bytes read" |
| 6271 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6273 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6274 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6275 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6276 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 6277 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6278 | -S "mbedtls_ssl_handshake returned" \ |
| 6279 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6280 | -c "Read from server: .* bytes read" |
| 6281 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6282 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6283 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6284 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6285 | run_test "Event-driven I/O: basic handshake" \ |
| 6286 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6287 | "$P_CLI event=1 tickets=0" \ |
| 6288 | 0 \ |
| 6289 | -S "mbedtls_ssl_handshake returned" \ |
| 6290 | -C "mbedtls_ssl_handshake returned" \ |
| 6291 | -c "Read from server: .* bytes read" |
| 6292 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6293 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6294 | run_test "Event-driven I/O: client auth" \ |
| 6295 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6296 | "$P_CLI event=1 tickets=0" \ |
| 6297 | 0 \ |
| 6298 | -S "mbedtls_ssl_handshake returned" \ |
| 6299 | -C "mbedtls_ssl_handshake returned" \ |
| 6300 | -c "Read from server: .* bytes read" |
| 6301 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6303 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6304 | run_test "Event-driven I/O: ticket" \ |
| 6305 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6306 | "$P_CLI event=1 tickets=1" \ |
| 6307 | 0 \ |
| 6308 | -S "mbedtls_ssl_handshake returned" \ |
| 6309 | -C "mbedtls_ssl_handshake returned" \ |
| 6310 | -c "Read from server: .* bytes read" |
| 6311 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6313 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6314 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6315 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6316 | "$P_CLI event=1 tickets=1" \ |
| 6317 | 0 \ |
| 6318 | -S "mbedtls_ssl_handshake returned" \ |
| 6319 | -C "mbedtls_ssl_handshake returned" \ |
| 6320 | -c "Read from server: .* bytes read" |
| 6321 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6323 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6324 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 6325 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6326 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6327 | 0 \ |
| 6328 | -S "mbedtls_ssl_handshake returned" \ |
| 6329 | -C "mbedtls_ssl_handshake returned" \ |
| 6330 | -c "Read from server: .* bytes read" |
| 6331 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6333 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6334 | run_test "Event-driven I/O: ticket + resume" \ |
| 6335 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6336 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6337 | 0 \ |
| 6338 | -S "mbedtls_ssl_handshake returned" \ |
| 6339 | -C "mbedtls_ssl_handshake returned" \ |
| 6340 | -c "Read from server: .* bytes read" |
| 6341 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6343 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6344 | run_test "Event-driven I/O: session-id resume" \ |
| 6345 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6346 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 6347 | 0 \ |
| 6348 | -S "mbedtls_ssl_handshake returned" \ |
| 6349 | -C "mbedtls_ssl_handshake returned" \ |
| 6350 | -c "Read from server: .* bytes read" |
| 6351 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6353 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6354 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6355 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6356 | 0 \ |
| 6357 | -c "Read from server: .* bytes read" |
| 6358 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6360 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6361 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6362 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6363 | 0 \ |
| 6364 | -c "Read from server: .* bytes read" |
| 6365 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6367 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6368 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6369 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6370 | 0 \ |
| 6371 | -c "Read from server: .* bytes read" |
| 6372 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6374 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6375 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6376 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6377 | 0 \ |
| 6378 | -c "Read from server: .* bytes read" |
| 6379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6381 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6382 | "$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] | 6383 | "$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] | 6384 | 0 \ |
| 6385 | -c "Read from server: .* bytes read" |
| 6386 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6388 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6389 | "$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] | 6390 | "$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] | 6391 | 0 \ |
| 6392 | -c "Read from server: .* bytes read" |
| 6393 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6395 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6396 | "$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] | 6397 | "$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] | 6398 | 0 \ |
| 6399 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6400 | |
| 6401 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6402 | # During session resumption, the client will send its ApplicationData record |
| 6403 | # within the same datagram as the Finished messages. In this situation, the |
| 6404 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6405 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6407 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6408 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6409 | "$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] | 6410 | "$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] | 6411 | 0 \ |
| 6412 | -c "Read from server: .* bytes read" |
| 6413 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6414 | # Tests for version negotiation |
| 6415 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6417 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6418 | "$P_SRV" \ |
| 6419 | "$P_CLI" \ |
| 6420 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6421 | -S "mbedtls_ssl_handshake returned" \ |
| 6422 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6423 | -s "Protocol is TLSv1.2" \ |
| 6424 | -c "Protocol is TLSv1.2" |
| 6425 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6427 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6428 | "$P_SRV" \ |
| 6429 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6430 | 1 \ |
| 6431 | -s "Handshake protocol not within min/max boundaries" \ |
| 6432 | -c "Error in protocol version" \ |
| 6433 | -S "Protocol is TLSv1.0" \ |
| 6434 | -C "Handshake was completed" |
| 6435 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6437 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6438 | "$P_SRV" \ |
| 6439 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6440 | 1 \ |
| 6441 | -s "Handshake protocol not within min/max boundaries" \ |
| 6442 | -c "Error in protocol version" \ |
| 6443 | -S "Protocol is TLSv1.1" \ |
| 6444 | -C "Handshake was completed" |
| 6445 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6447 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6448 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6449 | "$P_CLI" \ |
| 6450 | 1 \ |
| 6451 | -s "Error in protocol version" \ |
| 6452 | -c "Handshake protocol not within min/max boundaries" \ |
| 6453 | -S "Version: TLS1.0" \ |
| 6454 | -C "Protocol is TLSv1.0" |
| 6455 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6457 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6458 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6459 | "$P_CLI" \ |
| 6460 | 1 \ |
| 6461 | -s "Error in protocol version" \ |
| 6462 | -c "Handshake protocol not within min/max boundaries" \ |
| 6463 | -S "Version: TLS1.1" \ |
| 6464 | -C "Protocol is TLSv1.1" |
| 6465 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6466 | # Tests for ALPN extension |
| 6467 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6468 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6469 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6470 | "$P_SRV debug_level=3" \ |
| 6471 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6472 | 0 \ |
| 6473 | -C "client hello, adding alpn extension" \ |
| 6474 | -S "found alpn extension" \ |
| 6475 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6476 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6477 | -C "found alpn extension " \ |
| 6478 | -C "Application Layer Protocol is" \ |
| 6479 | -S "Application Layer Protocol is" |
| 6480 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6481 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6482 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6483 | "$P_SRV debug_level=3" \ |
| 6484 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6485 | 0 \ |
| 6486 | -c "client hello, adding alpn extension" \ |
| 6487 | -s "found alpn extension" \ |
| 6488 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6489 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6490 | -C "found alpn extension " \ |
| 6491 | -c "Application Layer Protocol is (none)" \ |
| 6492 | -S "Application Layer Protocol is" |
| 6493 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6494 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6495 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6496 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6497 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6498 | 0 \ |
| 6499 | -C "client hello, adding alpn extension" \ |
| 6500 | -S "found alpn extension" \ |
| 6501 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6502 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6503 | -C "found alpn extension " \ |
| 6504 | -C "Application Layer Protocol is" \ |
| 6505 | -s "Application Layer Protocol is (none)" |
| 6506 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6507 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6508 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6509 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6510 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6511 | 0 \ |
| 6512 | -c "client hello, adding alpn extension" \ |
| 6513 | -s "found alpn extension" \ |
| 6514 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6515 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6516 | -c "found alpn extension" \ |
| 6517 | -c "Application Layer Protocol is abc" \ |
| 6518 | -s "Application Layer Protocol is abc" |
| 6519 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6520 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6521 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6522 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6523 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6524 | 0 \ |
| 6525 | -c "client hello, adding alpn extension" \ |
| 6526 | -s "found alpn extension" \ |
| 6527 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6528 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6529 | -c "found alpn extension" \ |
| 6530 | -c "Application Layer Protocol is abc" \ |
| 6531 | -s "Application Layer Protocol is abc" |
| 6532 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6533 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6534 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6535 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6536 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6537 | 0 \ |
| 6538 | -c "client hello, adding alpn extension" \ |
| 6539 | -s "found alpn extension" \ |
| 6540 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6541 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6542 | -c "found alpn extension" \ |
| 6543 | -c "Application Layer Protocol is 1234" \ |
| 6544 | -s "Application Layer Protocol is 1234" |
| 6545 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6546 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6547 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6548 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6549 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6550 | 1 \ |
| 6551 | -c "client hello, adding alpn extension" \ |
| 6552 | -s "found alpn extension" \ |
| 6553 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6554 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6555 | -C "found alpn extension" \ |
| 6556 | -C "Application Layer Protocol is 1234" \ |
| 6557 | -S "Application Layer Protocol is 1234" |
| 6558 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6559 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6560 | # Tests for keyUsage in leaf certificates, part 1: |
| 6561 | # server-side certificate/suite selection |
| 6562 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6564 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6565 | "$P_SRV key_file=data_files/server2.key \ |
| 6566 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6567 | "$P_CLI" \ |
| 6568 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6569 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6570 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6572 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6573 | "$P_SRV key_file=data_files/server2.key \ |
| 6574 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6575 | "$P_CLI" \ |
| 6576 | 0 \ |
| 6577 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6578 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6580 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6581 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6582 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6583 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6584 | 1 \ |
| 6585 | -C "Ciphersuite is " |
| 6586 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6588 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6589 | "$P_SRV key_file=data_files/server5.key \ |
| 6590 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6591 | "$P_CLI" \ |
| 6592 | 0 \ |
| 6593 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6594 | |
| 6595 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6597 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6598 | "$P_SRV key_file=data_files/server5.key \ |
| 6599 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6600 | "$P_CLI" \ |
| 6601 | 0 \ |
| 6602 | -c "Ciphersuite is TLS-ECDH-" |
| 6603 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6604 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6605 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6606 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6607 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6608 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6609 | 1 \ |
| 6610 | -C "Ciphersuite is " |
| 6611 | |
| 6612 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6613 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6614 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6616 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6617 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6618 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6619 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6620 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6621 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6622 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6623 | -C "Processing of the Certificate handshake message failed" \ |
| 6624 | -c "Ciphersuite is TLS-" |
| 6625 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6627 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6628 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6629 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6630 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6631 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6632 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6633 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6634 | -C "Processing of the Certificate handshake message failed" \ |
| 6635 | -c "Ciphersuite is TLS-" |
| 6636 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6638 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6639 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6640 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6641 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6642 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6643 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6644 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6645 | -C "Processing of the Certificate handshake message failed" \ |
| 6646 | -c "Ciphersuite is TLS-" |
| 6647 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6649 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6650 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6651 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6652 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6653 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6654 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6655 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6656 | -c "Processing of the Certificate handshake message failed" \ |
| 6657 | -C "Ciphersuite is TLS-" |
| 6658 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6660 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6661 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6662 | -cert data_files/server2.ku-ke.crt" \ |
| 6663 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6664 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6665 | 0 \ |
| 6666 | -c "bad certificate (usage extensions)" \ |
| 6667 | -C "Processing of the Certificate handshake message failed" \ |
| 6668 | -c "Ciphersuite is TLS-" \ |
| 6669 | -c "! Usage does not match the keyUsage extension" |
| 6670 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6672 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6673 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6674 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6675 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6676 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6677 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6678 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6679 | -C "Processing of the Certificate handshake message failed" \ |
| 6680 | -c "Ciphersuite is TLS-" |
| 6681 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6683 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6684 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6685 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6686 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6687 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6688 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6689 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6690 | -c "Processing of the Certificate handshake message failed" \ |
| 6691 | -C "Ciphersuite is TLS-" |
| 6692 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6694 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6695 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6696 | -cert data_files/server2.ku-ds.crt" \ |
| 6697 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6698 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6699 | 0 \ |
| 6700 | -c "bad certificate (usage extensions)" \ |
| 6701 | -C "Processing of the Certificate handshake message failed" \ |
| 6702 | -c "Ciphersuite is TLS-" \ |
| 6703 | -c "! Usage does not match the keyUsage extension" |
| 6704 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6705 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6706 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6707 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6708 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6709 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6710 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6711 | "$P_CLI debug_level=3" \ |
| 6712 | 0 \ |
| 6713 | -C "bad certificate (usage extensions)" \ |
| 6714 | -C "Processing of the Certificate handshake message failed" \ |
| 6715 | -c "Ciphersuite is" |
| 6716 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6717 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6718 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6719 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6720 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6721 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6722 | -cert data_files/server2.ku-ke.crt" \ |
| 6723 | "$P_CLI debug_level=1" \ |
| 6724 | 1 \ |
| 6725 | -c "bad certificate (usage extensions)" \ |
| 6726 | -c "Processing of the Certificate handshake message failed" \ |
| 6727 | -C "Ciphersuite is" |
| 6728 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6729 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6730 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6731 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6732 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6733 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6734 | -cert data_files/server2.ku-ka.crt" \ |
| 6735 | "$P_CLI debug_level=1" \ |
| 6736 | 1 \ |
| 6737 | -c "bad certificate (usage extensions)" \ |
| 6738 | -c "Processing of the Certificate handshake message failed" \ |
| 6739 | -C "Ciphersuite is" |
| 6740 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6741 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6742 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6743 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6744 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6745 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6746 | -cert data_files/server5.ku-ds.crt" \ |
| 6747 | "$P_CLI debug_level=3" \ |
| 6748 | 0 \ |
| 6749 | -C "bad certificate (usage extensions)" \ |
| 6750 | -C "Processing of the Certificate handshake message failed" \ |
| 6751 | -c "Ciphersuite is" |
| 6752 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6753 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6754 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6755 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6756 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6757 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6758 | -cert data_files/server5.ku-ke.crt" \ |
| 6759 | "$P_CLI debug_level=1" \ |
| 6760 | 1 \ |
| 6761 | -c "bad certificate (usage extensions)" \ |
| 6762 | -c "Processing of the Certificate handshake message failed" \ |
| 6763 | -C "Ciphersuite is" |
| 6764 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6765 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6766 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6767 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6768 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6769 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6770 | -cert data_files/server5.ku-ka.crt" \ |
| 6771 | "$P_CLI debug_level=1" \ |
| 6772 | 1 \ |
| 6773 | -c "bad certificate (usage extensions)" \ |
| 6774 | -c "Processing of the Certificate handshake message failed" \ |
| 6775 | -C "Ciphersuite is" |
| 6776 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6777 | # Tests for keyUsage in leaf certificates, part 3: |
| 6778 | # server-side checking of client cert |
| 6779 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6781 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6782 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6783 | "$O_CLI -key data_files/server2.key \ |
| 6784 | -cert data_files/server2.ku-ds.crt" \ |
| 6785 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6786 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6787 | -S "bad certificate (usage extensions)" \ |
| 6788 | -S "Processing of the Certificate handshake message failed" |
| 6789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6791 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6792 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6793 | "$O_CLI -key data_files/server2.key \ |
| 6794 | -cert data_files/server2.ku-ke.crt" \ |
| 6795 | 0 \ |
| 6796 | -s "bad certificate (usage extensions)" \ |
| 6797 | -S "Processing of the Certificate handshake message failed" |
| 6798 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6800 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6801 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6802 | "$O_CLI -key data_files/server2.key \ |
| 6803 | -cert data_files/server2.ku-ke.crt" \ |
| 6804 | 1 \ |
| 6805 | -s "bad certificate (usage extensions)" \ |
| 6806 | -s "Processing of the Certificate handshake message failed" |
| 6807 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6809 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6810 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6811 | "$O_CLI -key data_files/server5.key \ |
| 6812 | -cert data_files/server5.ku-ds.crt" \ |
| 6813 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6814 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6815 | -S "bad certificate (usage extensions)" \ |
| 6816 | -S "Processing of the Certificate handshake message failed" |
| 6817 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6819 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6820 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6821 | "$O_CLI -key data_files/server5.key \ |
| 6822 | -cert data_files/server5.ku-ka.crt" \ |
| 6823 | 0 \ |
| 6824 | -s "bad certificate (usage extensions)" \ |
| 6825 | -S "Processing of the Certificate handshake message failed" |
| 6826 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6827 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6828 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6829 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6830 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6831 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6832 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6833 | -cert data_files/server2.ku-ds.crt" \ |
| 6834 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6835 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6836 | -S "bad certificate (usage extensions)" \ |
| 6837 | -S "Processing of the Certificate handshake message failed" |
| 6838 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6839 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6840 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6841 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6842 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6843 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6844 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6845 | -cert data_files/server2.ku-ke.crt" \ |
| 6846 | 0 \ |
| 6847 | -s "bad certificate (usage extensions)" \ |
| 6848 | -S "Processing of the Certificate handshake message failed" |
| 6849 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6850 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6851 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6852 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6853 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6854 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6855 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6856 | -cert data_files/server5.ku-ds.crt" \ |
| 6857 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6858 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6859 | -S "bad certificate (usage extensions)" \ |
| 6860 | -S "Processing of the Certificate handshake message failed" |
| 6861 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6862 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6863 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6864 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6865 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6866 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6867 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6868 | -cert data_files/server5.ku-ka.crt" \ |
| 6869 | 0 \ |
| 6870 | -s "bad certificate (usage extensions)" \ |
| 6871 | -S "Processing of the Certificate handshake message failed" |
| 6872 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6873 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6874 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6876 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6877 | "$P_SRV key_file=data_files/server5.key \ |
| 6878 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6879 | "$P_CLI" \ |
| 6880 | 0 |
| 6881 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6883 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6884 | "$P_SRV key_file=data_files/server5.key \ |
| 6885 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6886 | "$P_CLI" \ |
| 6887 | 0 |
| 6888 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6890 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6891 | "$P_SRV key_file=data_files/server5.key \ |
| 6892 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6893 | "$P_CLI" \ |
| 6894 | 0 |
| 6895 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6897 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6898 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6899 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6900 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6901 | 1 |
| 6902 | |
| 6903 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6904 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6906 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6907 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6908 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6909 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6910 | 0 \ |
| 6911 | -C "bad certificate (usage extensions)" \ |
| 6912 | -C "Processing of the Certificate handshake message failed" \ |
| 6913 | -c "Ciphersuite is TLS-" |
| 6914 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6916 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6917 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6918 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6919 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6920 | 0 \ |
| 6921 | -C "bad certificate (usage extensions)" \ |
| 6922 | -C "Processing of the Certificate handshake message failed" \ |
| 6923 | -c "Ciphersuite is TLS-" |
| 6924 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6926 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6927 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6928 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6929 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6930 | 0 \ |
| 6931 | -C "bad certificate (usage extensions)" \ |
| 6932 | -C "Processing of the Certificate handshake message failed" \ |
| 6933 | -c "Ciphersuite is TLS-" |
| 6934 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6935 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6936 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6937 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6938 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6939 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6940 | 1 \ |
| 6941 | -c "bad certificate (usage extensions)" \ |
| 6942 | -c "Processing of the Certificate handshake message failed" \ |
| 6943 | -C "Ciphersuite is TLS-" |
| 6944 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6945 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6946 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6947 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6948 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 6949 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6950 | -cert data_files/server5.eku-srv.crt" \ |
| 6951 | "$P_CLI debug_level=1" \ |
| 6952 | 0 \ |
| 6953 | -C "bad certificate (usage extensions)" \ |
| 6954 | -C "Processing of the Certificate handshake message failed" \ |
| 6955 | -c "Ciphersuite is" |
| 6956 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6957 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6958 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6959 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6960 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 6961 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6962 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6963 | "$P_CLI debug_level=1" \ |
| 6964 | 0 \ |
| 6965 | -C "bad certificate (usage extensions)" \ |
| 6966 | -C "Processing of the Certificate handshake message failed" \ |
| 6967 | -c "Ciphersuite is" |
| 6968 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6969 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6970 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6971 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6972 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 6973 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6974 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6975 | "$P_CLI debug_level=1" \ |
| 6976 | 0 \ |
| 6977 | -C "bad certificate (usage extensions)" \ |
| 6978 | -C "Processing of the Certificate handshake message failed" \ |
| 6979 | -c "Ciphersuite is" |
| 6980 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6981 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6982 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6983 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6984 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 6985 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6986 | -cert data_files/server5.eku-cs.crt" \ |
| 6987 | "$P_CLI debug_level=1" \ |
| 6988 | 1 \ |
| 6989 | -c "bad certificate (usage extensions)" \ |
| 6990 | -c "Processing of the Certificate handshake message failed" \ |
| 6991 | -C "Ciphersuite is" |
| 6992 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6993 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6994 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6996 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6997 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6998 | "$O_CLI -key data_files/server5.key \ |
| 6999 | -cert data_files/server5.eku-cli.crt" \ |
| 7000 | 0 \ |
| 7001 | -S "bad certificate (usage extensions)" \ |
| 7002 | -S "Processing of the Certificate handshake message failed" |
| 7003 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7005 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7006 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7007 | "$O_CLI -key data_files/server5.key \ |
| 7008 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7009 | 0 \ |
| 7010 | -S "bad certificate (usage extensions)" \ |
| 7011 | -S "Processing of the Certificate handshake message failed" |
| 7012 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7014 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7015 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7016 | "$O_CLI -key data_files/server5.key \ |
| 7017 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7018 | 0 \ |
| 7019 | -S "bad certificate (usage extensions)" \ |
| 7020 | -S "Processing of the Certificate handshake message failed" |
| 7021 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7023 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7024 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7025 | "$O_CLI -key data_files/server5.key \ |
| 7026 | -cert data_files/server5.eku-cs.crt" \ |
| 7027 | 0 \ |
| 7028 | -s "bad certificate (usage extensions)" \ |
| 7029 | -S "Processing of the Certificate handshake message failed" |
| 7030 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7032 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7033 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7034 | "$O_CLI -key data_files/server5.key \ |
| 7035 | -cert data_files/server5.eku-cs.crt" \ |
| 7036 | 1 \ |
| 7037 | -s "bad certificate (usage extensions)" \ |
| 7038 | -s "Processing of the Certificate handshake message failed" |
| 7039 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7040 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7041 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7042 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7043 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7044 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7045 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7046 | -cert data_files/server5.eku-cli.crt" \ |
| 7047 | 0 \ |
| 7048 | -S "bad certificate (usage extensions)" \ |
| 7049 | -S "Processing of the Certificate handshake message failed" |
| 7050 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7051 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7052 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7053 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7054 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7055 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7056 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7057 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7058 | 0 \ |
| 7059 | -S "bad certificate (usage extensions)" \ |
| 7060 | -S "Processing of the Certificate handshake message failed" |
| 7061 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7062 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7063 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7064 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7065 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7066 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7067 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7068 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7069 | 0 \ |
| 7070 | -S "bad certificate (usage extensions)" \ |
| 7071 | -S "Processing of the Certificate handshake message failed" |
| 7072 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7073 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7074 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7075 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7076 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7077 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7078 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7079 | -cert data_files/server5.eku-cs.crt" \ |
| 7080 | 0 \ |
| 7081 | -s "bad certificate (usage extensions)" \ |
| 7082 | -S "Processing of the Certificate handshake message failed" |
| 7083 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7084 | # Tests for DHM parameters loading |
| 7085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7087 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7088 | "$P_SRV" \ |
| 7089 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7090 | debug_level=3" \ |
| 7091 | 0 \ |
| 7092 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7093 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7094 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7096 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7097 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7098 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7099 | debug_level=3" \ |
| 7100 | 0 \ |
| 7101 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 7102 | -c "value of 'DHM: G ' (2 bits)" |
| 7103 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7104 | # Tests for DHM client-side size checking |
| 7105 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7107 | run_test "DHM size: server default, client default, OK" \ |
| 7108 | "$P_SRV" \ |
| 7109 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7110 | debug_level=1" \ |
| 7111 | 0 \ |
| 7112 | -C "DHM prime too short:" |
| 7113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7115 | run_test "DHM size: server default, client 2048, OK" \ |
| 7116 | "$P_SRV" \ |
| 7117 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7118 | debug_level=1 dhmlen=2048" \ |
| 7119 | 0 \ |
| 7120 | -C "DHM prime too short:" |
| 7121 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7123 | run_test "DHM size: server 1024, client default, OK" \ |
| 7124 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7125 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7126 | debug_level=1" \ |
| 7127 | 0 \ |
| 7128 | -C "DHM prime too short:" |
| 7129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7131 | run_test "DHM size: server 999, client 999, OK" \ |
| 7132 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7133 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7134 | debug_level=1 dhmlen=999" \ |
| 7135 | 0 \ |
| 7136 | -C "DHM prime too short:" |
| 7137 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7139 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 7140 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7141 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7142 | debug_level=1 dhmlen=1000" \ |
| 7143 | 0 \ |
| 7144 | -C "DHM prime too short:" |
| 7145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7147 | run_test "DHM size: server 1000, client default, rejected" \ |
| 7148 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7149 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7150 | debug_level=1" \ |
| 7151 | 1 \ |
| 7152 | -c "DHM prime too short:" |
| 7153 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7155 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7156 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7157 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7158 | debug_level=1 dhmlen=1001" \ |
| 7159 | 1 \ |
| 7160 | -c "DHM prime too short:" |
| 7161 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7163 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7164 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7165 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7166 | debug_level=1 dhmlen=1000" \ |
| 7167 | 1 \ |
| 7168 | -c "DHM prime too short:" |
| 7169 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7171 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7172 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7173 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7174 | debug_level=1 dhmlen=999" \ |
| 7175 | 1 \ |
| 7176 | -c "DHM prime too short:" |
| 7177 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7179 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7180 | "$P_SRV" \ |
| 7181 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7182 | debug_level=1 dhmlen=2049" \ |
| 7183 | 1 \ |
| 7184 | -c "DHM prime too short:" |
| 7185 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7186 | # Tests for PSK callback |
| 7187 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7189 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7190 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7191 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7192 | psk_identity=foo psk=abc123" \ |
| 7193 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7194 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7195 | -S "SSL - Unknown identity received" \ |
| 7196 | -S "SSL - Verification of the message MAC failed" |
| 7197 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7198 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7200 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7201 | "$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] | 7202 | "$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] | 7203 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7204 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7205 | -C "session hash for extended master secret"\ |
| 7206 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7207 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7208 | -S "SSL - Unknown identity received" \ |
| 7209 | -S "SSL - Verification of the message MAC failed" |
| 7210 | |
| 7211 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7213 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7214 | "$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] | 7215 | "$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] | 7216 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7217 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7218 | -C "session hash for extended master secret"\ |
| 7219 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7220 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7221 | -S "SSL - Unknown identity received" \ |
| 7222 | -S "SSL - Verification of the message MAC failed" |
| 7223 | |
| 7224 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7226 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7227 | "$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] | 7228 | "$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] | 7229 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7230 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7231 | -c "session hash for extended master secret"\ |
| 7232 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7233 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7234 | -S "SSL - Unknown identity received" \ |
| 7235 | -S "SSL - Verification of the message MAC failed" |
| 7236 | |
| 7237 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7239 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7240 | "$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] | 7241 | "$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] | 7242 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7243 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7244 | -c "session hash for extended master secret"\ |
| 7245 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7246 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7247 | -S "SSL - Unknown identity received" \ |
| 7248 | -S "SSL - Verification of the message MAC failed" |
| 7249 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7250 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7252 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7253 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7254 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7255 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7256 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7257 | -C "session hash for extended master secret"\ |
| 7258 | -S "session hash for extended master secret"\ |
| 7259 | -S "SSL - The handshake negotiation failed" \ |
| 7260 | -S "SSL - Unknown identity received" \ |
| 7261 | -S "SSL - Verification of the message MAC failed" |
| 7262 | |
| 7263 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7265 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7266 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7267 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7268 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7269 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7270 | -C "session hash for extended master secret"\ |
| 7271 | -S "session hash for extended master secret"\ |
| 7272 | -S "SSL - The handshake negotiation failed" \ |
| 7273 | -S "SSL - Unknown identity received" \ |
| 7274 | -S "SSL - Verification of the message MAC failed" |
| 7275 | |
| 7276 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7278 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7279 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7280 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7281 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7282 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7283 | -c "session hash for extended master secret"\ |
| 7284 | -s "session hash for extended master secret"\ |
| 7285 | -S "SSL - The handshake negotiation failed" \ |
| 7286 | -S "SSL - Unknown identity received" \ |
| 7287 | -S "SSL - Verification of the message MAC failed" |
| 7288 | |
| 7289 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7291 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7292 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7293 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7294 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7295 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7296 | -c "session hash for extended master secret"\ |
| 7297 | -s "session hash for extended master secret"\ |
| 7298 | -S "SSL - The handshake negotiation failed" \ |
| 7299 | -S "SSL - Unknown identity received" \ |
| 7300 | -S "SSL - Verification of the message MAC failed" |
| 7301 | |
| 7302 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7304 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7305 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7306 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7307 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7308 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7309 | -C "session hash for extended master secret"\ |
| 7310 | -S "session hash for extended master secret"\ |
| 7311 | -S "SSL - The handshake negotiation failed" \ |
| 7312 | -S "SSL - Unknown identity received" \ |
| 7313 | -S "SSL - Verification of the message MAC failed" |
| 7314 | |
| 7315 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7317 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7318 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7319 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7320 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7321 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7322 | -C "session hash for extended master secret"\ |
| 7323 | -S "session hash for extended master secret"\ |
| 7324 | -S "SSL - The handshake negotiation failed" \ |
| 7325 | -S "SSL - Unknown identity received" \ |
| 7326 | -S "SSL - Verification of the message MAC failed" |
| 7327 | |
| 7328 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7330 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7331 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7332 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7333 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7334 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7335 | -c "session hash for extended master secret"\ |
| 7336 | -s "session hash for extended master secret"\ |
| 7337 | -S "SSL - The handshake negotiation failed" \ |
| 7338 | -S "SSL - Unknown identity received" \ |
| 7339 | -S "SSL - Verification of the message MAC failed" |
| 7340 | |
| 7341 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7343 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7344 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7345 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7346 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7347 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7348 | -c "session hash for extended master secret"\ |
| 7349 | -s "session hash for extended master secret"\ |
| 7350 | -S "SSL - The handshake negotiation failed" \ |
| 7351 | -S "SSL - Unknown identity received" \ |
| 7352 | -S "SSL - Verification of the message MAC failed" |
| 7353 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7354 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7356 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7357 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7358 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7359 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7360 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7361 | -C "session hash for extended master secret"\ |
| 7362 | -S "session hash for extended master secret"\ |
| 7363 | -S "SSL - The handshake negotiation failed" \ |
| 7364 | -S "SSL - Unknown identity received" \ |
| 7365 | -S "SSL - Verification of the message MAC failed" |
| 7366 | |
| 7367 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7369 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7370 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7371 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7372 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7373 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7374 | -C "session hash for extended master secret"\ |
| 7375 | -S "session hash for extended master secret"\ |
| 7376 | -S "SSL - The handshake negotiation failed" \ |
| 7377 | -S "SSL - Unknown identity received" \ |
| 7378 | -S "SSL - Verification of the message MAC failed" |
| 7379 | |
| 7380 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7382 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7383 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7384 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7385 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7386 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7387 | -c "session hash for extended master secret"\ |
| 7388 | -s "session hash for extended master secret"\ |
| 7389 | -S "SSL - The handshake negotiation failed" \ |
| 7390 | -S "SSL - Unknown identity received" \ |
| 7391 | -S "SSL - Verification of the message MAC failed" |
| 7392 | |
| 7393 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7395 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7396 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7397 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7398 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7399 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7400 | -c "session hash for extended master secret"\ |
| 7401 | -s "session hash for extended master secret"\ |
| 7402 | -S "SSL - The handshake negotiation failed" \ |
| 7403 | -S "SSL - Unknown identity received" \ |
| 7404 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7405 | |
| 7406 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7408 | 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] | 7409 | "$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" \ |
| 7410 | "$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] | 7411 | psk_identity=foo psk=abc123" \ |
| 7412 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7413 | -C "session hash for extended master secret"\ |
| 7414 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7415 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7416 | -S "SSL - Unknown identity received" \ |
| 7417 | -S "SSL - Verification of the message MAC failed" |
| 7418 | |
| 7419 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7421 | 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] | 7422 | "$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" \ |
| 7423 | "$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] | 7424 | psk_identity=foo psk=abc123" \ |
| 7425 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7426 | -C "session hash for extended master secret"\ |
| 7427 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7428 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7429 | -S "SSL - Unknown identity received" \ |
| 7430 | -S "SSL - Verification of the message MAC failed" |
| 7431 | |
| 7432 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7434 | 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] | 7435 | "$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] | 7436 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7437 | "$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] | 7438 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7439 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7440 | -c "session hash for extended master secret"\ |
| 7441 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7442 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7443 | -S "SSL - Unknown identity received" \ |
| 7444 | -S "SSL - Verification of the message MAC failed" |
| 7445 | |
| 7446 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7448 | 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] | 7449 | "$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] | 7450 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7451 | "$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] | 7452 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7453 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7454 | -c "session hash for extended master secret"\ |
| 7455 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7456 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7457 | -S "SSL - Unknown identity received" \ |
| 7458 | -S "SSL - Verification of the message MAC failed" |
| 7459 | |
| 7460 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7462 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7463 | "$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" \ |
| 7464 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7465 | psk_identity=foo psk=abc123" \ |
| 7466 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7467 | -C "session hash for extended master secret"\ |
| 7468 | -S "session hash for extended master secret"\ |
| 7469 | -S "SSL - The handshake negotiation failed" \ |
| 7470 | -S "SSL - Unknown identity received" \ |
| 7471 | -S "SSL - Verification of the message MAC failed" |
| 7472 | |
| 7473 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7475 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7476 | "$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" \ |
| 7477 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7478 | psk_identity=foo psk=abc123" \ |
| 7479 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7480 | -C "session hash for extended master secret"\ |
| 7481 | -S "session hash for extended master secret"\ |
| 7482 | -S "SSL - The handshake negotiation failed" \ |
| 7483 | -S "SSL - Unknown identity received" \ |
| 7484 | -S "SSL - Verification of the message MAC failed" |
| 7485 | |
| 7486 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7488 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7489 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7490 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7491 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7492 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7493 | 0 \ |
| 7494 | -c "session hash for extended master secret"\ |
| 7495 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7496 | -S "SSL - The handshake negotiation failed" \ |
| 7497 | -S "SSL - Unknown identity received" \ |
| 7498 | -S "SSL - Verification of the message MAC failed" |
| 7499 | |
| 7500 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7502 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7503 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7504 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7505 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7506 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7507 | 0 \ |
| 7508 | -c "session hash for extended master secret"\ |
| 7509 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7510 | -S "SSL - The handshake negotiation failed" \ |
| 7511 | -S "SSL - Unknown identity received" \ |
| 7512 | -S "SSL - Verification of the message MAC failed" |
| 7513 | |
| 7514 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7516 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7517 | "$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" \ |
| 7518 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7519 | psk_identity=foo psk=abc123" \ |
| 7520 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7521 | -C "session hash for extended master secret"\ |
| 7522 | -S "session hash for extended master secret"\ |
| 7523 | -S "SSL - The handshake negotiation failed" \ |
| 7524 | -S "SSL - Unknown identity received" \ |
| 7525 | -S "SSL - Verification of the message MAC failed" |
| 7526 | |
| 7527 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7529 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7530 | "$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" \ |
| 7531 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7532 | psk_identity=foo psk=abc123" \ |
| 7533 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7534 | -C "session hash for extended master secret"\ |
| 7535 | -S "session hash for extended master secret"\ |
| 7536 | -S "SSL - The handshake negotiation failed" \ |
| 7537 | -S "SSL - Unknown identity received" \ |
| 7538 | -S "SSL - Verification of the message MAC failed" |
| 7539 | |
| 7540 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7542 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7543 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7544 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7545 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7546 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7547 | 0 \ |
| 7548 | -c "session hash for extended master secret"\ |
| 7549 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7550 | -S "SSL - The handshake negotiation failed" \ |
| 7551 | -S "SSL - Unknown identity received" \ |
| 7552 | -S "SSL - Verification of the message MAC failed" |
| 7553 | |
| 7554 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7556 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7557 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7558 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7559 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7560 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7561 | 0 \ |
| 7562 | -c "session hash for extended master secret"\ |
| 7563 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7564 | -S "SSL - The handshake negotiation failed" \ |
| 7565 | -S "SSL - Unknown identity received" \ |
| 7566 | -S "SSL - Verification of the message MAC failed" |
| 7567 | |
| 7568 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7570 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7571 | "$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" \ |
| 7572 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7573 | psk_identity=foo psk=abc123" \ |
| 7574 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7575 | -C "session hash for extended master secret"\ |
| 7576 | -S "session hash for extended master secret"\ |
| 7577 | -S "SSL - The handshake negotiation failed" \ |
| 7578 | -S "SSL - Unknown identity received" \ |
| 7579 | -S "SSL - Verification of the message MAC failed" |
| 7580 | |
| 7581 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7583 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7584 | "$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" \ |
| 7585 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7586 | psk_identity=foo psk=abc123" \ |
| 7587 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7588 | -C "session hash for extended master secret"\ |
| 7589 | -S "session hash for extended master secret"\ |
| 7590 | -S "SSL - The handshake negotiation failed" \ |
| 7591 | -S "SSL - Unknown identity received" \ |
| 7592 | -S "SSL - Verification of the message MAC failed" |
| 7593 | |
| 7594 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7596 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7597 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7598 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7599 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7600 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7601 | 0 \ |
| 7602 | -c "session hash for extended master secret"\ |
| 7603 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7604 | -S "SSL - The handshake negotiation failed" \ |
| 7605 | -S "SSL - Unknown identity received" \ |
| 7606 | -S "SSL - Verification of the message MAC failed" |
| 7607 | |
| 7608 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7610 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7611 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7612 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7613 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7614 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7615 | 0 \ |
| 7616 | -c "session hash for extended master secret"\ |
| 7617 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7618 | -S "SSL - The handshake negotiation failed" \ |
| 7619 | -S "SSL - Unknown identity received" \ |
| 7620 | -S "SSL - Verification of the message MAC failed" |
| 7621 | |
| 7622 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7624 | 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] | 7625 | "$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" \ |
| 7626 | "$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] | 7627 | psk_identity=def psk=beef" \ |
| 7628 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7629 | -C "session hash for extended master secret"\ |
| 7630 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7631 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7632 | -S "SSL - Unknown identity received" \ |
| 7633 | -S "SSL - Verification of the message MAC failed" |
| 7634 | |
| 7635 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7637 | 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] | 7638 | "$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" \ |
| 7639 | "$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] | 7640 | psk_identity=def psk=beef" \ |
| 7641 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7642 | -C "session hash for extended master secret"\ |
| 7643 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7644 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7645 | -S "SSL - Unknown identity received" \ |
| 7646 | -S "SSL - Verification of the message MAC failed" |
| 7647 | |
| 7648 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7650 | 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] | 7651 | "$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] | 7652 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7653 | "$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] | 7654 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7655 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7656 | -c "session hash for extended master secret"\ |
| 7657 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7658 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7659 | -S "SSL - Unknown identity received" \ |
| 7660 | -S "SSL - Verification of the message MAC failed" |
| 7661 | |
| 7662 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7664 | 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] | 7665 | "$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] | 7666 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7667 | "$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] | 7668 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7669 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7670 | -c "session hash for extended master secret"\ |
| 7671 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7672 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7673 | -S "SSL - Unknown identity received" \ |
| 7674 | -S "SSL - Verification of the message MAC failed" |
| 7675 | |
| 7676 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7678 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7679 | "$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" \ |
| 7680 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7681 | psk_identity=def psk=beef" \ |
| 7682 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7683 | -C "session hash for extended master secret"\ |
| 7684 | -S "session hash for extended master secret"\ |
| 7685 | -S "SSL - The handshake negotiation failed" \ |
| 7686 | -S "SSL - Unknown identity received" \ |
| 7687 | -S "SSL - Verification of the message MAC failed" |
| 7688 | |
| 7689 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7691 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7692 | "$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" \ |
| 7693 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7694 | psk_identity=def psk=beef" \ |
| 7695 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7696 | -C "session hash for extended master secret"\ |
| 7697 | -S "session hash for extended master secret"\ |
| 7698 | -S "SSL - The handshake negotiation failed" \ |
| 7699 | -S "SSL - Unknown identity received" \ |
| 7700 | -S "SSL - Verification of the message MAC failed" |
| 7701 | |
| 7702 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7704 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7705 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7706 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7707 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7708 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7709 | 0 \ |
| 7710 | -c "session hash for extended master secret"\ |
| 7711 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7712 | -S "SSL - The handshake negotiation failed" \ |
| 7713 | -S "SSL - Unknown identity received" \ |
| 7714 | -S "SSL - Verification of the message MAC failed" |
| 7715 | |
| 7716 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7718 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7719 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7720 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7721 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7722 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7723 | 0 \ |
| 7724 | -c "session hash for extended master secret"\ |
| 7725 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7726 | -S "SSL - The handshake negotiation failed" \ |
| 7727 | -S "SSL - Unknown identity received" \ |
| 7728 | -S "SSL - Verification of the message MAC failed" |
| 7729 | |
| 7730 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7732 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7733 | "$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" \ |
| 7734 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7735 | psk_identity=def psk=beef" \ |
| 7736 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7737 | -C "session hash for extended master secret"\ |
| 7738 | -S "session hash for extended master secret"\ |
| 7739 | -S "SSL - The handshake negotiation failed" \ |
| 7740 | -S "SSL - Unknown identity received" \ |
| 7741 | -S "SSL - Verification of the message MAC failed" |
| 7742 | |
| 7743 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7745 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7746 | "$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" \ |
| 7747 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7748 | psk_identity=def psk=beef" \ |
| 7749 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7750 | -C "session hash for extended master secret"\ |
| 7751 | -S "session hash for extended master secret"\ |
| 7752 | -S "SSL - The handshake negotiation failed" \ |
| 7753 | -S "SSL - Unknown identity received" \ |
| 7754 | -S "SSL - Verification of the message MAC failed" |
| 7755 | |
| 7756 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7758 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7759 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7760 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7761 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7762 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7763 | 0 \ |
| 7764 | -c "session hash for extended master secret"\ |
| 7765 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7766 | -S "SSL - The handshake negotiation failed" \ |
| 7767 | -S "SSL - Unknown identity received" \ |
| 7768 | -S "SSL - Verification of the message MAC failed" |
| 7769 | |
| 7770 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7772 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7773 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7774 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7775 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7776 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7777 | 0 \ |
| 7778 | -c "session hash for extended master secret"\ |
| 7779 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7780 | -S "SSL - The handshake negotiation failed" \ |
| 7781 | -S "SSL - Unknown identity received" \ |
| 7782 | -S "SSL - Verification of the message MAC failed" |
| 7783 | |
| 7784 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7786 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7787 | "$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" \ |
| 7788 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7789 | psk_identity=def psk=beef" \ |
| 7790 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7791 | -C "session hash for extended master secret"\ |
| 7792 | -S "session hash for extended master secret"\ |
| 7793 | -S "SSL - The handshake negotiation failed" \ |
| 7794 | -S "SSL - Unknown identity received" \ |
| 7795 | -S "SSL - Verification of the message MAC failed" |
| 7796 | |
| 7797 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7799 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7800 | "$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" \ |
| 7801 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7802 | psk_identity=def psk=beef" \ |
| 7803 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7804 | -C "session hash for extended master secret"\ |
| 7805 | -S "session hash for extended master secret"\ |
| 7806 | -S "SSL - The handshake negotiation failed" \ |
| 7807 | -S "SSL - Unknown identity received" \ |
| 7808 | -S "SSL - Verification of the message MAC failed" |
| 7809 | |
| 7810 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7811 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7812 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7813 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7814 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7815 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7816 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7817 | 0 \ |
| 7818 | -c "session hash for extended master secret"\ |
| 7819 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7820 | -S "SSL - The handshake negotiation failed" \ |
| 7821 | -S "SSL - Unknown identity received" \ |
| 7822 | -S "SSL - Verification of the message MAC failed" |
| 7823 | |
| 7824 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7825 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7826 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7827 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7828 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7829 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7830 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7831 | 0 \ |
| 7832 | -c "session hash for extended master secret"\ |
| 7833 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7834 | -S "SSL - The handshake negotiation failed" \ |
| 7835 | -S "SSL - Unknown identity received" \ |
| 7836 | -S "SSL - Verification of the message MAC failed" |
| 7837 | |
| 7838 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7840 | 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] | 7841 | "$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" \ |
| 7842 | "$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] | 7843 | psk_identity=def psk=beef" \ |
| 7844 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7845 | -C "session hash for extended master secret"\ |
| 7846 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7847 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7848 | -S "SSL - Unknown identity received" \ |
| 7849 | -S "SSL - Verification of the message MAC failed" |
| 7850 | |
| 7851 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7853 | 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] | 7854 | "$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" \ |
| 7855 | "$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] | 7856 | psk_identity=def psk=beef" \ |
| 7857 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7858 | -C "session hash for extended master secret"\ |
| 7859 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7860 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7861 | -S "SSL - Unknown identity received" \ |
| 7862 | -S "SSL - Verification of the message MAC failed" |
| 7863 | |
| 7864 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7866 | 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] | 7867 | "$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" \ |
| 7868 | "$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] | 7869 | psk_identity=def psk=beef" \ |
| 7870 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7871 | -C "session hash for extended master secret"\ |
| 7872 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7873 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7874 | -S "SSL - Unknown identity received" \ |
| 7875 | -S "SSL - Verification of the message MAC failed" |
| 7876 | |
| 7877 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7879 | 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] | 7880 | "$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" \ |
| 7881 | "$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] | 7882 | psk_identity=def psk=beef" \ |
| 7883 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7884 | -C "session hash for extended master secret"\ |
| 7885 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7886 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7887 | -S "SSL - Unknown identity received" \ |
| 7888 | -S "SSL - Verification of the message MAC failed" |
| 7889 | |
| 7890 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7892 | 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] | 7893 | "$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" \ |
| 7894 | "$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] | 7895 | psk_identity=def psk=beef" \ |
| 7896 | 1 \ |
| 7897 | -s "SSL - Verification of the message MAC failed" |
| 7898 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7900 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7901 | "$P_SRV" \ |
| 7902 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7903 | psk_identity=foo psk=abc123" \ |
| 7904 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7905 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7906 | -S "SSL - Unknown identity received" \ |
| 7907 | -S "SSL - Verification of the message MAC failed" |
| 7908 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7910 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7911 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7912 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7913 | psk_identity=foo psk=abc123" \ |
| 7914 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7915 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7916 | -s "SSL - Unknown identity received" \ |
| 7917 | -S "SSL - Verification of the message MAC failed" |
| 7918 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7920 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7921 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7922 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7923 | psk_identity=abc psk=dead" \ |
| 7924 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7925 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7926 | -S "SSL - Unknown identity received" \ |
| 7927 | -S "SSL - Verification of the message MAC failed" |
| 7928 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7930 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7931 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7932 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7933 | psk_identity=def psk=beef" \ |
| 7934 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7935 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7936 | -S "SSL - Unknown identity received" \ |
| 7937 | -S "SSL - Verification of the message MAC failed" |
| 7938 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7940 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7941 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7942 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7943 | psk_identity=ghi psk=beef" \ |
| 7944 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7945 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7946 | -s "SSL - Unknown identity received" \ |
| 7947 | -S "SSL - Verification of the message MAC failed" |
| 7948 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7950 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7951 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7952 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7953 | psk_identity=abc psk=beef" \ |
| 7954 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7955 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7956 | -S "SSL - Unknown identity received" \ |
| 7957 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7958 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7959 | # Tests for EC J-PAKE |
| 7960 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7961 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7963 | run_test "ECJPAKE: client not configured" \ |
| 7964 | "$P_SRV debug_level=3" \ |
| 7965 | "$P_CLI debug_level=3" \ |
| 7966 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7967 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7968 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7969 | -S "found ecjpake kkpp extension" \ |
| 7970 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7971 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7972 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7973 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7974 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7975 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7976 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7978 | run_test "ECJPAKE: server not configured" \ |
| 7979 | "$P_SRV debug_level=3" \ |
| 7980 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7981 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7982 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7983 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7984 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7985 | -s "found ecjpake kkpp extension" \ |
| 7986 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7987 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7988 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7989 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7990 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7991 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7992 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7994 | run_test "ECJPAKE: working, TLS" \ |
| 7995 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7996 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7997 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7998 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7999 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8000 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8001 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8002 | -s "found ecjpake kkpp extension" \ |
| 8003 | -S "skip ecjpake kkpp extension" \ |
| 8004 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8005 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8006 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8007 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8008 | -S "SSL - Verification of the message MAC failed" |
| 8009 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8010 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8012 | run_test "ECJPAKE: working, TLS, opaque password" \ |
| 8013 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8014 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8015 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8016 | 0 \ |
| 8017 | -c "add ciphersuite: c0ff" \ |
| 8018 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame^] | 8019 | -c "using opaque password" \ |
| 8020 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8021 | -C "re-using cached ecjpake parameters" \ |
| 8022 | -s "found ecjpake kkpp extension" \ |
| 8023 | -S "skip ecjpake kkpp extension" \ |
| 8024 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8025 | -s "server hello, ecjpake kkpp extension" \ |
| 8026 | -c "found ecjpake_kkpp extension" \ |
| 8027 | -S "SSL - The handshake negotiation failed" \ |
| 8028 | -S "SSL - Verification of the message MAC failed" |
| 8029 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8030 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8031 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8033 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 8034 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8035 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 8036 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8037 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8038 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8039 | -s "SSL - Verification of the message MAC failed" |
| 8040 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8041 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8043 | run_test "ECJPAKE: working, DTLS" \ |
| 8044 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8045 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8046 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8047 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8048 | -c "re-using cached ecjpake parameters" \ |
| 8049 | -S "SSL - Verification of the message MAC failed" |
| 8050 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8051 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8053 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 8054 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 8055 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8056 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8057 | 0 \ |
| 8058 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8059 | -S "SSL - Verification of the message MAC failed" |
| 8060 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8061 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8062 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8064 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 8065 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8066 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 8067 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8068 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8069 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8070 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8071 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8072 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8073 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8075 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8076 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8077 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8078 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8079 | 0 |
| 8080 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8081 | # Test for ClientHello without extensions |
| 8082 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8083 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8085 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 8086 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8087 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8088 | 0 \ |
| 8089 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8090 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8091 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8092 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8093 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8095 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8096 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8097 | "$P_CLI request_size=100" \ |
| 8098 | 0 \ |
| 8099 | -s "Read from client: 100 bytes read$" |
| 8100 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8102 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8103 | "$P_SRV buffer_size=100" \ |
| 8104 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8105 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8106 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8107 | |
| 8108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8109 | requires_max_content_len 200 |
| 8110 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8111 | "$P_SRV buffer_size=100" \ |
| 8112 | "$P_CLI request_size=200" \ |
| 8113 | 0 \ |
| 8114 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8115 | |
| 8116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8117 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 8118 | "$P_SRV buffer_size=100" \ |
| 8119 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8120 | 0 \ |
| 8121 | -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] | 8122 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8123 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8124 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8125 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8126 | "$P_SRV force_version=tls12" \ |
| 8127 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8128 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8129 | 0 \ |
| 8130 | -s "Read from client: 1 bytes read" |
| 8131 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8132 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8133 | "$P_SRV force_version=tls12" \ |
| 8134 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8135 | 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] | 8136 | 0 \ |
| 8137 | -s "Read from client: 1 bytes read" |
| 8138 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8139 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8140 | "$P_SRV force_version=tls12" \ |
| 8141 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8142 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8143 | 0 \ |
| 8144 | -s "Read from client: 1 bytes read" |
| 8145 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8146 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8147 | "$P_SRV force_version=tls12" \ |
| 8148 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8149 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8150 | 0 \ |
| 8151 | -s "Read from client: 1 bytes read" |
| 8152 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8153 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8154 | "$P_SRV force_version=tls12" \ |
| 8155 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8156 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8157 | 0 \ |
| 8158 | -s "Read from client: 1 bytes read" |
| 8159 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8160 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8161 | run_test "Small client packet TLS 1.3 AEAD" \ |
| 8162 | "$P_SRV force_version=tls13" \ |
| 8163 | "$P_CLI request_size=1 \ |
| 8164 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8165 | 0 \ |
| 8166 | -s "Read from client: 1 bytes read" |
| 8167 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8168 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8169 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
| 8170 | "$P_SRV force_version=tls13" \ |
| 8171 | "$P_CLI request_size=1 \ |
| 8172 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8173 | 0 \ |
| 8174 | -s "Read from client: 1 bytes read" |
| 8175 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8176 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8177 | |
| 8178 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8179 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8180 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8181 | "$P_CLI dtls=1 request_size=1 \ |
| 8182 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8183 | 0 \ |
| 8184 | -s "Read from client: 1 bytes read" |
| 8185 | |
| 8186 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8187 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8188 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8189 | "$P_CLI dtls=1 request_size=1 \ |
| 8190 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8191 | 0 \ |
| 8192 | -s "Read from client: 1 bytes read" |
| 8193 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8194 | # Tests for small server packets |
| 8195 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8196 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8197 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8198 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8199 | 0 \ |
| 8200 | -c "Read from server: 1 bytes read" |
| 8201 | |
| 8202 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8203 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8204 | "$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] | 8205 | 0 \ |
| 8206 | -c "Read from server: 1 bytes read" |
| 8207 | |
| 8208 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8209 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8210 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8211 | 0 \ |
| 8212 | -c "Read from server: 1 bytes read" |
| 8213 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8214 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8215 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8216 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8217 | 0 \ |
| 8218 | -c "Read from server: 1 bytes read" |
| 8219 | |
| 8220 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8221 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8222 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8223 | 0 \ |
| 8224 | -c "Read from server: 1 bytes read" |
| 8225 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8226 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8227 | run_test "Small server packet TLS 1.3 AEAD" \ |
| 8228 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8229 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8230 | 0 \ |
| 8231 | -c "Read from server: 1 bytes read" |
| 8232 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8233 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8234 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
| 8235 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8236 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8237 | 0 \ |
| 8238 | -c "Read from server: 1 bytes read" |
| 8239 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8240 | # Tests for small server packets in DTLS |
| 8241 | |
| 8242 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8243 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8244 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8245 | "$P_CLI dtls=1 \ |
| 8246 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8247 | 0 \ |
| 8248 | -c "Read from server: 1 bytes read" |
| 8249 | |
| 8250 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8251 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8252 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8253 | "$P_CLI dtls=1 \ |
| 8254 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8255 | 0 \ |
| 8256 | -c "Read from server: 1 bytes read" |
| 8257 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8258 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8259 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8260 | # How many fragments do we expect to write $1 bytes? |
| 8261 | fragments_for_write() { |
| 8262 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8263 | } |
| 8264 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8265 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8266 | "$P_SRV force_version=tls12" \ |
| 8267 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8268 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8269 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8270 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8271 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8272 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8273 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8274 | "$P_SRV force_version=tls12" \ |
| 8275 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8276 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8277 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8278 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8279 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8280 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8281 | "$P_SRV force_version=tls12" \ |
| 8282 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8283 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8284 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8285 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8286 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8287 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8288 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8289 | "$P_SRV force_version=tls12" \ |
| 8290 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8291 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8292 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8293 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8294 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8295 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8296 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8297 | "$P_SRV force_version=tls12" \ |
| 8298 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8299 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8300 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8301 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8302 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8303 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8304 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8305 | run_test "Large client packet TLS 1.3 AEAD" \ |
| 8306 | "$P_SRV force_version=tls13" \ |
| 8307 | "$P_CLI request_size=16384 \ |
| 8308 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8309 | 0 \ |
| 8310 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8311 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8312 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8313 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8314 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
| 8315 | "$P_SRV force_version=tls13" \ |
| 8316 | "$P_CLI request_size=16384 \ |
| 8317 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8318 | 0 \ |
| 8319 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8320 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8321 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8322 | # 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] | 8323 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8324 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8325 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8326 | 0 \ |
| 8327 | -c "Read from server: 16384 bytes read" |
| 8328 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8329 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8330 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8331 | "$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] | 8332 | 0 \ |
| 8333 | -s "16384 bytes written in 1 fragments" \ |
| 8334 | -c "Read from server: 16384 bytes read" |
| 8335 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8336 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8337 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8338 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8339 | 0 \ |
| 8340 | -c "Read from server: 16384 bytes read" |
| 8341 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8342 | 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] | 8343 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8344 | "$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] | 8345 | 0 \ |
| 8346 | -s "16384 bytes written in 1 fragments" \ |
| 8347 | -c "Read from server: 16384 bytes read" |
| 8348 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8349 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8350 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8351 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8352 | 0 \ |
| 8353 | -c "Read from server: 16384 bytes read" |
| 8354 | |
| 8355 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8356 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8357 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8358 | 0 \ |
| 8359 | -c "Read from server: 16384 bytes read" |
| 8360 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8361 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8362 | run_test "Large server packet TLS 1.3 AEAD" \ |
| 8363 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8364 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8365 | 0 \ |
| 8366 | -c "Read from server: 16384 bytes read" |
| 8367 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8368 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8369 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
| 8370 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8371 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8372 | 0 \ |
| 8373 | -c "Read from server: 16384 bytes read" |
| 8374 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8375 | # Tests for restartable ECC |
| 8376 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8377 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8378 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8379 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8380 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8382 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8383 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8384 | "$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] | 8385 | 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] | 8386 | debug_level=1" \ |
| 8387 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8388 | -C "x509_verify_cert.*4b00" \ |
| 8389 | -C "mbedtls_pk_verify.*4b00" \ |
| 8390 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8391 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8392 | |
| 8393 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8394 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8396 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8397 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8398 | "$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] | 8399 | 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] | 8400 | debug_level=1 ec_max_ops=0" \ |
| 8401 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8402 | -C "x509_verify_cert.*4b00" \ |
| 8403 | -C "mbedtls_pk_verify.*4b00" \ |
| 8404 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8405 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8406 | |
| 8407 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8408 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8410 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8411 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8412 | "$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] | 8413 | 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] | 8414 | debug_level=1 ec_max_ops=65535" \ |
| 8415 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8416 | -C "x509_verify_cert.*4b00" \ |
| 8417 | -C "mbedtls_pk_verify.*4b00" \ |
| 8418 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8419 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8420 | |
| 8421 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8422 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8424 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8425 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8426 | "$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] | 8427 | 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] | 8428 | debug_level=1 ec_max_ops=1000" \ |
| 8429 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8430 | -c "x509_verify_cert.*4b00" \ |
| 8431 | -c "mbedtls_pk_verify.*4b00" \ |
| 8432 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8433 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8434 | |
| 8435 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8436 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8438 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8439 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8440 | crt_file=data_files/server5-badsign.crt \ |
| 8441 | key_file=data_files/server5.key" \ |
| 8442 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8443 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8444 | debug_level=1 ec_max_ops=1000" \ |
| 8445 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8446 | -c "x509_verify_cert.*4b00" \ |
| 8447 | -C "mbedtls_pk_verify.*4b00" \ |
| 8448 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8449 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8450 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8451 | -c "! mbedtls_ssl_handshake returned" \ |
| 8452 | -c "X509 - Certificate verification failed" |
| 8453 | |
| 8454 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8455 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8457 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8458 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8459 | crt_file=data_files/server5-badsign.crt \ |
| 8460 | key_file=data_files/server5.key" \ |
| 8461 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8462 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8463 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8464 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8465 | -c "x509_verify_cert.*4b00" \ |
| 8466 | -c "mbedtls_pk_verify.*4b00" \ |
| 8467 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8468 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8469 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8470 | -C "! mbedtls_ssl_handshake returned" \ |
| 8471 | -C "X509 - Certificate verification failed" |
| 8472 | |
| 8473 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8474 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8476 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8477 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8478 | crt_file=data_files/server5-badsign.crt \ |
| 8479 | key_file=data_files/server5.key" \ |
| 8480 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8481 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8482 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8483 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8484 | -C "x509_verify_cert.*4b00" \ |
| 8485 | -c "mbedtls_pk_verify.*4b00" \ |
| 8486 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8487 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8488 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8489 | -C "! mbedtls_ssl_handshake returned" \ |
| 8490 | -C "X509 - Certificate verification failed" |
| 8491 | |
| 8492 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8493 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8495 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8496 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8497 | "$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] | 8498 | 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] | 8499 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8500 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8501 | -c "x509_verify_cert.*4b00" \ |
| 8502 | -c "mbedtls_pk_verify.*4b00" \ |
| 8503 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8504 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8505 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8506 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8507 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8509 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8510 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8511 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8512 | debug_level=1 ec_max_ops=1000" \ |
| 8513 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8514 | -c "x509_verify_cert.*4b00" \ |
| 8515 | -c "mbedtls_pk_verify.*4b00" \ |
| 8516 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8517 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8518 | |
| 8519 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8520 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8522 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8523 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8524 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 8525 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 8526 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8527 | -C "x509_verify_cert.*4b00" \ |
| 8528 | -C "mbedtls_pk_verify.*4b00" \ |
| 8529 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8530 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8531 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8532 | # Tests of asynchronous private key support in SSL |
| 8533 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8534 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8536 | run_test "SSL async private: sign, delay=0" \ |
| 8537 | "$P_SRV \ |
| 8538 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8539 | "$P_CLI" \ |
| 8540 | 0 \ |
| 8541 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8542 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8543 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8544 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8546 | run_test "SSL async private: sign, delay=1" \ |
| 8547 | "$P_SRV \ |
| 8548 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8549 | "$P_CLI" \ |
| 8550 | 0 \ |
| 8551 | -s "Async sign callback: using key slot " \ |
| 8552 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8553 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8554 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8555 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8557 | run_test "SSL async private: sign, delay=2" \ |
| 8558 | "$P_SRV \ |
| 8559 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8560 | "$P_CLI" \ |
| 8561 | 0 \ |
| 8562 | -s "Async sign callback: using key slot " \ |
| 8563 | -U "Async sign callback: using key slot " \ |
| 8564 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8565 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8566 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8567 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8568 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8569 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8571 | run_test "SSL async private: sign, SNI" \ |
| 8572 | "$P_SRV debug_level=3 \ |
| 8573 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8574 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8575 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8576 | "$P_CLI server_name=polarssl.example" \ |
| 8577 | 0 \ |
| 8578 | -s "Async sign callback: using key slot " \ |
| 8579 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8580 | -s "parse ServerName extension" \ |
| 8581 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8582 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8583 | |
| 8584 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8586 | run_test "SSL async private: decrypt, delay=0" \ |
| 8587 | "$P_SRV \ |
| 8588 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8589 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8590 | 0 \ |
| 8591 | -s "Async decrypt callback: using key slot " \ |
| 8592 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8593 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8594 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8596 | run_test "SSL async private: decrypt, delay=1" \ |
| 8597 | "$P_SRV \ |
| 8598 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8599 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8600 | 0 \ |
| 8601 | -s "Async decrypt callback: using key slot " \ |
| 8602 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8603 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8604 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8605 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8607 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8608 | "$P_SRV psk=abc123 \ |
| 8609 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8610 | "$P_CLI psk=abc123 \ |
| 8611 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8612 | 0 \ |
| 8613 | -s "Async decrypt callback: using key slot " \ |
| 8614 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8615 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8616 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8618 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8619 | "$P_SRV psk=abc123 \ |
| 8620 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8621 | "$P_CLI psk=abc123 \ |
| 8622 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8623 | 0 \ |
| 8624 | -s "Async decrypt callback: using key slot " \ |
| 8625 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8626 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8627 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8628 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8630 | run_test "SSL async private: sign callback not present" \ |
| 8631 | "$P_SRV \ |
| 8632 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8633 | "$P_CLI; [ \$? -eq 1 ] && |
| 8634 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8635 | 0 \ |
| 8636 | -S "Async sign callback" \ |
| 8637 | -s "! mbedtls_ssl_handshake returned" \ |
| 8638 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8639 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8640 | -s "Successful connection" |
| 8641 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8642 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8644 | run_test "SSL async private: decrypt callback not present" \ |
| 8645 | "$P_SRV debug_level=1 \ |
| 8646 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8647 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 8648 | [ \$? -eq 1 ] && $P_CLI" \ |
| 8649 | 0 \ |
| 8650 | -S "Async decrypt callback" \ |
| 8651 | -s "! mbedtls_ssl_handshake returned" \ |
| 8652 | -s "got no RSA private key" \ |
| 8653 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8654 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8655 | |
| 8656 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8657 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8659 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8660 | "$P_SRV \ |
| 8661 | async_operations=s async_private_delay1=1 \ |
| 8662 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8663 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8664 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8665 | 0 \ |
| 8666 | -s "Async sign callback: using key slot 0," \ |
| 8667 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8668 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8669 | |
| 8670 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8671 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8673 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8674 | "$P_SRV \ |
| 8675 | async_operations=s async_private_delay2=1 \ |
| 8676 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8677 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8678 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8679 | 0 \ |
| 8680 | -s "Async sign callback: using key slot 0," \ |
| 8681 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8682 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8683 | |
| 8684 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8685 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8687 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8688 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8689 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8690 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8691 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8692 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8693 | 0 \ |
| 8694 | -s "Async sign callback: using key slot 1," \ |
| 8695 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8696 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8697 | |
| 8698 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8699 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8701 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8702 | "$P_SRV \ |
| 8703 | async_operations=s async_private_delay1=1 \ |
| 8704 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8705 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8706 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8707 | 0 \ |
| 8708 | -s "Async sign callback: no key matches this certificate." |
| 8709 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8710 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8712 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8713 | "$P_SRV \ |
| 8714 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8715 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8716 | "$P_CLI" \ |
| 8717 | 1 \ |
| 8718 | -s "Async sign callback: injected error" \ |
| 8719 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8720 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8721 | -s "! mbedtls_ssl_handshake returned" |
| 8722 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8723 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8725 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8726 | "$P_SRV \ |
| 8727 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8728 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8729 | "$P_CLI" \ |
| 8730 | 1 \ |
| 8731 | -s "Async sign callback: using key slot " \ |
| 8732 | -S "Async resume" \ |
| 8733 | -s "Async cancel" |
| 8734 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8735 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8737 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8738 | "$P_SRV \ |
| 8739 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8740 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8741 | "$P_CLI" \ |
| 8742 | 1 \ |
| 8743 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8744 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8745 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8746 | -s "! mbedtls_ssl_handshake returned" |
| 8747 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8748 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8750 | run_test "SSL async private: decrypt, error in start" \ |
| 8751 | "$P_SRV \ |
| 8752 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8753 | async_private_error=1" \ |
| 8754 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8755 | 1 \ |
| 8756 | -s "Async decrypt callback: injected error" \ |
| 8757 | -S "Async resume" \ |
| 8758 | -S "Async cancel" \ |
| 8759 | -s "! mbedtls_ssl_handshake returned" |
| 8760 | |
| 8761 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8763 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8764 | "$P_SRV \ |
| 8765 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8766 | async_private_error=2" \ |
| 8767 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8768 | 1 \ |
| 8769 | -s "Async decrypt callback: using key slot " \ |
| 8770 | -S "Async resume" \ |
| 8771 | -s "Async cancel" |
| 8772 | |
| 8773 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8775 | run_test "SSL async private: decrypt, error in resume" \ |
| 8776 | "$P_SRV \ |
| 8777 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8778 | async_private_error=3" \ |
| 8779 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8780 | 1 \ |
| 8781 | -s "Async decrypt callback: using key slot " \ |
| 8782 | -s "Async resume callback: decrypt done but injected error" \ |
| 8783 | -S "Async cancel" \ |
| 8784 | -s "! mbedtls_ssl_handshake returned" |
| 8785 | |
| 8786 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8788 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8789 | "$P_SRV \ |
| 8790 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8791 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8792 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8793 | 0 \ |
| 8794 | -s "Async cancel" \ |
| 8795 | -s "! mbedtls_ssl_handshake returned" \ |
| 8796 | -s "Async resume" \ |
| 8797 | -s "Successful connection" |
| 8798 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8799 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8801 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8802 | "$P_SRV \ |
| 8803 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8804 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8805 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8806 | 0 \ |
| 8807 | -s "! mbedtls_ssl_handshake returned" \ |
| 8808 | -s "Async resume" \ |
| 8809 | -s "Successful connection" |
| 8810 | |
| 8811 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8812 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8814 | 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] | 8815 | "$P_SRV \ |
| 8816 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8817 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8818 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8819 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8820 | [ \$? -eq 1 ] && |
| 8821 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8822 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8823 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8824 | -S "Async resume" \ |
| 8825 | -s "Async cancel" \ |
| 8826 | -s "! mbedtls_ssl_handshake returned" \ |
| 8827 | -s "Async sign callback: no key matches this certificate." \ |
| 8828 | -s "Successful connection" |
| 8829 | |
| 8830 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8831 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8833 | 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] | 8834 | "$P_SRV \ |
| 8835 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 8836 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8837 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8838 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8839 | [ \$? -eq 1 ] && |
| 8840 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8841 | 0 \ |
| 8842 | -s "Async resume" \ |
| 8843 | -s "! mbedtls_ssl_handshake returned" \ |
| 8844 | -s "Async sign callback: no key matches this certificate." \ |
| 8845 | -s "Successful connection" |
| 8846 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8847 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8848 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8850 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8851 | "$P_SRV \ |
| 8852 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8853 | exchanges=2 renegotiation=1" \ |
| 8854 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8855 | 0 \ |
| 8856 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8857 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8858 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8859 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8860 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8861 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8862 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8863 | "$P_SRV \ |
| 8864 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8865 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8866 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8867 | 0 \ |
| 8868 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8869 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8870 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8871 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8872 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8874 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8875 | "$P_SRV \ |
| 8876 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8877 | exchanges=2 renegotiation=1" \ |
| 8878 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8879 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8880 | 0 \ |
| 8881 | -s "Async decrypt callback: using key slot " \ |
| 8882 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8883 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8884 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8885 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8887 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8888 | "$P_SRV \ |
| 8889 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8890 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8891 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8892 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8893 | 0 \ |
| 8894 | -s "Async decrypt callback: using key slot " \ |
| 8895 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8896 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8897 | # Tests for ECC extensions (rfc 4492) |
| 8898 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8899 | requires_config_enabled MBEDTLS_AES_C |
| 8900 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8901 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8902 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8904 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8905 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8906 | "$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] | 8907 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8908 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8909 | -C "client hello, adding supported_point_formats extension" \ |
| 8910 | -S "found supported elliptic curves extension" \ |
| 8911 | -S "found supported point formats extension" |
| 8912 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8913 | requires_config_enabled MBEDTLS_AES_C |
| 8914 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8915 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8916 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8918 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8919 | "$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] | 8920 | "$P_CLI debug_level=3" \ |
| 8921 | 0 \ |
| 8922 | -C "found supported_point_formats extension" \ |
| 8923 | -S "server hello, supported_point_formats extension" |
| 8924 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8925 | requires_config_enabled MBEDTLS_AES_C |
| 8926 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8927 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8928 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8930 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8931 | "$P_SRV debug_level=3" \ |
| 8932 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8933 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8934 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8935 | -c "client hello, adding supported_point_formats extension" \ |
| 8936 | -s "found supported elliptic curves extension" \ |
| 8937 | -s "found supported point formats extension" |
| 8938 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8939 | requires_config_enabled MBEDTLS_AES_C |
| 8940 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8941 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8942 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8944 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8945 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8946 | "$P_CLI debug_level=3" \ |
| 8947 | 0 \ |
| 8948 | -c "found supported_point_formats extension" \ |
| 8949 | -s "server hello, supported_point_formats extension" |
| 8950 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8951 | # Tests for DTLS HelloVerifyRequest |
| 8952 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8953 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8954 | run_test "DTLS cookie: enabled" \ |
| 8955 | "$P_SRV dtls=1 debug_level=2" \ |
| 8956 | "$P_CLI dtls=1 debug_level=2" \ |
| 8957 | 0 \ |
| 8958 | -s "cookie verification failed" \ |
| 8959 | -s "cookie verification passed" \ |
| 8960 | -S "cookie verification skipped" \ |
| 8961 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8962 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8963 | -S "SSL - The requested feature is not available" |
| 8964 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8966 | run_test "DTLS cookie: disabled" \ |
| 8967 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8968 | "$P_CLI dtls=1 debug_level=2" \ |
| 8969 | 0 \ |
| 8970 | -S "cookie verification failed" \ |
| 8971 | -S "cookie verification passed" \ |
| 8972 | -s "cookie verification skipped" \ |
| 8973 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8974 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8975 | -S "SSL - The requested feature is not available" |
| 8976 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8978 | run_test "DTLS cookie: default (failing)" \ |
| 8979 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8980 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8981 | 1 \ |
| 8982 | -s "cookie verification failed" \ |
| 8983 | -S "cookie verification passed" \ |
| 8984 | -S "cookie verification skipped" \ |
| 8985 | -C "received hello verify request" \ |
| 8986 | -S "hello verification requested" \ |
| 8987 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8988 | |
| 8989 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8991 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8992 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8993 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8994 | 0 \ |
| 8995 | -s "cookie verification failed" \ |
| 8996 | -s "cookie verification passed" \ |
| 8997 | -S "cookie verification skipped" \ |
| 8998 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8999 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9000 | -S "SSL - The requested feature is not available" |
| 9001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9003 | run_test "DTLS cookie: enabled, nbio" \ |
| 9004 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 9005 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9006 | 0 \ |
| 9007 | -s "cookie verification failed" \ |
| 9008 | -s "cookie verification passed" \ |
| 9009 | -S "cookie verification skipped" \ |
| 9010 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9011 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9012 | -S "SSL - The requested feature is not available" |
| 9013 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9014 | # Tests for client reconnecting from the same port with DTLS |
| 9015 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9016 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9018 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9019 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9020 | "$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] | 9021 | 0 \ |
| 9022 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9023 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9024 | -S "Client initiated reconnection from same port" |
| 9025 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9026 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9028 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9029 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9030 | "$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] | 9031 | 0 \ |
| 9032 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9033 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9034 | -s "Client initiated reconnection from same port" |
| 9035 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9036 | 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] | 9037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9038 | 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] | 9039 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 9040 | "$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] | 9041 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9042 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9043 | -s "Client initiated reconnection from same port" |
| 9044 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9045 | 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] | 9046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9047 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 9048 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 9049 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 9050 | 0 \ |
| 9051 | -S "The operation timed out" \ |
| 9052 | -s "Client initiated reconnection from same port" |
| 9053 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9055 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 9056 | "$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] | 9057 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 9058 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9059 | -s "The operation timed out" \ |
| 9060 | -S "Client initiated reconnection from same port" |
| 9061 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9063 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 9064 | -p "$P_PXY inject_clihlo=1" \ |
| 9065 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 9066 | "$P_CLI dtls=1 exchanges=2" \ |
| 9067 | 0 \ |
| 9068 | -s "possible client reconnect from the same port" \ |
| 9069 | -S "Client initiated reconnection from same port" |
| 9070 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9071 | # Tests for various cases of client authentication with DTLS |
| 9072 | # (focused on handshake flows and message parsing) |
| 9073 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9075 | run_test "DTLS client auth: required" \ |
| 9076 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9077 | "$P_CLI dtls=1" \ |
| 9078 | 0 \ |
| 9079 | -s "Verifying peer X.509 certificate... ok" |
| 9080 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9082 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9083 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9084 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9085 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9086 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9087 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9089 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9090 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9091 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9092 | 0 \ |
| 9093 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9094 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9097 | run_test "DTLS wrong PSK: badmac alert" \ |
| 9098 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 9099 | "$P_CLI dtls=1 psk=abc124" \ |
| 9100 | 1 \ |
| 9101 | -s "SSL - Verification of the message MAC failed" \ |
| 9102 | -c "SSL - A fatal alert message was received from our peer" |
| 9103 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9104 | # Tests for receiving fragmented handshake messages with DTLS |
| 9105 | |
| 9106 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9108 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9109 | "$G_SRV -u --mtu 2048 -a" \ |
| 9110 | "$P_CLI dtls=1 debug_level=2" \ |
| 9111 | 0 \ |
| 9112 | -C "found fragmented DTLS handshake message" \ |
| 9113 | -C "error" |
| 9114 | |
| 9115 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9117 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9118 | "$G_SRV -u --mtu 512" \ |
| 9119 | "$P_CLI dtls=1 debug_level=2" \ |
| 9120 | 0 \ |
| 9121 | -c "found fragmented DTLS handshake message" \ |
| 9122 | -C "error" |
| 9123 | |
| 9124 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9126 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9127 | "$G_SRV -u --mtu 128" \ |
| 9128 | "$P_CLI dtls=1 debug_level=2" \ |
| 9129 | 0 \ |
| 9130 | -c "found fragmented DTLS handshake message" \ |
| 9131 | -C "error" |
| 9132 | |
| 9133 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9135 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9136 | "$G_SRV -u --mtu 128" \ |
| 9137 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9138 | 0 \ |
| 9139 | -c "found fragmented DTLS handshake message" \ |
| 9140 | -C "error" |
| 9141 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9142 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9143 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9145 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9146 | "$G_SRV -u --mtu 256" \ |
| 9147 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9148 | 0 \ |
| 9149 | -c "found fragmented DTLS handshake message" \ |
| 9150 | -c "client hello, adding renegotiation extension" \ |
| 9151 | -c "found renegotiation extension" \ |
| 9152 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9153 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9154 | -C "error" \ |
| 9155 | -s "Extra-header:" |
| 9156 | |
| 9157 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9158 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9160 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9161 | "$G_SRV -u --mtu 256" \ |
| 9162 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9163 | 0 \ |
| 9164 | -c "found fragmented DTLS handshake message" \ |
| 9165 | -c "client hello, adding renegotiation extension" \ |
| 9166 | -c "found renegotiation extension" \ |
| 9167 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9168 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9169 | -C "error" \ |
| 9170 | -s "Extra-header:" |
| 9171 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9173 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9174 | "$O_SRV -dtls -mtu 2048" \ |
| 9175 | "$P_CLI dtls=1 debug_level=2" \ |
| 9176 | 0 \ |
| 9177 | -C "found fragmented DTLS handshake message" \ |
| 9178 | -C "error" |
| 9179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9181 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 9182 | "$O_SRV -dtls -mtu 768" \ |
| 9183 | "$P_CLI dtls=1 debug_level=2" \ |
| 9184 | 0 \ |
| 9185 | -c "found fragmented DTLS handshake message" \ |
| 9186 | -C "error" |
| 9187 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9189 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9190 | "$O_SRV -dtls -mtu 256" \ |
| 9191 | "$P_CLI dtls=1 debug_level=2" \ |
| 9192 | 0 \ |
| 9193 | -c "found fragmented DTLS handshake message" \ |
| 9194 | -C "error" |
| 9195 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9196 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9197 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9198 | "$O_SRV -dtls -mtu 256" \ |
| 9199 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9200 | 0 \ |
| 9201 | -c "found fragmented DTLS handshake message" \ |
| 9202 | -C "error" |
| 9203 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9204 | # Tests for sending fragmented handshake messages with DTLS |
| 9205 | # |
| 9206 | # Use client auth when we need the client to send large messages, |
| 9207 | # and use large cert chains on both sides too (the long chains we have all use |
| 9208 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9209 | # Sizes reached (UDP payload): |
| 9210 | # - 2037B for server certificate |
| 9211 | # - 1542B for client certificate |
| 9212 | # - 1013B for newsessionticket |
| 9213 | # - all others below 512B |
| 9214 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9215 | |
| 9216 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9217 | requires_config_enabled MBEDTLS_RSA_C |
| 9218 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9219 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9220 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9222 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9223 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9224 | crt_file=data_files/server7_int-ca.crt \ |
| 9225 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9226 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9227 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9228 | "$P_CLI dtls=1 debug_level=2 \ |
| 9229 | crt_file=data_files/server8_int-ca2.crt \ |
| 9230 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9231 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9232 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9233 | 0 \ |
| 9234 | -S "found fragmented DTLS handshake message" \ |
| 9235 | -C "found fragmented DTLS handshake message" \ |
| 9236 | -C "error" |
| 9237 | |
| 9238 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9239 | requires_config_enabled MBEDTLS_RSA_C |
| 9240 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9241 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9242 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9244 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9245 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9246 | crt_file=data_files/server7_int-ca.crt \ |
| 9247 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9248 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9249 | max_frag_len=1024" \ |
| 9250 | "$P_CLI dtls=1 debug_level=2 \ |
| 9251 | crt_file=data_files/server8_int-ca2.crt \ |
| 9252 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9253 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9254 | max_frag_len=2048" \ |
| 9255 | 0 \ |
| 9256 | -S "found fragmented DTLS handshake message" \ |
| 9257 | -c "found fragmented DTLS handshake message" \ |
| 9258 | -C "error" |
| 9259 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9260 | # With the MFL extension, the server has no way of forcing |
| 9261 | # the client to not exceed a certain MTU; hence, the following |
| 9262 | # test can't be replicated with an MTU proxy such as the one |
| 9263 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9264 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9265 | requires_config_enabled MBEDTLS_RSA_C |
| 9266 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9267 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9268 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9270 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9271 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9272 | crt_file=data_files/server7_int-ca.crt \ |
| 9273 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9274 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9275 | max_frag_len=512" \ |
| 9276 | "$P_CLI dtls=1 debug_level=2 \ |
| 9277 | crt_file=data_files/server8_int-ca2.crt \ |
| 9278 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9279 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9280 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9281 | 0 \ |
| 9282 | -S "found fragmented DTLS handshake message" \ |
| 9283 | -c "found fragmented DTLS handshake message" \ |
| 9284 | -C "error" |
| 9285 | |
| 9286 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9287 | requires_config_enabled MBEDTLS_RSA_C |
| 9288 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9289 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9290 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9292 | 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] | 9293 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9294 | crt_file=data_files/server7_int-ca.crt \ |
| 9295 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9296 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9297 | max_frag_len=2048" \ |
| 9298 | "$P_CLI dtls=1 debug_level=2 \ |
| 9299 | crt_file=data_files/server8_int-ca2.crt \ |
| 9300 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9301 | hs_timeout=2500-60000 \ |
| 9302 | max_frag_len=1024" \ |
| 9303 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9304 | -S "found fragmented DTLS handshake message" \ |
| 9305 | -c "found fragmented DTLS handshake message" \ |
| 9306 | -C "error" |
| 9307 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9308 | # While not required by the standard defining the MFL extension |
| 9309 | # (according to which it only applies to records, not to datagrams), |
| 9310 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9311 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9312 | # to the peer. |
| 9313 | # The next test checks that no datagrams significantly larger than the |
| 9314 | # negotiated MFL are sent. |
| 9315 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9316 | requires_config_enabled MBEDTLS_RSA_C |
| 9317 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9318 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9319 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9321 | 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] | 9322 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9323 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9324 | crt_file=data_files/server7_int-ca.crt \ |
| 9325 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9326 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9327 | max_frag_len=2048" \ |
| 9328 | "$P_CLI dtls=1 debug_level=2 \ |
| 9329 | crt_file=data_files/server8_int-ca2.crt \ |
| 9330 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9331 | hs_timeout=2500-60000 \ |
| 9332 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9333 | 0 \ |
| 9334 | -S "found fragmented DTLS handshake message" \ |
| 9335 | -c "found fragmented DTLS handshake message" \ |
| 9336 | -C "error" |
| 9337 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9338 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9339 | requires_config_enabled MBEDTLS_RSA_C |
| 9340 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9341 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9342 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9344 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9345 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9346 | crt_file=data_files/server7_int-ca.crt \ |
| 9347 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9348 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9349 | max_frag_len=2048" \ |
| 9350 | "$P_CLI dtls=1 debug_level=2 \ |
| 9351 | crt_file=data_files/server8_int-ca2.crt \ |
| 9352 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9353 | hs_timeout=2500-60000 \ |
| 9354 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9355 | 0 \ |
| 9356 | -s "found fragmented DTLS handshake message" \ |
| 9357 | -c "found fragmented DTLS handshake message" \ |
| 9358 | -C "error" |
| 9359 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9360 | # While not required by the standard defining the MFL extension |
| 9361 | # (according to which it only applies to records, not to datagrams), |
| 9362 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9363 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9364 | # to the peer. |
| 9365 | # The next test checks that no datagrams significantly larger than the |
| 9366 | # negotiated MFL are sent. |
| 9367 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9368 | requires_config_enabled MBEDTLS_RSA_C |
| 9369 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9370 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9371 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9373 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9374 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9375 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9376 | crt_file=data_files/server7_int-ca.crt \ |
| 9377 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9378 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9379 | max_frag_len=2048" \ |
| 9380 | "$P_CLI dtls=1 debug_level=2 \ |
| 9381 | crt_file=data_files/server8_int-ca2.crt \ |
| 9382 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9383 | hs_timeout=2500-60000 \ |
| 9384 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9385 | 0 \ |
| 9386 | -s "found fragmented DTLS handshake message" \ |
| 9387 | -c "found fragmented DTLS handshake message" \ |
| 9388 | -C "error" |
| 9389 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9390 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9391 | requires_config_enabled MBEDTLS_RSA_C |
| 9392 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9393 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9395 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9396 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9397 | crt_file=data_files/server7_int-ca.crt \ |
| 9398 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9399 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9400 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9401 | "$P_CLI dtls=1 debug_level=2 \ |
| 9402 | crt_file=data_files/server8_int-ca2.crt \ |
| 9403 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9404 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9405 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9406 | 0 \ |
| 9407 | -S "found fragmented DTLS handshake message" \ |
| 9408 | -C "found fragmented DTLS handshake message" \ |
| 9409 | -C "error" |
| 9410 | |
| 9411 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9412 | requires_config_enabled MBEDTLS_RSA_C |
| 9413 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9414 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9416 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9417 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9418 | crt_file=data_files/server7_int-ca.crt \ |
| 9419 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9420 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9421 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9422 | "$P_CLI dtls=1 debug_level=2 \ |
| 9423 | crt_file=data_files/server8_int-ca2.crt \ |
| 9424 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9425 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9426 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9427 | 0 \ |
| 9428 | -s "found fragmented DTLS handshake message" \ |
| 9429 | -C "found fragmented DTLS handshake message" \ |
| 9430 | -C "error" |
| 9431 | |
| 9432 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9433 | requires_config_enabled MBEDTLS_RSA_C |
| 9434 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9435 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9437 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9438 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9439 | crt_file=data_files/server7_int-ca.crt \ |
| 9440 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9441 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9442 | mtu=512" \ |
| 9443 | "$P_CLI dtls=1 debug_level=2 \ |
| 9444 | crt_file=data_files/server8_int-ca2.crt \ |
| 9445 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9446 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9447 | mtu=2048" \ |
| 9448 | 0 \ |
| 9449 | -S "found fragmented DTLS handshake message" \ |
| 9450 | -c "found fragmented DTLS handshake message" \ |
| 9451 | -C "error" |
| 9452 | |
| 9453 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9454 | requires_config_enabled MBEDTLS_RSA_C |
| 9455 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9456 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9458 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9459 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9460 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9461 | crt_file=data_files/server7_int-ca.crt \ |
| 9462 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9463 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9464 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9465 | "$P_CLI dtls=1 debug_level=2 \ |
| 9466 | crt_file=data_files/server8_int-ca2.crt \ |
| 9467 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9468 | hs_timeout=2500-60000 \ |
| 9469 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9470 | 0 \ |
| 9471 | -s "found fragmented DTLS handshake message" \ |
| 9472 | -c "found fragmented DTLS handshake message" \ |
| 9473 | -C "error" |
| 9474 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9475 | # 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] | 9476 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9477 | requires_config_enabled MBEDTLS_RSA_C |
| 9478 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9479 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9480 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9481 | requires_config_enabled MBEDTLS_AES_C |
| 9482 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9483 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9485 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9486 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9487 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9488 | crt_file=data_files/server7_int-ca.crt \ |
| 9489 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9490 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9491 | mtu=512" \ |
| 9492 | "$P_CLI dtls=1 debug_level=2 \ |
| 9493 | crt_file=data_files/server8_int-ca2.crt \ |
| 9494 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9495 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9496 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9497 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9498 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9499 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9500 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9501 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9502 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9503 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9504 | # 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] | 9505 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9506 | # retransmissions, but in some cases (like both the server and client using |
| 9507 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9508 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9509 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9510 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9511 | requires_config_enabled MBEDTLS_RSA_C |
| 9512 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9513 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9514 | requires_config_enabled MBEDTLS_AES_C |
| 9515 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9516 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9518 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9519 | -p "$P_PXY mtu=508" \ |
| 9520 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9521 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9522 | key_file=data_files/server7.key \ |
| 9523 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9524 | "$P_CLI dtls=1 debug_level=2 \ |
| 9525 | crt_file=data_files/server8_int-ca2.crt \ |
| 9526 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9527 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9528 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9529 | 0 \ |
| 9530 | -s "found fragmented DTLS handshake message" \ |
| 9531 | -c "found fragmented DTLS handshake message" \ |
| 9532 | -C "error" |
| 9533 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9534 | # 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] | 9535 | only_with_valgrind |
| 9536 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9537 | requires_config_enabled MBEDTLS_RSA_C |
| 9538 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9539 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9540 | requires_config_enabled MBEDTLS_AES_C |
| 9541 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9542 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9544 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9545 | -p "$P_PXY mtu=508" \ |
| 9546 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9547 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9548 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9549 | hs_timeout=250-10000" \ |
| 9550 | "$P_CLI dtls=1 debug_level=2 \ |
| 9551 | crt_file=data_files/server8_int-ca2.crt \ |
| 9552 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9553 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9554 | hs_timeout=250-10000" \ |
| 9555 | 0 \ |
| 9556 | -s "found fragmented DTLS handshake message" \ |
| 9557 | -c "found fragmented DTLS handshake message" \ |
| 9558 | -C "error" |
| 9559 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9560 | # 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] | 9561 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9562 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9563 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9564 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9565 | requires_config_enabled MBEDTLS_RSA_C |
| 9566 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9567 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9569 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9570 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9571 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9572 | crt_file=data_files/server7_int-ca.crt \ |
| 9573 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9574 | hs_timeout=10000-60000 \ |
| 9575 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9576 | "$P_CLI dtls=1 debug_level=2 \ |
| 9577 | crt_file=data_files/server8_int-ca2.crt \ |
| 9578 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9579 | hs_timeout=10000-60000 \ |
| 9580 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9581 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9582 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9583 | -s "found fragmented DTLS handshake message" \ |
| 9584 | -c "found fragmented DTLS handshake message" \ |
| 9585 | -C "error" |
| 9586 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9587 | # 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] | 9588 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9589 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9590 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9591 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9592 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9593 | requires_config_enabled MBEDTLS_RSA_C |
| 9594 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9595 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9596 | requires_config_enabled MBEDTLS_AES_C |
| 9597 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9598 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9600 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9601 | -p "$P_PXY mtu=512" \ |
| 9602 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9603 | crt_file=data_files/server7_int-ca.crt \ |
| 9604 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9605 | hs_timeout=10000-60000 \ |
| 9606 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9607 | "$P_CLI dtls=1 debug_level=2 \ |
| 9608 | crt_file=data_files/server8_int-ca2.crt \ |
| 9609 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9610 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9611 | hs_timeout=10000-60000 \ |
| 9612 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9613 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9614 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9615 | -s "found fragmented DTLS handshake message" \ |
| 9616 | -c "found fragmented DTLS handshake message" \ |
| 9617 | -C "error" |
| 9618 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9619 | not_with_valgrind # spurious autoreduction due to timeout |
| 9620 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9621 | requires_config_enabled MBEDTLS_RSA_C |
| 9622 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9623 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9625 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9626 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9627 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9628 | crt_file=data_files/server7_int-ca.crt \ |
| 9629 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9630 | hs_timeout=10000-60000 \ |
| 9631 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9632 | "$P_CLI dtls=1 debug_level=2 \ |
| 9633 | crt_file=data_files/server8_int-ca2.crt \ |
| 9634 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9635 | hs_timeout=10000-60000 \ |
| 9636 | mtu=1024 nbio=2" \ |
| 9637 | 0 \ |
| 9638 | -S "autoreduction" \ |
| 9639 | -s "found fragmented DTLS handshake message" \ |
| 9640 | -c "found fragmented DTLS handshake message" \ |
| 9641 | -C "error" |
| 9642 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9643 | # 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] | 9644 | not_with_valgrind # spurious autoreduction due to timeout |
| 9645 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9646 | requires_config_enabled MBEDTLS_RSA_C |
| 9647 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9648 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9649 | requires_config_enabled MBEDTLS_AES_C |
| 9650 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9651 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9653 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9654 | -p "$P_PXY mtu=512" \ |
| 9655 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9656 | crt_file=data_files/server7_int-ca.crt \ |
| 9657 | key_file=data_files/server7.key \ |
| 9658 | hs_timeout=10000-60000 \ |
| 9659 | mtu=512 nbio=2" \ |
| 9660 | "$P_CLI dtls=1 debug_level=2 \ |
| 9661 | crt_file=data_files/server8_int-ca2.crt \ |
| 9662 | key_file=data_files/server8.key \ |
| 9663 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9664 | hs_timeout=10000-60000 \ |
| 9665 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9666 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9667 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9668 | -s "found fragmented DTLS handshake message" \ |
| 9669 | -c "found fragmented DTLS handshake message" \ |
| 9670 | -C "error" |
| 9671 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9672 | # 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] | 9673 | # This ensures things still work after session_reset(). |
| 9674 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9675 | # Since we don't support reading fragmented ClientHello yet, |
| 9676 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9677 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9678 | # An autoreduction on the client-side might happen if the server is |
| 9679 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9680 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9681 | # resumed listening, which would result in a spurious autoreduction. |
| 9682 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9683 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9684 | requires_config_enabled MBEDTLS_RSA_C |
| 9685 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9686 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9687 | requires_config_enabled MBEDTLS_AES_C |
| 9688 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9689 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9691 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9692 | -p "$P_PXY mtu=1450" \ |
| 9693 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9694 | crt_file=data_files/server7_int-ca.crt \ |
| 9695 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9696 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9697 | mtu=1450" \ |
| 9698 | "$P_CLI dtls=1 debug_level=2 \ |
| 9699 | crt_file=data_files/server8_int-ca2.crt \ |
| 9700 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9701 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9702 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9703 | 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] | 9704 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9705 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9706 | -s "found fragmented DTLS handshake message" \ |
| 9707 | -c "found fragmented DTLS handshake message" \ |
| 9708 | -C "error" |
| 9709 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9710 | # An autoreduction on the client-side might happen if the server is |
| 9711 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9712 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9713 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9714 | requires_config_enabled MBEDTLS_RSA_C |
| 9715 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9716 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9717 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9718 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9719 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9720 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9722 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9723 | -p "$P_PXY mtu=512" \ |
| 9724 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9725 | crt_file=data_files/server7_int-ca.crt \ |
| 9726 | key_file=data_files/server7.key \ |
| 9727 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9728 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9729 | mtu=512" \ |
| 9730 | "$P_CLI dtls=1 debug_level=2 \ |
| 9731 | crt_file=data_files/server8_int-ca2.crt \ |
| 9732 | key_file=data_files/server8.key \ |
| 9733 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9734 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9735 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9736 | mtu=512" \ |
| 9737 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9738 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9739 | -s "found fragmented DTLS handshake message" \ |
| 9740 | -c "found fragmented DTLS handshake message" \ |
| 9741 | -C "error" |
| 9742 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9743 | # An autoreduction on the client-side might happen if the server is |
| 9744 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9745 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9746 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9747 | requires_config_enabled MBEDTLS_RSA_C |
| 9748 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9749 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9750 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9751 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9752 | requires_config_enabled MBEDTLS_AES_C |
| 9753 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9754 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9756 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9757 | -p "$P_PXY mtu=512" \ |
| 9758 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9759 | crt_file=data_files/server7_int-ca.crt \ |
| 9760 | key_file=data_files/server7.key \ |
| 9761 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9762 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9763 | mtu=512" \ |
| 9764 | "$P_CLI dtls=1 debug_level=2 \ |
| 9765 | crt_file=data_files/server8_int-ca2.crt \ |
| 9766 | key_file=data_files/server8.key \ |
| 9767 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9768 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9769 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9770 | mtu=512" \ |
| 9771 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9772 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9773 | -s "found fragmented DTLS handshake message" \ |
| 9774 | -c "found fragmented DTLS handshake message" \ |
| 9775 | -C "error" |
| 9776 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9777 | # An autoreduction on the client-side might happen if the server is |
| 9778 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9779 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9780 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9781 | requires_config_enabled MBEDTLS_RSA_C |
| 9782 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9783 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9784 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9785 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9786 | requires_config_enabled MBEDTLS_AES_C |
| 9787 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9788 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9790 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9791 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9792 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9793 | crt_file=data_files/server7_int-ca.crt \ |
| 9794 | key_file=data_files/server7.key \ |
| 9795 | exchanges=2 renegotiation=1 \ |
| 9796 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9797 | hs_timeout=10000-60000 \ |
| 9798 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9799 | "$P_CLI dtls=1 debug_level=2 \ |
| 9800 | crt_file=data_files/server8_int-ca2.crt \ |
| 9801 | key_file=data_files/server8.key \ |
| 9802 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9803 | hs_timeout=10000-60000 \ |
| 9804 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9805 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9806 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9807 | -s "found fragmented DTLS handshake message" \ |
| 9808 | -c "found fragmented DTLS handshake message" \ |
| 9809 | -C "error" |
| 9810 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9811 | # An autoreduction on the client-side might happen if the server is |
| 9812 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9813 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9814 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9815 | requires_config_enabled MBEDTLS_RSA_C |
| 9816 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9817 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9818 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9819 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9820 | requires_config_enabled MBEDTLS_AES_C |
| 9821 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9822 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9823 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9825 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9826 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9827 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9828 | crt_file=data_files/server7_int-ca.crt \ |
| 9829 | key_file=data_files/server7.key \ |
| 9830 | exchanges=2 renegotiation=1 \ |
| 9831 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9832 | hs_timeout=10000-60000 \ |
| 9833 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9834 | "$P_CLI dtls=1 debug_level=2 \ |
| 9835 | crt_file=data_files/server8_int-ca2.crt \ |
| 9836 | key_file=data_files/server8.key \ |
| 9837 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9838 | hs_timeout=10000-60000 \ |
| 9839 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9840 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9841 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9842 | -s "found fragmented DTLS handshake message" \ |
| 9843 | -c "found fragmented DTLS handshake message" \ |
| 9844 | -C "error" |
| 9845 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9846 | # An autoreduction on the client-side might happen if the server is |
| 9847 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9848 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9849 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9850 | requires_config_enabled MBEDTLS_RSA_C |
| 9851 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9852 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9853 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9854 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9855 | requires_config_enabled MBEDTLS_AES_C |
| 9856 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9857 | requires_max_content_len 2048 |
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 | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9859 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9860 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9861 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9862 | crt_file=data_files/server7_int-ca.crt \ |
| 9863 | key_file=data_files/server7.key \ |
| 9864 | exchanges=2 renegotiation=1 \ |
| 9865 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9866 | hs_timeout=10000-60000 \ |
| 9867 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9868 | "$P_CLI dtls=1 debug_level=2 \ |
| 9869 | crt_file=data_files/server8_int-ca2.crt \ |
| 9870 | key_file=data_files/server8.key \ |
| 9871 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9872 | hs_timeout=10000-60000 \ |
| 9873 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9874 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9875 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9876 | -s "found fragmented DTLS handshake message" \ |
| 9877 | -c "found fragmented DTLS handshake message" \ |
| 9878 | -C "error" |
| 9879 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9880 | # 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] | 9881 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9882 | requires_config_enabled MBEDTLS_RSA_C |
| 9883 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9884 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9885 | requires_config_enabled MBEDTLS_AES_C |
| 9886 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9887 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9888 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9890 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9891 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9892 | "$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] | 9893 | crt_file=data_files/server7_int-ca.crt \ |
| 9894 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9895 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9896 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9897 | crt_file=data_files/server8_int-ca2.crt \ |
| 9898 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9899 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9900 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9901 | 0 \ |
| 9902 | -s "found fragmented DTLS handshake message" \ |
| 9903 | -c "found fragmented DTLS handshake message" \ |
| 9904 | -C "error" |
| 9905 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9906 | # 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] | 9907 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9908 | requires_config_enabled MBEDTLS_RSA_C |
| 9909 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9910 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9911 | requires_config_enabled MBEDTLS_AES_C |
| 9912 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9913 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9914 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9916 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9917 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9918 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9919 | crt_file=data_files/server7_int-ca.crt \ |
| 9920 | key_file=data_files/server7.key \ |
| 9921 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9922 | "$P_CLI dtls=1 debug_level=2 \ |
| 9923 | crt_file=data_files/server8_int-ca2.crt \ |
| 9924 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9925 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9926 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9927 | 0 \ |
| 9928 | -s "found fragmented DTLS handshake message" \ |
| 9929 | -c "found fragmented DTLS handshake message" \ |
| 9930 | -C "error" |
| 9931 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9932 | # interop tests for DTLS fragmentating with reliable connection |
| 9933 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9934 | # here and below we just want to test that the we fragment in a way that |
| 9935 | # pleases other implementations, so we don't need the peer to fragment |
| 9936 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9937 | requires_config_enabled MBEDTLS_RSA_C |
| 9938 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9939 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9940 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9941 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9942 | "$G_SRV -u" \ |
| 9943 | "$P_CLI dtls=1 debug_level=2 \ |
| 9944 | crt_file=data_files/server8_int-ca2.crt \ |
| 9945 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9946 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9947 | 0 \ |
| 9948 | -c "fragmenting handshake message" \ |
| 9949 | -C "error" |
| 9950 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9951 | # We use --insecure for the GnuTLS client because it expects |
| 9952 | # the hostname / IP it connects to to be the name used in the |
| 9953 | # certificate obtained from the server. Here, however, it |
| 9954 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9955 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9956 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9957 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9958 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9959 | requires_config_enabled MBEDTLS_RSA_C |
| 9960 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9961 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9962 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9963 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9964 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9965 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9966 | crt_file=data_files/server7_int-ca.crt \ |
| 9967 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9968 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9969 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9970 | 0 \ |
| 9971 | -s "fragmenting handshake message" |
| 9972 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9973 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9974 | requires_config_enabled MBEDTLS_RSA_C |
| 9975 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9976 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9977 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9978 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9979 | "$P_CLI dtls=1 debug_level=2 \ |
| 9980 | crt_file=data_files/server8_int-ca2.crt \ |
| 9981 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9982 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9983 | 0 \ |
| 9984 | -c "fragmenting handshake message" \ |
| 9985 | -C "error" |
| 9986 | |
| 9987 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9988 | requires_config_enabled MBEDTLS_RSA_C |
| 9989 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9990 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9991 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9992 | "$P_SRV dtls=1 debug_level=2 \ |
| 9993 | crt_file=data_files/server7_int-ca.crt \ |
| 9994 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9995 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9996 | "$O_CLI -dtls1_2" \ |
| 9997 | 0 \ |
| 9998 | -s "fragmenting handshake message" |
| 9999 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10000 | # interop tests for DTLS fragmentating with unreliable connection |
| 10001 | # |
| 10002 | # again we just want to test that the we fragment in a way that |
| 10003 | # pleases other implementations, so we don't need the peer to fragment |
| 10004 | requires_gnutls_next |
| 10005 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10006 | requires_config_enabled MBEDTLS_RSA_C |
| 10007 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10008 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10009 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10010 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 10011 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10012 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10013 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10014 | crt_file=data_files/server8_int-ca2.crt \ |
| 10015 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10016 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10017 | 0 \ |
| 10018 | -c "fragmenting handshake message" \ |
| 10019 | -C "error" |
| 10020 | |
| 10021 | requires_gnutls_next |
| 10022 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10023 | requires_config_enabled MBEDTLS_RSA_C |
| 10024 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10025 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10026 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10027 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 10028 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10029 | "$P_SRV dtls=1 debug_level=2 \ |
| 10030 | crt_file=data_files/server7_int-ca.crt \ |
| 10031 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10032 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10033 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10034 | 0 \ |
| 10035 | -s "fragmenting handshake message" |
| 10036 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 10037 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 10038 | ## it might trigger a bug due to openssl server (https://github.com/openssl/openssl/issues/6902) |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10039 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10040 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10041 | requires_config_enabled MBEDTLS_RSA_C |
| 10042 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10043 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10044 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10045 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 10046 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10047 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10048 | "$P_CLI dtls=1 debug_level=2 \ |
| 10049 | crt_file=data_files/server8_int-ca2.crt \ |
| 10050 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10051 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10052 | 0 \ |
| 10053 | -c "fragmenting handshake message" \ |
| 10054 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10055 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10056 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10057 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 10058 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10059 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10060 | requires_config_enabled MBEDTLS_RSA_C |
| 10061 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10062 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10063 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10064 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 10065 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10066 | "$P_SRV dtls=1 debug_level=2 \ |
| 10067 | crt_file=data_files/server7_int-ca.crt \ |
| 10068 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10069 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10070 | "$O_CLI -dtls1_2" \ |
| 10071 | 0 \ |
| 10072 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10073 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10074 | # Tests for DTLS-SRTP (RFC 5764) |
| 10075 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10077 | run_test "DTLS-SRTP all profiles supported" \ |
| 10078 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10079 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10080 | 0 \ |
| 10081 | -s "found use_srtp extension" \ |
| 10082 | -s "found srtp profile" \ |
| 10083 | -s "selected srtp profile" \ |
| 10084 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10085 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10086 | -c "client hello, adding use_srtp extension" \ |
| 10087 | -c "found use_srtp extension" \ |
| 10088 | -c "found srtp profile" \ |
| 10089 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10090 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10091 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10092 | -C "error" |
| 10093 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10094 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10095 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10097 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10098 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10099 | "$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] | 10100 | 0 \ |
| 10101 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10102 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10103 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10104 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10105 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10106 | -c "client hello, adding use_srtp extension" \ |
| 10107 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10108 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10109 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10110 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10111 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10112 | -C "error" |
| 10113 | |
| 10114 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10116 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10117 | "$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] | 10118 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10119 | 0 \ |
| 10120 | -s "found use_srtp extension" \ |
| 10121 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10122 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10123 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10124 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10125 | -c "client hello, adding use_srtp extension" \ |
| 10126 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10127 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10128 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10129 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10130 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10131 | -C "error" |
| 10132 | |
| 10133 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10135 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10136 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10137 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10138 | 0 \ |
| 10139 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10140 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10141 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10142 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10143 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10144 | -c "client hello, adding use_srtp extension" \ |
| 10145 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10146 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10147 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10148 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10149 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10150 | -C "error" |
| 10151 | |
| 10152 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10154 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10155 | "$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] | 10156 | "$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] | 10157 | 0 \ |
| 10158 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10159 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10160 | -S "selected srtp profile" \ |
| 10161 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10162 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10163 | -c "client hello, adding use_srtp extension" \ |
| 10164 | -C "found use_srtp extension" \ |
| 10165 | -C "found srtp profile" \ |
| 10166 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10167 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10168 | -C "error" |
| 10169 | |
| 10170 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10172 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10173 | "$P_SRV dtls=1 debug_level=3" \ |
| 10174 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10175 | 0 \ |
| 10176 | -s "found use_srtp extension" \ |
| 10177 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10178 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10179 | -c "client hello, adding use_srtp extension" \ |
| 10180 | -C "found use_srtp extension" \ |
| 10181 | -C "found srtp profile" \ |
| 10182 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10183 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10184 | -C "error" |
| 10185 | |
| 10186 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10188 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10189 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10190 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10191 | 0 \ |
| 10192 | -s "found use_srtp extension" \ |
| 10193 | -s "found srtp profile" \ |
| 10194 | -s "selected srtp profile" \ |
| 10195 | -s "server hello, adding use_srtp extension" \ |
| 10196 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10197 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10198 | -c "client hello, adding use_srtp extension" \ |
| 10199 | -c "found use_srtp extension" \ |
| 10200 | -c "found srtp profile" \ |
| 10201 | -c "selected srtp profile" \ |
| 10202 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10203 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10204 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10205 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10206 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10207 | -C "error" |
| 10208 | |
| 10209 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10211 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10212 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10213 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10214 | 0 \ |
| 10215 | -s "found use_srtp extension" \ |
| 10216 | -s "found srtp profile" \ |
| 10217 | -s "selected srtp profile" \ |
| 10218 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10219 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10220 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10221 | -S "dumping 'using mki' (8 bytes)" \ |
| 10222 | -c "client hello, adding use_srtp extension" \ |
| 10223 | -c "found use_srtp extension" \ |
| 10224 | -c "found srtp profile" \ |
| 10225 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10226 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10227 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10228 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10229 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10230 | -C "dumping 'received mki' (8 bytes)" \ |
| 10231 | -C "error" |
| 10232 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10233 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10235 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10236 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10237 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10238 | 0 \ |
| 10239 | -s "found use_srtp extension" \ |
| 10240 | -s "found srtp profile" \ |
| 10241 | -s "selected srtp profile" \ |
| 10242 | -s "server hello, adding use_srtp extension" \ |
| 10243 | -s "DTLS-SRTP key material is"\ |
| 10244 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10245 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10246 | |
| 10247 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10249 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10250 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10251 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10252 | 0 \ |
| 10253 | -s "found use_srtp extension" \ |
| 10254 | -s "found srtp profile" \ |
| 10255 | -s "selected srtp profile" \ |
| 10256 | -s "server hello, adding use_srtp extension" \ |
| 10257 | -s "DTLS-SRTP key material is"\ |
| 10258 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10259 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10260 | |
| 10261 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10263 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10264 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10265 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10266 | 0 \ |
| 10267 | -s "found use_srtp extension" \ |
| 10268 | -s "found srtp profile" \ |
| 10269 | -s "selected srtp profile" \ |
| 10270 | -s "server hello, adding use_srtp extension" \ |
| 10271 | -s "DTLS-SRTP key material is"\ |
| 10272 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10273 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10274 | |
| 10275 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10277 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10278 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10279 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10280 | 0 \ |
| 10281 | -s "found use_srtp extension" \ |
| 10282 | -s "found srtp profile" \ |
| 10283 | -s "selected srtp profile" \ |
| 10284 | -s "server hello, adding use_srtp extension" \ |
| 10285 | -s "DTLS-SRTP key material is"\ |
| 10286 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10287 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10288 | |
| 10289 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10291 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10292 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10293 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10294 | 0 \ |
| 10295 | -s "found use_srtp extension" \ |
| 10296 | -s "found srtp profile" \ |
| 10297 | -s "selected srtp profile" \ |
| 10298 | -s "server hello, adding use_srtp extension" \ |
| 10299 | -s "DTLS-SRTP key material is"\ |
| 10300 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10301 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10302 | |
| 10303 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10305 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10306 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10307 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10308 | 0 \ |
| 10309 | -s "found use_srtp extension" \ |
| 10310 | -s "found srtp profile" \ |
| 10311 | -S "selected srtp profile" \ |
| 10312 | -S "server hello, adding use_srtp extension" \ |
| 10313 | -S "DTLS-SRTP key material is"\ |
| 10314 | -C "SRTP Extension negotiated, profile" |
| 10315 | |
| 10316 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10318 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10319 | "$P_SRV dtls=1 debug_level=3" \ |
| 10320 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10321 | 0 \ |
| 10322 | -s "found use_srtp extension" \ |
| 10323 | -S "server hello, adding use_srtp extension" \ |
| 10324 | -S "DTLS-SRTP key material is"\ |
| 10325 | -C "SRTP Extension negotiated, profile" |
| 10326 | |
| 10327 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10329 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10330 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10331 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10332 | 0 \ |
| 10333 | -c "client hello, adding use_srtp extension" \ |
| 10334 | -c "found use_srtp extension" \ |
| 10335 | -c "found srtp profile" \ |
| 10336 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10337 | -c "DTLS-SRTP key material is"\ |
| 10338 | -C "error" |
| 10339 | |
| 10340 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10341 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10342 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10343 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10344 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10345 | 0 \ |
| 10346 | -c "client hello, adding use_srtp extension" \ |
| 10347 | -c "found use_srtp extension" \ |
| 10348 | -c "found srtp profile" \ |
| 10349 | -c "selected srtp profile" \ |
| 10350 | -c "DTLS-SRTP key material is"\ |
| 10351 | -C "error" |
| 10352 | |
| 10353 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10355 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10356 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10357 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10358 | 0 \ |
| 10359 | -c "client hello, adding use_srtp extension" \ |
| 10360 | -c "found use_srtp extension" \ |
| 10361 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10362 | -c "selected srtp profile" \ |
| 10363 | -c "DTLS-SRTP key material is"\ |
| 10364 | -C "error" |
| 10365 | |
| 10366 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10368 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 10369 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10370 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10371 | 0 \ |
| 10372 | -c "client hello, adding use_srtp extension" \ |
| 10373 | -c "found use_srtp extension" \ |
| 10374 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10375 | -c "selected srtp profile" \ |
| 10376 | -c "DTLS-SRTP key material is"\ |
| 10377 | -C "error" |
| 10378 | |
| 10379 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10381 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10382 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10383 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10384 | 0 \ |
| 10385 | -c "client hello, adding use_srtp extension" \ |
| 10386 | -c "found use_srtp extension" \ |
| 10387 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10388 | -c "selected srtp profile" \ |
| 10389 | -c "DTLS-SRTP key material is"\ |
| 10390 | -C "error" |
| 10391 | |
| 10392 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10394 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10395 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10396 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10397 | 0 \ |
| 10398 | -c "client hello, adding use_srtp extension" \ |
| 10399 | -C "found use_srtp extension" \ |
| 10400 | -C "found srtp profile" \ |
| 10401 | -C "selected srtp profile" \ |
| 10402 | -C "DTLS-SRTP key material is"\ |
| 10403 | -C "error" |
| 10404 | |
| 10405 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10407 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10408 | "$O_SRV -dtls" \ |
| 10409 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10410 | 0 \ |
| 10411 | -c "client hello, adding use_srtp extension" \ |
| 10412 | -C "found use_srtp extension" \ |
| 10413 | -C "found srtp profile" \ |
| 10414 | -C "selected srtp profile" \ |
| 10415 | -C "DTLS-SRTP key material is"\ |
| 10416 | -C "error" |
| 10417 | |
| 10418 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10420 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10421 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10422 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10423 | 0 \ |
| 10424 | -c "client hello, adding use_srtp extension" \ |
| 10425 | -c "found use_srtp extension" \ |
| 10426 | -c "found srtp profile" \ |
| 10427 | -c "selected srtp profile" \ |
| 10428 | -c "DTLS-SRTP key material is"\ |
| 10429 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10430 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10431 | -C "dumping 'received mki' (8 bytes)" \ |
| 10432 | -C "error" |
| 10433 | |
| 10434 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10435 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10437 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10438 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10439 | "$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] | 10440 | 0 \ |
| 10441 | -s "found use_srtp extension" \ |
| 10442 | -s "found srtp profile" \ |
| 10443 | -s "selected srtp profile" \ |
| 10444 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10445 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10446 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10447 | |
| 10448 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10449 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10451 | 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] | 10452 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10453 | "$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] | 10454 | 0 \ |
| 10455 | -s "found use_srtp extension" \ |
| 10456 | -s "found srtp profile" \ |
| 10457 | -s "selected srtp profile" \ |
| 10458 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10459 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10460 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10461 | |
| 10462 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10463 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10465 | 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] | 10466 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10467 | "$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] | 10468 | 0 \ |
| 10469 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10470 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10471 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10472 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10473 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10474 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10475 | |
| 10476 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10477 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10479 | 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] | 10480 | "$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] | 10481 | "$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] | 10482 | 0 \ |
| 10483 | -s "found use_srtp extension" \ |
| 10484 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10485 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10486 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10487 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10488 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10489 | |
| 10490 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10491 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10493 | 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] | 10494 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10495 | "$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] | 10496 | 0 \ |
| 10497 | -s "found use_srtp extension" \ |
| 10498 | -s "found srtp profile" \ |
| 10499 | -s "selected srtp profile" \ |
| 10500 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10501 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10502 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10503 | |
| 10504 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10505 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10507 | 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] | 10508 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10509 | "$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] | 10510 | 0 \ |
| 10511 | -s "found use_srtp extension" \ |
| 10512 | -s "found srtp profile" \ |
| 10513 | -S "selected srtp profile" \ |
| 10514 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10515 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10516 | -C "SRTP profile:" |
| 10517 | |
| 10518 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10519 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10521 | 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] | 10522 | "$P_SRV dtls=1 debug_level=3" \ |
| 10523 | "$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] | 10524 | 0 \ |
| 10525 | -s "found use_srtp extension" \ |
| 10526 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10527 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10528 | -C "SRTP profile:" |
| 10529 | |
| 10530 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10531 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10533 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10534 | "$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" \ |
| 10535 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10536 | 0 \ |
| 10537 | -c "client hello, adding use_srtp extension" \ |
| 10538 | -c "found use_srtp extension" \ |
| 10539 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10540 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10541 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10542 | -C "error" |
| 10543 | |
| 10544 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10545 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10547 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10548 | "$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" \ |
| 10549 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10550 | 0 \ |
| 10551 | -c "client hello, adding use_srtp extension" \ |
| 10552 | -c "found use_srtp extension" \ |
| 10553 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10554 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10555 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10556 | -C "error" |
| 10557 | |
| 10558 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10559 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10561 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10562 | "$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" \ |
| 10563 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10564 | 0 \ |
| 10565 | -c "client hello, adding use_srtp extension" \ |
| 10566 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10567 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10568 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10569 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10570 | -C "error" |
| 10571 | |
| 10572 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10573 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10575 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10576 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10577 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10578 | 0 \ |
| 10579 | -c "client hello, adding use_srtp extension" \ |
| 10580 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10581 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10582 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10583 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10584 | -C "error" |
| 10585 | |
| 10586 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10587 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10589 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10590 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10591 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10592 | 0 \ |
| 10593 | -c "client hello, adding use_srtp extension" \ |
| 10594 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10595 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10596 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10597 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10598 | -C "error" |
| 10599 | |
| 10600 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10601 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10603 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10604 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10605 | "$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] | 10606 | 0 \ |
| 10607 | -c "client hello, adding use_srtp extension" \ |
| 10608 | -C "found use_srtp extension" \ |
| 10609 | -C "found srtp profile" \ |
| 10610 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10611 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10612 | -C "error" |
| 10613 | |
| 10614 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10615 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10617 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10618 | "$G_SRV -u" \ |
| 10619 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10620 | 0 \ |
| 10621 | -c "client hello, adding use_srtp extension" \ |
| 10622 | -C "found use_srtp extension" \ |
| 10623 | -C "found srtp profile" \ |
| 10624 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10625 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10626 | -C "error" |
| 10627 | |
| 10628 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10629 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10631 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10632 | "$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" \ |
| 10633 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10634 | 0 \ |
| 10635 | -c "client hello, adding use_srtp extension" \ |
| 10636 | -c "found use_srtp extension" \ |
| 10637 | -c "found srtp profile" \ |
| 10638 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10639 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10640 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10641 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10642 | -c "dumping 'received mki' (8 bytes)" \ |
| 10643 | -C "error" |
| 10644 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10645 | # Tests for specific things with "unreliable" UDP connection |
| 10646 | |
| 10647 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10649 | run_test "DTLS proxy: reference" \ |
| 10650 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10651 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10652 | "$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] | 10653 | 0 \ |
| 10654 | -C "replayed record" \ |
| 10655 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10656 | -C "Buffer record from epoch" \ |
| 10657 | -S "Buffer record from epoch" \ |
| 10658 | -C "ssl_buffer_message" \ |
| 10659 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10660 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10661 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10662 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10663 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10664 | -c "HTTP/1.0 200 OK" |
| 10665 | |
| 10666 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10668 | run_test "DTLS proxy: duplicate every packet" \ |
| 10669 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10670 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10671 | "$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] | 10672 | 0 \ |
| 10673 | -c "replayed record" \ |
| 10674 | -s "replayed record" \ |
| 10675 | -c "record from another epoch" \ |
| 10676 | -s "record from another epoch" \ |
| 10677 | -S "resend" \ |
| 10678 | -s "Extra-header:" \ |
| 10679 | -c "HTTP/1.0 200 OK" |
| 10680 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10682 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10683 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10684 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10685 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10686 | 0 \ |
| 10687 | -c "replayed record" \ |
| 10688 | -S "replayed record" \ |
| 10689 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10690 | -s "record from another epoch" \ |
| 10691 | -c "resend" \ |
| 10692 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10693 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10694 | -c "HTTP/1.0 200 OK" |
| 10695 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10697 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10698 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10699 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10700 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10701 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10702 | -c "next record in same datagram" \ |
| 10703 | -s "next record in same datagram" |
| 10704 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10706 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10707 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10708 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10709 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10710 | 0 \ |
| 10711 | -c "next record in same datagram" \ |
| 10712 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10713 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10715 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10716 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10717 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10718 | "$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] | 10719 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10720 | -c "discarding invalid record (mac)" \ |
| 10721 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10722 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10723 | -c "HTTP/1.0 200 OK" \ |
| 10724 | -S "too many records with bad MAC" \ |
| 10725 | -S "Verification of the message MAC failed" |
| 10726 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10728 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10729 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10730 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10731 | "$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] | 10732 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10733 | -C "discarding invalid record (mac)" \ |
| 10734 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10735 | -S "Extra-header:" \ |
| 10736 | -C "HTTP/1.0 200 OK" \ |
| 10737 | -s "too many records with bad MAC" \ |
| 10738 | -s "Verification of the message MAC failed" |
| 10739 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10741 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10742 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10743 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10744 | "$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] | 10745 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10746 | -c "discarding invalid record (mac)" \ |
| 10747 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10748 | -s "Extra-header:" \ |
| 10749 | -c "HTTP/1.0 200 OK" \ |
| 10750 | -S "too many records with bad MAC" \ |
| 10751 | -S "Verification of the message MAC failed" |
| 10752 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10754 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10755 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10756 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10757 | "$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] | 10758 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10759 | -c "discarding invalid record (mac)" \ |
| 10760 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10761 | -s "Extra-header:" \ |
| 10762 | -c "HTTP/1.0 200 OK" \ |
| 10763 | -s "too many records with bad MAC" \ |
| 10764 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10765 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10767 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10768 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10769 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10770 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10771 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10772 | -c "record from another epoch" \ |
| 10773 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10774 | -s "Extra-header:" \ |
| 10775 | -c "HTTP/1.0 200 OK" |
| 10776 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10777 | # Tests for reordering support with DTLS |
| 10778 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10779 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10781 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10782 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10783 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10784 | hs_timeout=2500-60000" \ |
| 10785 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10786 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10787 | 0 \ |
| 10788 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10789 | -c "Next handshake message has been buffered - load"\ |
| 10790 | -S "Buffering HS message" \ |
| 10791 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10792 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10793 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10794 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10795 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10796 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10797 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10799 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10800 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10801 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10802 | hs_timeout=2500-60000" \ |
| 10803 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10804 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10805 | 0 \ |
| 10806 | -c "Buffering HS message" \ |
| 10807 | -c "found fragmented DTLS handshake message"\ |
| 10808 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10809 | -c "Next handshake message has been buffered - load"\ |
| 10810 | -S "Buffering HS message" \ |
| 10811 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10812 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10813 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10814 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10815 | -S "Remember CCS message" |
| 10816 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10817 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10818 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10819 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10820 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10821 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10822 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10824 | 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] | 10825 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10826 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10827 | hs_timeout=2500-60000" \ |
| 10828 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10829 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10830 | 0 \ |
| 10831 | -c "Buffering HS message" \ |
| 10832 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10833 | -C "attempt to make space by freeing buffered messages" \ |
| 10834 | -S "Buffering HS message" \ |
| 10835 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10836 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10837 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10838 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10839 | -S "Remember CCS message" |
| 10840 | |
| 10841 | # The size constraints ensure that the delayed certificate message can't |
| 10842 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10843 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10844 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10845 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10846 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10848 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10849 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10850 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10851 | hs_timeout=2500-60000" \ |
| 10852 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10853 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10854 | 0 \ |
| 10855 | -c "Buffering HS message" \ |
| 10856 | -c "attempt to make space by freeing buffered future messages" \ |
| 10857 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10858 | -S "Buffering HS message" \ |
| 10859 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10860 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10861 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10862 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10863 | -S "Remember CCS message" |
| 10864 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10865 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10867 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10868 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10869 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10870 | hs_timeout=2500-60000" \ |
| 10871 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10872 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10873 | 0 \ |
| 10874 | -C "Buffering HS message" \ |
| 10875 | -C "Next handshake message has been buffered - load"\ |
| 10876 | -s "Buffering HS message" \ |
| 10877 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10878 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10879 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10880 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10881 | -S "Remember CCS message" |
| 10882 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10883 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10885 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10886 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10887 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10888 | hs_timeout=2500-60000" \ |
| 10889 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10890 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10891 | 0 \ |
| 10892 | -C "Buffering HS message" \ |
| 10893 | -C "Next handshake message has been buffered - load"\ |
| 10894 | -S "Buffering HS message" \ |
| 10895 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10896 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10897 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10898 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10899 | -S "Remember CCS message" |
| 10900 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10901 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10903 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10904 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10905 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10906 | hs_timeout=2500-60000" \ |
| 10907 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10908 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10909 | 0 \ |
| 10910 | -C "Buffering HS message" \ |
| 10911 | -C "Next handshake message has been buffered - load"\ |
| 10912 | -S "Buffering HS message" \ |
| 10913 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10914 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10915 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10916 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10917 | -s "Remember CCS message" |
| 10918 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10920 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10921 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10922 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10923 | hs_timeout=2500-60000" \ |
| 10924 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10925 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10926 | 0 \ |
| 10927 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10928 | -s "Found buffered record from current epoch - load" \ |
| 10929 | -c "Buffer record from epoch 1" \ |
| 10930 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10931 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10932 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10933 | # from the server are delayed, so that the encrypted Finished message |
| 10934 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10935 | # in afterwards, the encrypted Finished message must be freed in order |
| 10936 | # to make space for the NewSessionTicket to be reassembled. |
| 10937 | # This works only in very particular circumstances: |
| 10938 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10939 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10940 | # the encrypted Finished message. |
| 10941 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10942 | # needs to be fragmented. |
| 10943 | # - All messages sent by the server must be small enough to be either sent |
| 10944 | # without fragmentation or be reassembled within the bounds of |
| 10945 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10946 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10947 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10948 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10950 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10951 | -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] | 10952 | "$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] | 10953 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10954 | 0 \ |
| 10955 | -s "Buffer record from epoch 1" \ |
| 10956 | -s "Found buffered record from current epoch - load" \ |
| 10957 | -c "Buffer record from epoch 1" \ |
| 10958 | -C "Found buffered record from current epoch - load" \ |
| 10959 | -c "Enough space available after freeing future epoch record" |
| 10960 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10961 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10962 | |
| 10963 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10965 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10966 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10967 | "$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] | 10968 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10969 | "$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] | 10970 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10971 | 0 \ |
| 10972 | -s "Extra-header:" \ |
| 10973 | -c "HTTP/1.0 200 OK" |
| 10974 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10975 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10977 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10978 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10979 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10980 | "$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] | 10981 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10982 | 0 \ |
| 10983 | -s "Extra-header:" \ |
| 10984 | -c "HTTP/1.0 200 OK" |
| 10985 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10986 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10987 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10988 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10989 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10990 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10991 | "$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] | 10992 | 0 \ |
| 10993 | -s "Extra-header:" \ |
| 10994 | -c "HTTP/1.0 200 OK" |
| 10995 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10996 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10998 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10999 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11000 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 11001 | "$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] | 11002 | 0 \ |
| 11003 | -s "Extra-header:" \ |
| 11004 | -c "HTTP/1.0 200 OK" |
| 11005 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11006 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11008 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 11009 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11010 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 11011 | "$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] | 11012 | 0 \ |
| 11013 | -s "Extra-header:" \ |
| 11014 | -c "HTTP/1.0 200 OK" |
| 11015 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11016 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11018 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 11019 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11020 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 11021 | "$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] | 11022 | 0 \ |
| 11023 | -s "Extra-header:" \ |
| 11024 | -c "HTTP/1.0 200 OK" |
| 11025 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11026 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11028 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 11029 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11030 | "$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] | 11031 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11032 | "$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] | 11033 | 0 \ |
| 11034 | -s "Extra-header:" \ |
| 11035 | -c "HTTP/1.0 200 OK" |
| 11036 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11037 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11038 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11039 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11040 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 11041 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11042 | "$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] | 11043 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11044 | "$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] | 11045 | 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] | 11046 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11047 | 0 \ |
| 11048 | -s "a session has been resumed" \ |
| 11049 | -c "a session has been resumed" \ |
| 11050 | -s "Extra-header:" \ |
| 11051 | -c "HTTP/1.0 200 OK" |
| 11052 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11053 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11055 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11056 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 11057 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11058 | "$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] | 11059 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11060 | "$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] | 11061 | 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] | 11062 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 11063 | 0 \ |
| 11064 | -s "a session has been resumed" \ |
| 11065 | -c "a session has been resumed" \ |
| 11066 | -s "Extra-header:" \ |
| 11067 | -c "HTTP/1.0 200 OK" |
| 11068 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11069 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11070 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11072 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11073 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11074 | "$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] | 11075 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11076 | "$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] | 11077 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11078 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11079 | 0 \ |
| 11080 | -c "=> renegotiate" \ |
| 11081 | -s "=> renegotiate" \ |
| 11082 | -s "Extra-header:" \ |
| 11083 | -c "HTTP/1.0 200 OK" |
| 11084 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11085 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11086 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11088 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11089 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11090 | "$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] | 11091 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11092 | "$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] | 11093 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11094 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11095 | 0 \ |
| 11096 | -c "=> renegotiate" \ |
| 11097 | -s "=> renegotiate" \ |
| 11098 | -s "Extra-header:" \ |
| 11099 | -c "HTTP/1.0 200 OK" |
| 11100 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11101 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11102 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11104 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11105 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11106 | "$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] | 11107 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11108 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11109 | "$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] | 11110 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11111 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11112 | 0 \ |
| 11113 | -c "=> renegotiate" \ |
| 11114 | -s "=> renegotiate" \ |
| 11115 | -s "Extra-header:" \ |
| 11116 | -c "HTTP/1.0 200 OK" |
| 11117 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11118 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11119 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11121 | 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] | 11122 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11123 | "$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] | 11124 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11125 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11126 | "$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] | 11127 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11128 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11129 | 0 \ |
| 11130 | -c "=> renegotiate" \ |
| 11131 | -s "=> renegotiate" \ |
| 11132 | -s "Extra-header:" \ |
| 11133 | -c "HTTP/1.0 200 OK" |
| 11134 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11135 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11136 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11137 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11138 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11139 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11140 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11142 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11143 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11144 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11145 | "$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] | 11146 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11147 | -c "HTTP/1.0 200 OK" |
| 11148 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11149 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11150 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11151 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11153 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11154 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11155 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11156 | "$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] | 11157 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11158 | -c "HTTP/1.0 200 OK" |
| 11159 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11160 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11161 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11162 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11164 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11165 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11166 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11167 | "$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] | 11168 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11169 | -c "HTTP/1.0 200 OK" |
| 11170 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11171 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11172 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11173 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11175 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11176 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11177 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11178 | "$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] | 11179 | 0 \ |
| 11180 | -s "Extra-header:" \ |
| 11181 | -c "Extra-header:" |
| 11182 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11183 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11184 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11185 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11187 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11188 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11189 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11190 | "$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] | 11191 | 0 \ |
| 11192 | -s "Extra-header:" \ |
| 11193 | -c "Extra-header:" |
| 11194 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11195 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11196 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11197 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11199 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11200 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11201 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11202 | "$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] | 11203 | 0 \ |
| 11204 | -s "Extra-header:" \ |
| 11205 | -c "Extra-header:" |
| 11206 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11208 | run_test "export keys functionality" \ |
| 11209 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 11210 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 11211 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11212 | -c "EAP-TLS key material is:"\ |
| 11213 | -s "EAP-TLS key material is:"\ |
| 11214 | -c "EAP-TLS IV is:" \ |
| 11215 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11216 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11217 | # openssl feature tests: check if tls1.3 exists. |
| 11218 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11219 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11220 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11221 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11222 | 0 \ |
| 11223 | -c "TLS 1.3" \ |
| 11224 | -s "TLS 1.3" |
| 11225 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11226 | # 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] | 11227 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11228 | requires_gnutls_next_no_ticket |
| 11229 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11230 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11231 | "$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] | 11232 | "$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] | 11233 | 0 \ |
| 11234 | -s "Version: TLS1.3" \ |
| 11235 | -c "Version: TLS1.3" |
| 11236 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11237 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11238 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11239 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11240 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11241 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11242 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11243 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11244 | "$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] | 11245 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11246 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11247 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11248 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11249 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11250 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11251 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11252 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11253 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11254 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11255 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11256 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11257 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11258 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11259 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11260 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11261 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11262 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11263 | -c "=> parse certificate verify" \ |
| 11264 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11265 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11266 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11267 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11268 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11269 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11270 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11271 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11272 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11273 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11274 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11275 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11276 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11277 | "$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] | 11278 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11279 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11280 | -s "SERVER HELLO was queued" \ |
| 11281 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11282 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11283 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11284 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11285 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11286 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11287 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11288 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11289 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11290 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11291 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11292 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11293 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11294 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11295 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11296 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11297 | -c "=> parse certificate verify" \ |
| 11298 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11299 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11300 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11301 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11302 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11303 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11304 | requires_openssl_tls1_3 |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11305 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11306 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11307 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11308 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11309 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11310 | run_test "TLS 1.3: alpn - openssl" \ |
| 11311 | "$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] | 11312 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11313 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11314 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11315 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11316 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11317 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11318 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11319 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11320 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11321 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11322 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11323 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11324 | -c "<= ssl_tls13_process_server_hello" \ |
| 11325 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11326 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11327 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11328 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11329 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11330 | -c "=> parse certificate verify" \ |
| 11331 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11332 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11333 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11334 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11335 | -c "HTTP/1.0 200 ok" \ |
| 11336 | -c "Application Layer Protocol is h2" |
| 11337 | |
| 11338 | requires_gnutls_tls1_3 |
| 11339 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11340 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11341 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11342 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11343 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11344 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11345 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11346 | "$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] | 11347 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11348 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11349 | -s "SERVER HELLO was queued" \ |
| 11350 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11351 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11352 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11353 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11354 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11355 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11356 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11357 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11358 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11359 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11360 | -c "<= ssl_tls13_process_server_hello" \ |
| 11361 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11362 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11363 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11364 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11365 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11366 | -c "=> parse certificate verify" \ |
| 11367 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11368 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11369 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11370 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11371 | -c "HTTP/1.0 200 OK" \ |
| 11372 | -c "Application Layer Protocol is h2" |
| 11373 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11374 | requires_openssl_tls1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11375 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11376 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11377 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11378 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11379 | run_test "TLS 1.3: server alpn - openssl" \ |
| 11380 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11381 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11382 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11383 | -s "found alpn extension" \ |
| 11384 | -s "server side, adding alpn extension" \ |
| 11385 | -s "Protocol is TLSv1.3" \ |
| 11386 | -s "HTTP/1.0 200 OK" \ |
| 11387 | -s "Application Layer Protocol is h2" |
| 11388 | |
| 11389 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11390 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11391 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11392 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11393 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11394 | run_test "TLS 1.3: server alpn - gnutls" \ |
| 11395 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11396 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11397 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11398 | -s "found alpn extension" \ |
| 11399 | -s "server side, adding alpn extension" \ |
| 11400 | -s "Protocol is TLSv1.3" \ |
| 11401 | -s "HTTP/1.0 200 OK" \ |
| 11402 | -s "Application Layer Protocol is h2" |
| 11403 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11405 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11406 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11407 | skip_handshake_stage_check |
| 11408 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11409 | 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] | 11410 | "$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] | 11411 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11412 | 1 \ |
| 11413 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11414 | -S "Version: TLS1.0" \ |
| 11415 | -C "Protocol is TLSv1.0" |
| 11416 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11418 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11419 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11420 | skip_handshake_stage_check |
| 11421 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11422 | 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] | 11423 | "$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] | 11424 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11425 | 1 \ |
| 11426 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11427 | -S "Version: TLS1.1" \ |
| 11428 | -C "Protocol is TLSv1.1" |
| 11429 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11431 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11433 | skip_handshake_stage_check |
| 11434 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11435 | 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] | 11436 | "$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] | 11437 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11438 | 1 \ |
| 11439 | -s "Client's version: 3.3" \ |
| 11440 | -c "is a fatal alert message (msg 40)" \ |
| 11441 | -S "Version: TLS1.2" \ |
| 11442 | -C "Protocol is TLSv1.2" |
| 11443 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11445 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11446 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11447 | skip_handshake_stage_check |
| 11448 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11449 | 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] | 11450 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11451 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11452 | 1 \ |
| 11453 | -s "fatal protocol_version" \ |
| 11454 | -c "is a fatal alert message (msg 70)" \ |
| 11455 | -S "Version: TLS1.0" \ |
| 11456 | -C "Protocol : TLSv1.0" |
| 11457 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11459 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11460 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11461 | skip_handshake_stage_check |
| 11462 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11463 | 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] | 11464 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11465 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11466 | 1 \ |
| 11467 | -s "fatal protocol_version" \ |
| 11468 | -c "is a fatal alert message (msg 70)" \ |
| 11469 | -S "Version: TLS1.1" \ |
| 11470 | -C "Protocol : TLSv1.1" |
| 11471 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11473 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11474 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11475 | skip_handshake_stage_check |
| 11476 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11477 | 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] | 11478 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11479 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11480 | 1 \ |
| 11481 | -s "fatal protocol_version" \ |
| 11482 | -c "is a fatal alert message (msg 70)" \ |
| 11483 | -S "Version: TLS1.2" \ |
| 11484 | -C "Protocol : TLSv1.2" |
| 11485 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11486 | requires_openssl_tls1_3 |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11487 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11488 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11489 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11490 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11491 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11492 | "$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] | 11493 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11494 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11495 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11496 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11497 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11498 | -c "HTTP/1.0 200 ok" \ |
| 11499 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11500 | |
| 11501 | requires_gnutls_tls1_3 |
| 11502 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11503 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11504 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11505 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11506 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11507 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11508 | "$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] | 11509 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11510 | 0 \ |
| 11511 | -c "got a certificate request" \ |
| 11512 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11513 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11514 | -c "HTTP/1.0 200 OK" \ |
| 11515 | -c "Protocol is TLSv1.3" |
| 11516 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11517 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11518 | requires_openssl_tls1_3 |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11519 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11520 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11521 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11522 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11523 | "$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] | 11524 | "$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] | 11525 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11526 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11527 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11528 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11529 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11530 | |
| 11531 | requires_gnutls_tls1_3 |
| 11532 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11533 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11534 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11535 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11536 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11537 | "$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] | 11538 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11539 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11540 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11541 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11542 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11543 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11544 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11545 | |
| 11546 | requires_openssl_tls1_3 |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11547 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11548 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11549 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11550 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11551 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11552 | "$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] | 11553 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11554 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11555 | 0 \ |
| 11556 | -c "got a certificate request" \ |
| 11557 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11558 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11559 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11560 | |
| 11561 | requires_gnutls_tls1_3 |
| 11562 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11563 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11564 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11565 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11566 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11567 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11568 | "$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] | 11569 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11570 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11571 | 0 \ |
| 11572 | -c "got a certificate request" \ |
| 11573 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11574 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11575 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11576 | |
| 11577 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11578 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11579 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11580 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11581 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11582 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11583 | "$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] | 11584 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11585 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11586 | 0 \ |
| 11587 | -c "got a certificate request" \ |
| 11588 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11589 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11590 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11591 | |
| 11592 | requires_gnutls_tls1_3 |
| 11593 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11594 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11595 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11596 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11597 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11598 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11599 | "$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] | 11600 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11601 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11602 | 0 \ |
| 11603 | -c "got a certificate request" \ |
| 11604 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11605 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11606 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11607 | |
| 11608 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11609 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11610 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11611 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11612 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11613 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11614 | "$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] | 11615 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11616 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11617 | 0 \ |
| 11618 | -c "got a certificate request" \ |
| 11619 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11620 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11621 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11622 | |
| 11623 | requires_gnutls_tls1_3 |
| 11624 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11625 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11626 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11627 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11628 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11629 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11630 | "$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] | 11631 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11632 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11633 | 0 \ |
| 11634 | -c "got a certificate request" \ |
| 11635 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11636 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11637 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11638 | |
| 11639 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11640 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11641 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11642 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11643 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11644 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11645 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11646 | "$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] | 11647 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11648 | 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] | 11649 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11650 | -c "got a certificate request" \ |
| 11651 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11652 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11653 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11654 | |
| 11655 | requires_gnutls_tls1_3 |
| 11656 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11657 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11658 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11659 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11660 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11661 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11662 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11663 | "$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] | 11664 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11665 | 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] | 11666 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11667 | -c "got a certificate request" \ |
| 11668 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11669 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11670 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11671 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11672 | requires_openssl_tls1_3 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11673 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11674 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11675 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11676 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11677 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11678 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11679 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11680 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11681 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11682 | 0 \ |
| 11683 | -c "got a certificate request" \ |
| 11684 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11685 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11686 | -c "Protocol is TLSv1.3" |
| 11687 | |
| 11688 | requires_gnutls_tls1_3 |
| 11689 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11690 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11691 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11692 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11693 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11694 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11695 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11696 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11697 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11698 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11699 | 0 \ |
| 11700 | -c "got a certificate request" \ |
| 11701 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11702 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11703 | -c "Protocol is TLSv1.3" |
| 11704 | |
| 11705 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11706 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11707 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11708 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11709 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11710 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11711 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11712 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11713 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11714 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11715 | 0 \ |
| 11716 | -c "got a certificate request" \ |
| 11717 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11718 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11719 | -c "Protocol is TLSv1.3" |
| 11720 | |
| 11721 | requires_gnutls_tls1_3 |
| 11722 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11723 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11724 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11725 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11726 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11727 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11728 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11729 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11730 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11731 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11732 | 0 \ |
| 11733 | -c "got a certificate request" \ |
| 11734 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11735 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11736 | -c "Protocol is TLSv1.3" |
| 11737 | |
| 11738 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11739 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11740 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11741 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11742 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11743 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11744 | 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] | 11745 | "$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] | 11746 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11747 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11748 | 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] | 11749 | 1 \ |
| 11750 | -c "got a certificate request" \ |
| 11751 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11752 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11753 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11754 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11755 | |
| 11756 | requires_gnutls_tls1_3 |
| 11757 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11758 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11759 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11760 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11761 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11762 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11763 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 11764 | "$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] | 11765 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11766 | 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] | 11767 | 1 \ |
| 11768 | -c "got a certificate request" \ |
| 11769 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11770 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11771 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11772 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11773 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11774 | # Test using an opaque private key for client authentication |
| 11775 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11776 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11777 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11778 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11779 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11780 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 11781 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 11782 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 11783 | 0 \ |
| 11784 | -c "got a certificate request" \ |
| 11785 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11786 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11787 | -c "Protocol is TLSv1.3" |
| 11788 | |
| 11789 | requires_gnutls_tls1_3 |
| 11790 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11791 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11792 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11793 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11794 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11795 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 11796 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 11797 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 11798 | key_file=data_files/cli2.key key_opaque=1" \ |
| 11799 | 0 \ |
| 11800 | -c "got a certificate request" \ |
| 11801 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11802 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11803 | -c "Protocol is TLSv1.3" |
| 11804 | |
| 11805 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11806 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11807 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11808 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11809 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11810 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11811 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 11812 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11813 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11814 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11815 | 0 \ |
| 11816 | -c "got a certificate request" \ |
| 11817 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11818 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11819 | -c "Protocol is TLSv1.3" |
| 11820 | |
| 11821 | requires_gnutls_tls1_3 |
| 11822 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11823 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11824 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11825 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11826 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11827 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11828 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 11829 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11830 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11831 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11832 | 0 \ |
| 11833 | -c "got a certificate request" \ |
| 11834 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11835 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11836 | -c "Protocol is TLSv1.3" |
| 11837 | |
| 11838 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11839 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11840 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11841 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11842 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11843 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11844 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 11845 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11846 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11847 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11848 | 0 \ |
| 11849 | -c "got a certificate request" \ |
| 11850 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11851 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11852 | -c "Protocol is TLSv1.3" |
| 11853 | |
| 11854 | requires_gnutls_tls1_3 |
| 11855 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11856 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11857 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11858 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11859 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11860 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11861 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 11862 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11863 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11864 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11865 | 0 \ |
| 11866 | -c "got a certificate request" \ |
| 11867 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11868 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11869 | -c "Protocol is TLSv1.3" |
| 11870 | |
| 11871 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11872 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11873 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11874 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11875 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11876 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11877 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11878 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11879 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11880 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11881 | 0 \ |
| 11882 | -c "got a certificate request" \ |
| 11883 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11884 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11885 | -c "Protocol is TLSv1.3" |
| 11886 | |
| 11887 | requires_gnutls_tls1_3 |
| 11888 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11889 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11890 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11891 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11892 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11893 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11894 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11895 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11896 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11897 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11898 | 0 \ |
| 11899 | -c "got a certificate request" \ |
| 11900 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11901 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11902 | -c "Protocol is TLSv1.3" |
| 11903 | |
| 11904 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11905 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11906 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11907 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11908 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11909 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11910 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11911 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11912 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11913 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11914 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11915 | 0 \ |
| 11916 | -c "got a certificate request" \ |
| 11917 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11918 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11919 | -c "Protocol is TLSv1.3" |
| 11920 | |
| 11921 | requires_gnutls_tls1_3 |
| 11922 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11923 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11924 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11925 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11926 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11927 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11928 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11929 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11930 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11931 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11932 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11933 | 0 \ |
| 11934 | -c "got a certificate request" \ |
| 11935 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11936 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11937 | -c "Protocol is TLSv1.3" |
| 11938 | |
| 11939 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11940 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11941 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11942 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11943 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11944 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11945 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11946 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11947 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11948 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11949 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11950 | 0 \ |
| 11951 | -c "got a certificate request" \ |
| 11952 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11953 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11954 | -c "Protocol is TLSv1.3" |
| 11955 | |
| 11956 | requires_gnutls_tls1_3 |
| 11957 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11958 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11959 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11960 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11961 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11962 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11963 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11964 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 11965 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11966 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11967 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11968 | 0 \ |
| 11969 | -c "got a certificate request" \ |
| 11970 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11971 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11972 | -c "Protocol is TLSv1.3" |
| 11973 | |
| 11974 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11975 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11976 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11977 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11978 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11979 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11980 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11981 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 11982 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11983 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11984 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11985 | 0 \ |
| 11986 | -c "got a certificate request" \ |
| 11987 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11988 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11989 | -c "Protocol is TLSv1.3" |
| 11990 | |
| 11991 | requires_gnutls_tls1_3 |
| 11992 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11993 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11994 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11995 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11996 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11997 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11998 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11999 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 12000 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12001 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 12002 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12003 | 0 \ |
| 12004 | -c "got a certificate request" \ |
| 12005 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12006 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12007 | -c "Protocol is TLSv1.3" |
| 12008 | |
| 12009 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12010 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12011 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12012 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12013 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12014 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12015 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12016 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12017 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12018 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 12019 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12020 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12021 | 1 \ |
| 12022 | -c "got a certificate request" \ |
| 12023 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12024 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12025 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12026 | -C "unkown pk type" |
| 12027 | |
| 12028 | requires_gnutls_tls1_3 |
| 12029 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12030 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12031 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12032 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12033 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12034 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12035 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12036 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 12037 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 12038 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12039 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12040 | 1 \ |
| 12041 | -c "got a certificate request" \ |
| 12042 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12043 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12044 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12045 | -C "unkown pk type" |
| 12046 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12047 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12048 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12049 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12050 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12051 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12052 | 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] | 12053 | "$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] | 12054 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12055 | 0 \ |
| 12056 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12057 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12058 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12059 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12060 | -c "HTTP/1.0 200 ok" |
| 12061 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12062 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12063 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12064 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12065 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12066 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12067 | 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] | 12068 | "$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] | 12069 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12070 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12071 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12072 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12073 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12074 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12075 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12076 | |
| 12077 | requires_gnutls_tls1_3 |
| 12078 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12079 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12080 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12081 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12082 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12083 | 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] | 12084 | "$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] | 12085 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12086 | 0 \ |
| 12087 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12088 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12089 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12090 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12091 | -c "HTTP/1.0 200 OK" |
| 12092 | |
| 12093 | requires_gnutls_tls1_3 |
| 12094 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12095 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12096 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12097 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12098 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12099 | 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] | 12100 | "$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] | 12101 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12102 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12103 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12104 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12105 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12106 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12107 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12108 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12109 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12110 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12111 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12112 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12113 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12114 | "$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] | 12115 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12116 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12117 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12118 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12119 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12120 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12121 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12122 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12123 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12124 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12125 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12126 | requires_openssl_tls1_3 |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12127 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12128 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12129 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12130 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12131 | "$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] | 12132 | "$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] | 12133 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12134 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12135 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12136 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12137 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12138 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12139 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12140 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12141 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12142 | -s "=> parse client hello" \ |
| 12143 | -s "<= parse client hello" |
| 12144 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12145 | requires_gnutls_tls1_3 |
| 12146 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12147 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12148 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12149 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12150 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12151 | "$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] | 12152 | "$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] | 12153 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12154 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12155 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12156 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12157 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12158 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12159 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12160 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12161 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12162 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12163 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12164 | requires_gnutls_tls1_3 |
| 12165 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12166 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12167 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12168 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12169 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12170 | "$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" \ |
| 12171 | "$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] | 12172 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12173 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12174 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12175 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12176 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12177 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12178 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12179 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12180 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12181 | -s "=> parse client hello" \ |
| 12182 | -s "<= parse client hello" |
| 12183 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12184 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12185 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12186 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12187 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12188 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 12189 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12190 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12191 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12192 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12193 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12194 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12195 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12196 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12197 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12198 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12199 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12200 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12201 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12202 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12203 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12204 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12205 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12206 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12207 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12208 | "$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" \ |
| 12209 | "$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] | 12210 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12211 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12212 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12213 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12214 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12215 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12216 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12217 | -s "=> parse client hello" \ |
| 12218 | -s "<= parse client hello" |
| 12219 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12220 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12221 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12222 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12223 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12224 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 12225 | "$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" \ |
| 12226 | "$P_CLI debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12227 | 1 \ |
| 12228 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12229 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12230 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12231 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12232 | -s "=> write certificate request" \ |
| 12233 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12234 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12235 | -s "=> parse client hello" \ |
| 12236 | -s "<= parse client hello" |
| 12237 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12238 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12239 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12240 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12241 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12242 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 12243 | "$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" \ |
| 12244 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none key_file=none" \ |
| 12245 | 0 \ |
| 12246 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12247 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12248 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12249 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12250 | -s "=> write certificate request" \ |
| 12251 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12252 | -s "=> parse client hello" \ |
| 12253 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12254 | |
| 12255 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12256 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12257 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12258 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12259 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 12260 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 12261 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12262 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12263 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12264 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12265 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12266 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12267 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12268 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12269 | -s "=> write hello retry request" \ |
| 12270 | -s "<= write hello retry request" |
| 12271 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12272 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12273 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12274 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12275 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12276 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 12277 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12278 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 12279 | 1 \ |
| 12280 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12281 | -s "No certificate available." |
| 12282 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12283 | requires_openssl_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12284 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12285 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12286 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12287 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12288 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12289 | "$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] | 12290 | 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] | 12291 | "$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" \ |
| 12292 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12293 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12294 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12295 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12296 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12297 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12298 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12299 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12300 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12301 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12302 | "$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] | 12303 | 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] | 12304 | "$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" \ |
| 12305 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12306 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12307 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12308 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12309 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12310 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12311 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12312 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12313 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12314 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12315 | "$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 \ |
| 12316 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12317 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 12318 | force_version=tls13" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12319 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12320 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12321 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12322 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12323 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12324 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12325 | TEST_SUITE_NAME=${i##*/} |
| 12326 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12327 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12328 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12329 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12330 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12331 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12332 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12333 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12334 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12335 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12336 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12337 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
| 12338 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12339 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12340 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12341 | -s "Protocol is TLSv1.3" \ |
| 12342 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12343 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12344 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12345 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12346 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12347 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12348 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12349 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12350 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12351 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
| 12352 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12353 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12354 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12355 | -s "Protocol is TLSv1.3" \ |
| 12356 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12357 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12358 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12359 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12360 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12361 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12362 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12363 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12364 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12365 | 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] | 12366 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12367 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12368 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12369 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12370 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12371 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12372 | |
| 12373 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12374 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12375 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12376 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12377 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12378 | 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] | 12379 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12380 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12381 | 1 \ |
| 12382 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12383 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12384 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12385 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12386 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12387 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12388 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12389 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12390 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12391 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12392 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12393 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12394 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12395 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12396 | requires_gnutls_tls1_3 |
| 12397 | requires_gnutls_next_no_ticket |
| 12398 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12399 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12400 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12401 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12402 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12403 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12404 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12405 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12406 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12407 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12408 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12409 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12410 | |
| 12411 | requires_gnutls_tls1_3 |
| 12412 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12413 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12414 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12415 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12416 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12417 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12418 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12419 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12420 | 1 \ |
| 12421 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12422 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12423 | requires_gnutls_tls1_3 |
| 12424 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12425 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12426 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12427 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12428 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12429 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12430 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12431 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12432 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12433 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12434 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12435 | |
| 12436 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12437 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12438 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12439 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12440 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12441 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
| 12442 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12443 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12444 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12445 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12446 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12447 | -C "14 03 03 00 01" |
| 12448 | |
| 12449 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12450 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12451 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12452 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12453 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12454 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
| 12455 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12456 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12457 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12458 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12459 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12460 | |
| 12461 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12462 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12463 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12464 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12465 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12466 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
| 12467 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12468 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12469 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12470 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12471 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12472 | -c "14 03 03 00 01" |
| 12473 | |
| 12474 | requires_gnutls_tls1_3 |
| 12475 | requires_gnutls_next_no_ticket |
| 12476 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12477 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12478 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12479 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12480 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12481 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
| 12482 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12483 | "$G_NEXT_CLI localhost --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12484 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12485 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12486 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12487 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12488 | |
| 12489 | requires_gnutls_tls1_3 |
| 12490 | requires_gnutls_next_no_ticket |
| 12491 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12492 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12493 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12494 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12495 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12496 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
| 12497 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12498 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12499 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12500 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12501 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12502 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12503 | -c "discarding change cipher spec in TLS1.3" |
| 12504 | |
| 12505 | requires_gnutls_tls1_3 |
| 12506 | requires_gnutls_next_no_ticket |
| 12507 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12508 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12509 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12510 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12511 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12512 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
| 12513 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12514 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12515 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12516 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12517 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12518 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12519 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12520 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12521 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12522 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12523 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12524 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12525 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
| 12526 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12527 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12528 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12529 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12530 | -c "Protocol is TLSv1.3" \ |
| 12531 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12532 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12533 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12534 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12535 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12536 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12537 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12538 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12539 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12540 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
| 12541 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12542 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12543 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12544 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12545 | -c "Protocol is TLSv1.3" \ |
| 12546 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12547 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12548 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12549 | |
| 12550 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12551 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12552 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12553 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12554 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12555 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12556 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -no_middlebox -num_tickets 0 -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12557 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12558 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12559 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12560 | -c "received HelloRetryRequest message" \ |
| 12561 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12562 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12563 | |
| 12564 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12565 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12566 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12567 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12568 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12569 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12570 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12571 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12572 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12573 | -c "received HelloRetryRequest message" \ |
| 12574 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12575 | |
| 12576 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12577 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12578 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12579 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12580 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12581 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12582 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12583 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12584 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12585 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12586 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12587 | |
| 12588 | requires_gnutls_tls1_3 |
| 12589 | requires_gnutls_next_no_ticket |
| 12590 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12591 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12592 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12593 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12594 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12595 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12596 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12597 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12598 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12599 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12600 | -c "received HelloRetryRequest message" \ |
| 12601 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12602 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12603 | |
| 12604 | requires_gnutls_tls1_3 |
| 12605 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12606 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12607 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12608 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12609 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12610 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12611 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12612 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12613 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12614 | -c "received HelloRetryRequest message" \ |
| 12615 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12616 | |
| 12617 | requires_gnutls_tls1_3 |
| 12618 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12619 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12620 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12621 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12622 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12623 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12624 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12625 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12626 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12627 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12628 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12629 | |
| 12630 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12631 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12632 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12633 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12634 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12635 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
| 12636 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12637 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12638 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12639 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12640 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12641 | -C "14 03 03 00 01" |
| 12642 | |
| 12643 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12644 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12645 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12646 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12647 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12648 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
| 12649 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12650 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12651 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12652 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12653 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12654 | |
| 12655 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12656 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12657 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12658 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12659 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12660 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
| 12661 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12662 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12663 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12664 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12665 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12666 | -c "14 03 03 00 01" |
| 12667 | |
| 12668 | requires_gnutls_tls1_3 |
| 12669 | requires_gnutls_next_no_ticket |
| 12670 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12671 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12672 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12673 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12674 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12675 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
| 12676 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12677 | "$G_NEXT_CLI localhost --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12678 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12679 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12680 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12681 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12682 | |
| 12683 | requires_gnutls_tls1_3 |
| 12684 | requires_gnutls_next_no_ticket |
| 12685 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12686 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12687 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12688 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12689 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12690 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
| 12691 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12692 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12693 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12694 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12695 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12696 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12697 | -c "discarding change cipher spec in TLS1.3" |
| 12698 | |
| 12699 | requires_gnutls_tls1_3 |
| 12700 | requires_gnutls_next_no_ticket |
| 12701 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12702 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12703 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12704 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12705 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12706 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
| 12707 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12708 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12709 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12710 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12711 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12712 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12713 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12714 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12715 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12716 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12717 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12718 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12719 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12720 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12721 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12722 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12723 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12724 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12725 | 0 \ |
| 12726 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12727 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12728 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12729 | |
| 12730 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12731 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12732 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12733 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12734 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12735 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12736 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12737 | -d 4 |
| 12738 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
| 12739 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12740 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12741 | 0 \ |
| 12742 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12743 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12744 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12745 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12746 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12747 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12748 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12749 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12750 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12751 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
| 12752 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12753 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12754 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12755 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12756 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12757 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12758 | 0 \ |
| 12759 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12760 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 12761 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12762 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12763 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12764 | |
| 12765 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12766 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12767 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12768 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12769 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12770 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
| 12771 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12772 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12773 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12774 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12775 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12776 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12777 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12778 | 0 \ |
| 12779 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12780 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12781 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12782 | |
| 12783 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12784 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12785 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12786 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12787 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12788 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
| 12789 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12790 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12791 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12792 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12793 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12794 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12795 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 12796 | 0 \ |
| 12797 | -c "Negotiated version: 3.4" \ |
| 12798 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12799 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12800 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12801 | |
| 12802 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12803 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12804 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12805 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12806 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12807 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
| 12808 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12809 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12810 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12811 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12812 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12813 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12814 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 12815 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12816 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12817 | |
| 12818 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12819 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12820 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12821 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12822 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12823 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
| 12824 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12825 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12826 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12827 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 12828 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12829 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12830 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 12831 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12832 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12833 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12834 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12835 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12836 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12837 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12838 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12839 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
| 12840 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12841 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12842 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12843 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12844 | "$P_CLI allow_sha1=0 debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12845 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12846 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12847 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12848 | |
| 12849 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12850 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12851 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12852 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12853 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12854 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
| 12855 | "$P_SRV debug_level=4 force_version=tls13 |
| 12856 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12857 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12858 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12859 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 12860 | 1 \ |
| 12861 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12862 | |
| 12863 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12864 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12865 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12866 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12867 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12868 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
| 12869 | "$P_SRV debug_level=4 force_version=tls13 |
| 12870 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12871 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12872 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12873 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 12874 | 1 \ |
| 12875 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12876 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12877 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12878 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12879 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12880 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12881 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12882 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
| 12883 | "$P_SRV debug_level=4 force_version=tls13 |
| 12884 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12885 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12886 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12887 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12888 | 1 \ |
| 12889 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12890 | |
| 12891 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12892 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12893 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12894 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12895 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12896 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 12897 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12898 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12899 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 12900 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12901 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12902 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12903 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12904 | |
| 12905 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12906 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12907 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12908 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12909 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12910 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 12911 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12912 | -d 4 |
| 12913 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
| 12914 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12915 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12916 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12917 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12918 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12919 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12920 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12921 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12922 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12923 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12924 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
| 12925 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12926 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12927 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12928 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 12929 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12930 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12931 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12932 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12933 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12934 | requires_openssl_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12935 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12936 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12937 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12938 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12939 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12940 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12941 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 12942 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12943 | 0 \ |
| 12944 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12945 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12946 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12947 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12948 | -c "HTTP/1.0 200 ok" |
| 12949 | |
| 12950 | requires_gnutls_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12951 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12952 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12953 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12954 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12955 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12956 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Ronald Cron | a709a0f | 2022-09-27 16:46:11 +0200 | [diff] [blame] | 12957 | "$G_NEXT_SRV -d 10 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12958 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12959 | 0 \ |
| 12960 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12961 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12962 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12963 | -c "Reconnecting with saved session" \ |
| 12964 | -c "HTTP/1.0 200 OK" \ |
| 12965 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12966 | |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12967 | requires_openssl_tls1_3 |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12968 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12969 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12970 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12971 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12972 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12973 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12974 | # https://github.com/openssl/openssl/issues/10714 |
| 12975 | # Until now, OpenSSL client does not support reconnect. |
| 12976 | skip_next_test |
| 12977 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
| 12978 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12979 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 12980 | 0 \ |
| 12981 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 12982 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 12983 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12984 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12985 | requires_gnutls_tls1_3 |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12986 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12987 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12988 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12989 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12990 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12991 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12992 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12993 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12994 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12995 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12996 | -c "Connecting again- trying to resume previous session" \ |
| 12997 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12998 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 12999 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13000 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13001 | -s "key exchange mode: ephemeral" \ |
| 13002 | -s "key exchange mode: psk_ephemeral" \ |
| 13003 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13004 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13005 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13006 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13007 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13008 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13009 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13010 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13011 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13012 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13013 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13014 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13015 | 0 \ |
| 13016 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13017 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13018 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13019 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13020 | -c "HTTP/1.0 200 OK" \ |
| 13021 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13022 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13023 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13024 | -s "key exchange mode: ephemeral" \ |
| 13025 | -s "key exchange mode: psk_ephemeral" \ |
| 13026 | -s "found pre_shared_key extension" |
| 13027 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13028 | requires_openssl_tls1_3 |
| 13029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13030 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13031 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13032 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13033 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13034 | -msg -tls1_2 |
| 13035 | -Verify 10 " \ |
| 13036 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13037 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13038 | min_version=tls12 max_version=tls13 " \ |
| 13039 | 0 \ |
| 13040 | -c "Protocol is TLSv1.2" \ |
| 13041 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13042 | |
| 13043 | |
| 13044 | requires_gnutls_tls1_3 |
| 13045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13046 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13047 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13048 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13049 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13050 | -d 4 |
| 13051 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 13052 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13053 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13054 | min_version=tls12 max_version=tls13 " \ |
| 13055 | 0 \ |
| 13056 | -c "Protocol is TLSv1.2" \ |
| 13057 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13058 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13059 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13060 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13061 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13062 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13063 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13064 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13065 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13066 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13067 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13068 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 13069 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 13070 | 0 \ |
| 13071 | -c "Protocol is TLSv1.3" \ |
| 13072 | -c "got new session ticket." \ |
| 13073 | -c "Saving session for reuse... ok" \ |
| 13074 | -c "Reconnecting with saved session" \ |
| 13075 | -c "HTTP/1.0 200 OK" \ |
| 13076 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13077 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13078 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13079 | -s "key exchange mode: ephemeral" \ |
| 13080 | -s "key exchange mode: psk_ephemeral" \ |
| 13081 | -s "found pre_shared_key extension" |
| 13082 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13083 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13084 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13085 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13086 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13087 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13088 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13089 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13090 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13091 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13092 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Jerry Yu | ad9e99b | 2022-10-28 12:18:52 +0800 | [diff] [blame] | 13093 | "$P_CLI debug_level=4 server_name=localhost reco_server_name=remote reco_mode=1 reconnect=1" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13094 | 1 \ |
| 13095 | -c "Protocol is TLSv1.3" \ |
| 13096 | -c "got new session ticket." \ |
| 13097 | -c "Saving session for reuse... ok" \ |
| 13098 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13099 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13100 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13101 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13102 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13103 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13104 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13106 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13107 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13108 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13109 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13110 | run_tests_memory_after_hanshake |
| 13111 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13112 | # Final report |
| 13113 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13114 | echo "------------------------------------------------------------------------" |
| 13115 | |
| 13116 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13117 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13118 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13119 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13120 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 13121 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 13122 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13123 | |
| 13124 | exit $FAILS |