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 | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 49 | : ${OPENSSL:=openssl} |
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 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 54 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 55 | # To help the migration, error out if the old variable is set, |
| 56 | # but only if it has a different value than the new one. |
| 57 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 58 | # the variable is set, we can now check its value |
| 59 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 60 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 61 | exit 125 |
| 62 | fi |
| 63 | fi |
| 64 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 65 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 66 | 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] | 67 | echo "default" |
| 68 | else |
| 69 | echo "unknown" |
| 70 | fi |
| 71 | } |
| 72 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 73 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 74 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 75 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 76 | O_SRV="$OPENSSL s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 77 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 78 | 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] | 79 | 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] | 80 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 81 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 82 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 83 | |
| 84 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 85 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 86 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 87 | else |
| 88 | O_LEGACY_SRV=false |
| 89 | O_LEGACY_CLI=false |
| 90 | fi |
| 91 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 92 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 93 | 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] | 94 | 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] | 95 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 96 | 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] | 97 | 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] | 98 | else |
| 99 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 100 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 101 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 102 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 103 | O_NEXT_CLI=false |
| 104 | fi |
| 105 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 106 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 107 | 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] | 108 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 109 | else |
| 110 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 111 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 112 | fi |
| 113 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 114 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 115 | 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] | 116 | 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] | 117 | else |
| 118 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 119 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 120 | fi |
| 121 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 122 | TESTS=0 |
| 123 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 124 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 125 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 126 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 127 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 128 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 129 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 130 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 132 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 133 | RUN_TEST_NUMBER='' |
| 134 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 135 | PRESERVE_LOGS=0 |
| 136 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 137 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 138 | # port which is this plus 10000. Each port number may be independently |
| 139 | # overridden by a command line option. |
| 140 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 141 | PXY_PORT=$((SRV_PORT + 10000)) |
| 142 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 143 | print_usage() { |
| 144 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 145 | printf " -h|--help\tPrint this help.\n" |
| 146 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 147 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 148 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 149 | 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] | 150 | 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] | 151 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 152 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 153 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 154 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 155 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 156 | 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] | 157 | } |
| 158 | |
| 159 | get_options() { |
| 160 | while [ $# -gt 0 ]; do |
| 161 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 162 | -f|--filter) |
| 163 | shift; FILTER=$1 |
| 164 | ;; |
| 165 | -e|--exclude) |
| 166 | shift; EXCLUDE=$1 |
| 167 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 168 | -m|--memcheck) |
| 169 | MEMCHECK=1 |
| 170 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 171 | -n|--number) |
| 172 | shift; RUN_TEST_NUMBER=$1 |
| 173 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 174 | -s|--show-numbers) |
| 175 | SHOW_TEST_NUMBER=1 |
| 176 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 177 | -p|--preserve-logs) |
| 178 | PRESERVE_LOGS=1 |
| 179 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame^] | 180 | --outcome-file) |
| 181 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 182 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 183 | --port) |
| 184 | shift; SRV_PORT=$1 |
| 185 | ;; |
| 186 | --proxy-port) |
| 187 | shift; PXY_PORT=$1 |
| 188 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 189 | --seed) |
| 190 | shift; SEED="$1" |
| 191 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 192 | -h|--help) |
| 193 | print_usage |
| 194 | exit 0 |
| 195 | ;; |
| 196 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 197 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 198 | print_usage |
| 199 | exit 1 |
| 200 | ;; |
| 201 | esac |
| 202 | shift |
| 203 | done |
| 204 | } |
| 205 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 206 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 207 | # testing. Skip non-boolean options (with something other than spaces |
| 208 | # and a comment after "#define SYMBOL"). The variable contains a |
| 209 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 210 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 211 | # Skip next test; use this macro to skip tests which are legitimate |
| 212 | # in theory and expected to be re-introduced at some point, but |
| 213 | # aren't expected to succeed at the moment due to problems outside |
| 214 | # our control (such as bugs in other TLS implementations). |
| 215 | skip_next_test() { |
| 216 | SKIP_NEXT="YES" |
| 217 | } |
| 218 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 219 | # 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] | 220 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 221 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 222 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 223 | *) SKIP_NEXT="YES";; |
| 224 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 225 | } |
| 226 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 227 | # 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] | 228 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 229 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 230 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 231 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 232 | } |
| 233 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 234 | requires_all_configs_enabled() { |
| 235 | if ! $P_QUERY -all $* |
| 236 | then |
| 237 | SKIP_NEXT="YES" |
| 238 | fi |
| 239 | } |
| 240 | |
| 241 | requires_all_configs_disabled() { |
| 242 | if $P_QUERY -any $* |
| 243 | then |
| 244 | SKIP_NEXT="YES" |
| 245 | fi |
| 246 | } |
| 247 | |
| 248 | requires_any_configs_enabled() { |
| 249 | if ! $P_QUERY -any $* |
| 250 | then |
| 251 | SKIP_NEXT="YES" |
| 252 | fi |
| 253 | } |
| 254 | |
| 255 | requires_any_configs_disabled() { |
| 256 | if $P_QUERY -all $* |
| 257 | then |
| 258 | SKIP_NEXT="YES" |
| 259 | fi |
| 260 | } |
| 261 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 262 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 263 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 264 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 265 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 266 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 267 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 268 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 269 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 270 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 271 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 272 | then |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 273 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 274 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 275 | then |
| 276 | SKIP_NEXT="YES" |
| 277 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 278 | } |
| 279 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 280 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 281 | # This function uses the query_config command line option to query the |
| 282 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 283 | # program. The command will always return a success value if the |
| 284 | # configuration is defined and the value will be printed to stdout. |
| 285 | # |
| 286 | # Note that if the configuration is not defined or is defined to nothing, |
| 287 | # the output of this function will be an empty string. |
| 288 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 289 | } |
| 290 | |
| 291 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 292 | VAL="$( get_config_value_or_default "$1" )" |
| 293 | if [ -z "$VAL" ]; then |
| 294 | # Should never happen |
| 295 | echo "Mbed TLS configuration $1 is not defined" |
| 296 | exit 1 |
| 297 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 298 | SKIP_NEXT="YES" |
| 299 | fi |
| 300 | } |
| 301 | |
| 302 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 303 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 304 | if [ -z "$VAL" ]; then |
| 305 | # Should never happen |
| 306 | echo "Mbed TLS configuration $1 is not defined" |
| 307 | exit 1 |
| 308 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 309 | SKIP_NEXT="YES" |
| 310 | fi |
| 311 | } |
| 312 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 313 | requires_config_value_equals() { |
| 314 | VAL=$( get_config_value_or_default "$1" ) |
| 315 | if [ -z "$VAL" ]; then |
| 316 | # Should never happen |
| 317 | echo "Mbed TLS configuration $1 is not defined" |
| 318 | exit 1 |
| 319 | elif [ "$VAL" -ne "$2" ]; then |
| 320 | SKIP_NEXT="YES" |
| 321 | fi |
| 322 | } |
| 323 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 324 | # Require Mbed TLS to support the given protocol version. |
| 325 | # |
| 326 | # Inputs: |
| 327 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 328 | requires_protocol_version() { |
| 329 | # Support for DTLS is detected separately in detect_dtls(). |
| 330 | case "$1" in |
| 331 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 332 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 333 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 334 | esac |
| 335 | } |
| 336 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 337 | # Space-separated list of ciphersuites supported by this build of |
| 338 | # Mbed TLS. |
| 339 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 340 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 341 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 342 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 343 | case $P_CIPHERSUITES in |
| 344 | *" $1 "*) :;; |
| 345 | *) SKIP_NEXT="YES";; |
| 346 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 347 | } |
| 348 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 349 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 350 | # If CMD (call to a TLS client or server program) requires certain features, |
| 351 | # arrange to only run the following test case if those features are enabled. |
| 352 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 353 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 354 | *\ force_version=*) |
| 355 | tmp="${1##*\ force_version=}" |
| 356 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 357 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 358 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 359 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 360 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 361 | *\ force_ciphersuite=*) |
| 362 | tmp="${1##*\ force_ciphersuite=}" |
| 363 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 364 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 365 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 366 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 367 | case " $1 " in |
| 368 | *[-_\ =]tickets=[^0]*) |
| 369 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 370 | esac |
| 371 | case " $1 " in |
| 372 | *[-_\ =]alpn=*) |
| 373 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 374 | esac |
| 375 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 376 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 377 | } |
| 378 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 379 | requires_certificate_authentication () { |
| 380 | if [ "$PSK_ONLY" = "YES" ]; then |
| 381 | SKIP_NEXT="YES" |
| 382 | fi |
| 383 | } |
| 384 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 385 | adapt_cmd_for_psk () { |
| 386 | case "$2" in |
| 387 | *openssl*) s='-psk abc123 -nocert';; |
| 388 | *gnutls-*) s='--pskkey=abc123';; |
| 389 | *) s='psk=abc123';; |
| 390 | esac |
| 391 | eval $1='"$2 $s"' |
| 392 | unset s |
| 393 | } |
| 394 | |
| 395 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 396 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 397 | # |
| 398 | # If not running in a PSK-only build, do nothing. |
| 399 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 400 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 401 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 402 | # a pre-shared key, do nothing. |
| 403 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 404 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 405 | # |
| 406 | # Inputs: |
| 407 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 408 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 409 | # * "$@": options passed to run_test. |
| 410 | # |
| 411 | # Outputs: |
| 412 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 413 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 414 | maybe_adapt_for_psk() { |
| 415 | if [ "$PSK_ONLY" != "YES" ]; then |
| 416 | return |
| 417 | fi |
| 418 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 419 | return |
| 420 | fi |
| 421 | case "$CLI_CMD $SRV_CMD" in |
| 422 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 423 | return;; |
| 424 | *force_ciphersuite*) |
| 425 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 426 | # PSK cipher suite could be substituted, but we're not ready for |
| 427 | # that yet. |
| 428 | SKIP_NEXT="YES" |
| 429 | return;; |
| 430 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 431 | # The test case involves certificates. PSK won't do. |
| 432 | SKIP_NEXT="YES" |
| 433 | return;; |
| 434 | esac |
| 435 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 436 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 437 | } |
| 438 | |
| 439 | case " $CONFIGS_ENABLED " in |
| 440 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 441 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 442 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 443 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 444 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 445 | *) PSK_ONLY="NO";; |
| 446 | esac |
| 447 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 448 | HAS_ALG_SHA_1="NO" |
| 449 | HAS_ALG_SHA_224="NO" |
| 450 | HAS_ALG_SHA_256="NO" |
| 451 | HAS_ALG_SHA_384="NO" |
| 452 | HAS_ALG_SHA_512="NO" |
| 453 | |
| 454 | check_for_hash_alg() |
| 455 | { |
| 456 | CURR_ALG="INVALID"; |
| 457 | USE_PSA="NO" |
| 458 | case $CONFIGS_ENABLED in |
| 459 | *" MBEDTLS_USE_PSA_CRYPTO"[\ =]*) |
| 460 | USE_PSA="YES"; |
| 461 | ;; |
| 462 | *) :;; |
| 463 | esac |
| 464 | if [ $USE_PSA = "YES" ]; then |
| 465 | CURR_ALG=PSA_WANT_ALG_${1} |
| 466 | else |
| 467 | CURR_ALG=MBEDTLS_${1}_C |
| 468 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 469 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 470 | fi |
| 471 | |
| 472 | case $CONFIGS_ENABLED in |
| 473 | *" $CURR_ALG"[\ =]*) |
| 474 | return 0 |
| 475 | ;; |
| 476 | *) :;; |
| 477 | esac |
| 478 | return 1 |
| 479 | } |
| 480 | |
| 481 | populate_enabled_hash_algs() |
| 482 | { |
| 483 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 484 | if check_for_hash_alg "$hash_alg"; then |
| 485 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 486 | eval ${hash_alg_variable}=YES |
| 487 | fi |
| 488 | done |
| 489 | } |
| 490 | |
| 491 | # skip next test if the given hash alg is not supported |
| 492 | requires_hash_alg() { |
| 493 | HASH_DEFINE="Invalid" |
| 494 | HAS_HASH_ALG="NO" |
| 495 | case $1 in |
| 496 | SHA_1):;; |
| 497 | SHA_224):;; |
| 498 | SHA_256):;; |
| 499 | SHA_384):;; |
| 500 | SHA_512):;; |
| 501 | *) |
| 502 | echo "Unsupported hash alg - $1" |
| 503 | exit 1 |
| 504 | ;; |
| 505 | esac |
| 506 | |
| 507 | HASH_DEFINE=HAS_ALG_${1} |
| 508 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 509 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 510 | then |
| 511 | SKIP_NEXT="YES" |
| 512 | fi |
| 513 | } |
| 514 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 515 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 516 | requires_openssl_with_fallback_scsv() { |
| 517 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 518 | if $OPENSSL s_client -help 2>&1 | grep fallback_scsv >/dev/null |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 519 | then |
| 520 | OPENSSL_HAS_FBSCSV="YES" |
| 521 | else |
| 522 | OPENSSL_HAS_FBSCSV="NO" |
| 523 | fi |
| 524 | fi |
| 525 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 526 | SKIP_NEXT="YES" |
| 527 | fi |
| 528 | } |
| 529 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 530 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 531 | requires_max_content_len() { |
| 532 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 533 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 534 | } |
| 535 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 536 | # skip next test if GnuTLS isn't available |
| 537 | requires_gnutls() { |
| 538 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 539 | 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] | 540 | GNUTLS_AVAILABLE="YES" |
| 541 | else |
| 542 | GNUTLS_AVAILABLE="NO" |
| 543 | fi |
| 544 | fi |
| 545 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 546 | SKIP_NEXT="YES" |
| 547 | fi |
| 548 | } |
| 549 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 550 | # skip next test if GnuTLS-next isn't available |
| 551 | requires_gnutls_next() { |
| 552 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 553 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 554 | GNUTLS_NEXT_AVAILABLE="YES" |
| 555 | else |
| 556 | GNUTLS_NEXT_AVAILABLE="NO" |
| 557 | fi |
| 558 | fi |
| 559 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 560 | SKIP_NEXT="YES" |
| 561 | fi |
| 562 | } |
| 563 | |
| 564 | # skip next test if OpenSSL-legacy isn't available |
| 565 | requires_openssl_legacy() { |
| 566 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 567 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 568 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 569 | else |
| 570 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 571 | fi |
| 572 | fi |
| 573 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 574 | SKIP_NEXT="YES" |
| 575 | fi |
| 576 | } |
| 577 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 578 | requires_openssl_next() { |
| 579 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 580 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 581 | OPENSSL_NEXT_AVAILABLE="YES" |
| 582 | else |
| 583 | OPENSSL_NEXT_AVAILABLE="NO" |
| 584 | fi |
| 585 | fi |
| 586 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 587 | SKIP_NEXT="YES" |
| 588 | fi |
| 589 | } |
| 590 | |
| 591 | # skip next test if tls1_3 is not available |
| 592 | requires_openssl_tls1_3() { |
| 593 | requires_openssl_next |
| 594 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 595 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 596 | fi |
| 597 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 598 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 599 | then |
| 600 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 601 | else |
| 602 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 603 | fi |
| 604 | fi |
| 605 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 606 | SKIP_NEXT="YES" |
| 607 | fi |
| 608 | } |
| 609 | |
| 610 | # skip next test if tls1_3 is not available |
| 611 | requires_gnutls_tls1_3() { |
| 612 | requires_gnutls_next |
| 613 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 614 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 615 | fi |
| 616 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 617 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 618 | then |
| 619 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 620 | else |
| 621 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 622 | fi |
| 623 | fi |
| 624 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 625 | SKIP_NEXT="YES" |
| 626 | fi |
| 627 | } |
| 628 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 629 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 630 | requires_gnutls_next_no_ticket() { |
| 631 | requires_gnutls_next |
| 632 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 633 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 634 | fi |
| 635 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 636 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 637 | then |
| 638 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 639 | else |
| 640 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 641 | fi |
| 642 | fi |
| 643 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 644 | SKIP_NEXT="YES" |
| 645 | fi |
| 646 | } |
| 647 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 648 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 649 | requires_gnutls_next_disable_tls13_compat() { |
| 650 | requires_gnutls_next |
| 651 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 652 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 653 | fi |
| 654 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 655 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 656 | then |
| 657 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 658 | else |
| 659 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 660 | fi |
| 661 | fi |
| 662 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 663 | SKIP_NEXT="YES" |
| 664 | fi |
| 665 | } |
| 666 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 667 | # skip next test if GnuTLS does not support the record size limit extension |
| 668 | requires_gnutls_record_size_limit() { |
| 669 | requires_gnutls_next |
| 670 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 671 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 672 | else |
| 673 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 674 | fi |
| 675 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 676 | SKIP_NEXT="YES" |
| 677 | fi |
| 678 | } |
| 679 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 680 | # skip next test if IPv6 isn't available on this host |
| 681 | requires_ipv6() { |
| 682 | if [ -z "${HAS_IPV6:-}" ]; then |
| 683 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 684 | SRV_PID=$! |
| 685 | sleep 1 |
| 686 | kill $SRV_PID >/dev/null 2>&1 |
| 687 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 688 | HAS_IPV6="NO" |
| 689 | else |
| 690 | HAS_IPV6="YES" |
| 691 | fi |
| 692 | rm -r $SRV_OUT |
| 693 | fi |
| 694 | |
| 695 | if [ "$HAS_IPV6" = "NO" ]; then |
| 696 | SKIP_NEXT="YES" |
| 697 | fi |
| 698 | } |
| 699 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 700 | # skip next test if it's i686 or uname is not available |
| 701 | requires_not_i686() { |
| 702 | if [ -z "${IS_I686:-}" ]; then |
| 703 | IS_I686="YES" |
| 704 | if which "uname" >/dev/null 2>&1; then |
| 705 | if [ -z "$(uname -a | grep i686)" ]; then |
| 706 | IS_I686="NO" |
| 707 | fi |
| 708 | fi |
| 709 | fi |
| 710 | if [ "$IS_I686" = "YES" ]; then |
| 711 | SKIP_NEXT="YES" |
| 712 | fi |
| 713 | } |
| 714 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 715 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 716 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 717 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 718 | 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] | 719 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 720 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 721 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 722 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 723 | fi |
| 724 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 725 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 726 | fi |
| 727 | |
| 728 | # skip the next test if the SSL output buffer is less than 16KB |
| 729 | requires_full_size_output_buffer() { |
| 730 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 731 | SKIP_NEXT="YES" |
| 732 | fi |
| 733 | } |
| 734 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 735 | # skip the next test if valgrind is in use |
| 736 | not_with_valgrind() { |
| 737 | if [ "$MEMCHECK" -gt 0 ]; then |
| 738 | SKIP_NEXT="YES" |
| 739 | fi |
| 740 | } |
| 741 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 742 | # skip the next test if valgrind is NOT in use |
| 743 | only_with_valgrind() { |
| 744 | if [ "$MEMCHECK" -eq 0 ]; then |
| 745 | SKIP_NEXT="YES" |
| 746 | fi |
| 747 | } |
| 748 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 749 | # 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] | 750 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 751 | CLI_DELAY_FACTOR=$1 |
| 752 | } |
| 753 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 754 | # wait for the given seconds after the client finished in the next test |
| 755 | server_needs_more_time() { |
| 756 | SRV_DELAY_SECONDS=$1 |
| 757 | } |
| 758 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 759 | # print_name <name> |
| 760 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 761 | TESTS=$(( $TESTS + 1 )) |
| 762 | LINE="" |
| 763 | |
| 764 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 765 | LINE="$TESTS " |
| 766 | fi |
| 767 | |
| 768 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 769 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 770 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 771 | for i in `seq 1 $LEN`; do printf '.'; done |
| 772 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 773 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 774 | } |
| 775 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 776 | # record_outcome <outcome> [<failure-reason>] |
| 777 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 778 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 779 | record_outcome() { |
| 780 | echo "$1" |
| 781 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 782 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 783 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 784 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 785 | "$1" "${2-}" \ |
| 786 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 787 | fi |
| 788 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 789 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 790 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 791 | # True if the presence of the given pattern in a log definitely indicates |
| 792 | # that the test has failed. False if the presence is inconclusive. |
| 793 | # |
| 794 | # Inputs: |
| 795 | # * $1: pattern found in the logs |
| 796 | # * $TIMES_LEFT: >0 if retrying is an option |
| 797 | # |
| 798 | # Outputs: |
| 799 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 800 | # unchanged otherwise. |
| 801 | # * Return value: 1 if the pattern is inconclusive, |
| 802 | # 0 if the failure is definitive. |
| 803 | log_pattern_presence_is_conclusive() { |
| 804 | # If we've run out of attempts, then don't retry no matter what. |
| 805 | if [ $TIMES_LEFT -eq 0 ]; then |
| 806 | return 0 |
| 807 | fi |
| 808 | case $1 in |
| 809 | "resend") |
| 810 | # An undesired resend may have been caused by the OS dropping or |
| 811 | # delaying a packet at an inopportune time. |
| 812 | outcome="RETRY(resend)" |
| 813 | return 1;; |
| 814 | esac |
| 815 | } |
| 816 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 817 | # fail <message> |
| 818 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 819 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 820 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 821 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 822 | mv $SRV_OUT o-srv-${TESTS}.log |
| 823 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 824 | if [ -n "$PXY_CMD" ]; then |
| 825 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 826 | fi |
| 827 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 828 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 829 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 830 | echo " ! server output:" |
| 831 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 832 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 833 | echo " ! client output:" |
| 834 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 835 | if [ -n "$PXY_CMD" ]; then |
| 836 | echo " ! ========================================================" |
| 837 | echo " ! proxy output:" |
| 838 | cat o-pxy-${TESTS}.log |
| 839 | fi |
| 840 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 841 | fi |
| 842 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 843 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 844 | } |
| 845 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 846 | # is_polar <cmd_line> |
| 847 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 848 | case "$1" in |
| 849 | *ssl_client2*) true;; |
| 850 | *ssl_server2*) true;; |
| 851 | *) false;; |
| 852 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 853 | } |
| 854 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 855 | # openssl s_server doesn't have -www with DTLS |
| 856 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 857 | case "$SRV_CMD" in |
| 858 | *s_server*-dtls*) |
| 859 | NEEDS_INPUT=1 |
| 860 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 861 | *) NEEDS_INPUT=0;; |
| 862 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 863 | } |
| 864 | |
| 865 | # provide input to commands that need it |
| 866 | provide_input() { |
| 867 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 868 | return |
| 869 | fi |
| 870 | |
| 871 | while true; do |
| 872 | echo "HTTP/1.0 200 OK" |
| 873 | sleep 1 |
| 874 | done |
| 875 | } |
| 876 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 877 | # has_mem_err <log_file_name> |
| 878 | has_mem_err() { |
| 879 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 880 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 881 | then |
| 882 | return 1 # false: does not have errors |
| 883 | else |
| 884 | return 0 # true: has errors |
| 885 | fi |
| 886 | } |
| 887 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 888 | # 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] | 889 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 890 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 891 | newline=' |
| 892 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 893 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 894 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 895 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 896 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 897 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 898 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 899 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 900 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 901 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 902 | # When we use a proxy, it will be listening on the same port we |
| 903 | # 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] | 904 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 905 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 906 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 907 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 908 | echo "$3 START TIMEOUT" |
| 909 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 910 | break |
| 911 | fi |
| 912 | # Linux and *BSD support decimal arguments to sleep. On other |
| 913 | # OSes this may be a tight loop. |
| 914 | sleep 0.1 2>/dev/null || true |
| 915 | done |
| 916 | } |
| 917 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 918 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 919 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 920 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 921 | } |
| 922 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 923 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 924 | # Wait for server process $2 to be listening on port $1. |
| 925 | wait_server_start() { |
| 926 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 927 | } |
| 928 | |
| 929 | # Wait for proxy process $2 to be listening on port $1. |
| 930 | wait_proxy_start() { |
| 931 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 932 | } |
| 933 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 934 | # 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] | 935 | # 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] | 936 | # acceptable bounds |
| 937 | check_server_hello_time() { |
| 938 | # 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] | 939 | 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] | 940 | # Get the Unix timestamp for now |
| 941 | CUR_TIME=$(date +'%s') |
| 942 | THRESHOLD_IN_SECS=300 |
| 943 | |
| 944 | # Check if the ServerHello time was printed |
| 945 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 946 | return 1 |
| 947 | fi |
| 948 | |
| 949 | # Check the time in ServerHello is within acceptable bounds |
| 950 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 951 | # The time in ServerHello is at least 5 minutes before now |
| 952 | return 1 |
| 953 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 954 | # 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] | 955 | return 1 |
| 956 | else |
| 957 | return 0 |
| 958 | fi |
| 959 | } |
| 960 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 961 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 962 | handshake_memory_get() { |
| 963 | OUTPUT_VARIABLE="$1" |
| 964 | OUTPUT_FILE="$2" |
| 965 | |
| 966 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 967 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 968 | |
| 969 | # Check if memory usage was read |
| 970 | if [ -z "$MEM_USAGE" ]; then |
| 971 | echo "Error: Can not read the value of handshake memory usage" |
| 972 | return 1 |
| 973 | else |
| 974 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 975 | return 0 |
| 976 | fi |
| 977 | } |
| 978 | |
| 979 | # Get handshake memory usage from server or client output and check if this value |
| 980 | # is not higher than the maximum given by the first argument |
| 981 | handshake_memory_check() { |
| 982 | MAX_MEMORY="$1" |
| 983 | OUTPUT_FILE="$2" |
| 984 | |
| 985 | # Get memory usage |
| 986 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 987 | return 1 |
| 988 | fi |
| 989 | |
| 990 | # Check if memory usage is below max value |
| 991 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 992 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 993 | "but should be below $MAX_MEMORY bytes" |
| 994 | return 1 |
| 995 | else |
| 996 | return 0 |
| 997 | fi |
| 998 | } |
| 999 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1000 | # wait for client to terminate and set CLI_EXIT |
| 1001 | # must be called right after starting the client |
| 1002 | wait_client_done() { |
| 1003 | CLI_PID=$! |
| 1004 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1005 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1006 | CLI_DELAY_FACTOR=1 |
| 1007 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1008 | ( 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] | 1009 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1010 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1011 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1012 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1013 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1014 | CLI_EXIT=$? |
| 1015 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1016 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1017 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1018 | |
| 1019 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1020 | |
| 1021 | sleep $SRV_DELAY_SECONDS |
| 1022 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1023 | } |
| 1024 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1025 | # check if the given command uses dtls and sets global variable DTLS |
| 1026 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1027 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1028 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1029 | *) DTLS=0;; |
| 1030 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1031 | } |
| 1032 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1033 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1034 | is_gnutls() { |
| 1035 | case "$1" in |
| 1036 | *gnutls-cli*) |
| 1037 | CMD_IS_GNUTLS=1 |
| 1038 | ;; |
| 1039 | *gnutls-serv*) |
| 1040 | CMD_IS_GNUTLS=1 |
| 1041 | ;; |
| 1042 | *) |
| 1043 | CMD_IS_GNUTLS=0 |
| 1044 | ;; |
| 1045 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1046 | } |
| 1047 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1048 | # Generate random psk_list argument for ssl_server2 |
| 1049 | get_srv_psk_list () |
| 1050 | { |
| 1051 | case $(( TESTS % 3 )) in |
| 1052 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1053 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1054 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1055 | esac |
| 1056 | } |
| 1057 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1058 | # Determine what calc_verify trace is to be expected, if any. |
| 1059 | # |
| 1060 | # calc_verify is only called for two things: to calculate the |
| 1061 | # extended master secret, and to process client authentication. |
| 1062 | # |
| 1063 | # Warning: the current implementation assumes that extended_ms is not |
| 1064 | # disabled on the client or on the server. |
| 1065 | # |
| 1066 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1067 | # * $1: the value of the server auth_mode parameter. |
| 1068 | # 'required' if client authentication is expected, |
| 1069 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1070 | # * $CONFIGS_ENABLED |
| 1071 | # |
| 1072 | # Outputs: |
| 1073 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1074 | set_maybe_calc_verify() { |
| 1075 | maybe_calc_verify= |
| 1076 | case $CONFIGS_ENABLED in |
| 1077 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1078 | *) |
| 1079 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1080 | ''|none) return;; |
| 1081 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1082 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1083 | esac |
| 1084 | esac |
| 1085 | case $CONFIGS_ENABLED in |
| 1086 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1087 | *) maybe_calc_verify="<= calc verify";; |
| 1088 | esac |
| 1089 | } |
| 1090 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1091 | # Compare file content |
| 1092 | # Usage: find_in_both pattern file1 file2 |
| 1093 | # extract from file1 the first line matching the pattern |
| 1094 | # check in file2 that the same line can be found |
| 1095 | find_in_both() { |
| 1096 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1097 | if [ -z "$srv_pattern" ]; then |
| 1098 | return 1; |
| 1099 | fi |
| 1100 | |
| 1101 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1102 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1103 | else |
| 1104 | return 1; |
| 1105 | fi |
| 1106 | } |
| 1107 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1108 | SKIP_HANDSHAKE_CHECK="NO" |
| 1109 | skip_handshake_stage_check() { |
| 1110 | SKIP_HANDSHAKE_CHECK="YES" |
| 1111 | } |
| 1112 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1113 | # Analyze the commands that will be used in a test. |
| 1114 | # |
| 1115 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1116 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1117 | # |
| 1118 | # Inputs: |
| 1119 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1120 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1121 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1122 | # |
| 1123 | # Outputs: |
| 1124 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1125 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1126 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1127 | # 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] | 1128 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1129 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1130 | case " $SRV_CMD " in |
| 1131 | *' server_addr=::1 '*) |
| 1132 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1133 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1134 | fi |
| 1135 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1136 | # update CMD_IS_GNUTLS variable |
| 1137 | is_gnutls "$SRV_CMD" |
| 1138 | |
| 1139 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1140 | # set the default priority |
| 1141 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1142 | case "$SRV_CMD" in |
| 1143 | *--priority*) :;; |
| 1144 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1145 | esac |
| 1146 | fi |
| 1147 | |
| 1148 | # update CMD_IS_GNUTLS variable |
| 1149 | is_gnutls "$CLI_CMD" |
| 1150 | |
| 1151 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1152 | # set the default priority |
| 1153 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1154 | case "$CLI_CMD" in |
| 1155 | *--priority*) :;; |
| 1156 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1157 | esac |
| 1158 | fi |
| 1159 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1160 | # fix client port |
| 1161 | if [ -n "$PXY_CMD" ]; then |
| 1162 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1163 | else |
| 1164 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1165 | fi |
| 1166 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1167 | # prepend valgrind to our commands if active |
| 1168 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1169 | if is_polar "$SRV_CMD"; then |
| 1170 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1171 | fi |
| 1172 | if is_polar "$CLI_CMD"; then |
| 1173 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1174 | fi |
| 1175 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1176 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1177 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1178 | # Check for failure conditions after a test case. |
| 1179 | # |
| 1180 | # Inputs from run_test: |
| 1181 | # * positional parameters: test options (see run_test documentation) |
| 1182 | # * $CLI_EXIT: client return code |
| 1183 | # * $CLI_EXPECT: expected client return code |
| 1184 | # * $SRV_RET: server return code |
| 1185 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1186 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1187 | # |
| 1188 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1189 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1190 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1191 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1192 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1193 | if [ $TIMES_LEFT -gt 0 ] && |
| 1194 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1195 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1196 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1197 | return |
| 1198 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1199 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1200 | # 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] | 1201 | # (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] | 1202 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1203 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1204 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1205 | then |
| 1206 | if is_polar "$SRV_CMD"; then |
| 1207 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1208 | else |
| 1209 | fail "server or client failed to reach handshake stage" |
| 1210 | return |
| 1211 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1212 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1213 | if is_polar "$CLI_CMD"; then |
| 1214 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1215 | else |
| 1216 | fail "server or client failed to reach handshake stage" |
| 1217 | return |
| 1218 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1219 | fi |
| 1220 | fi |
| 1221 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1222 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1223 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1224 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1225 | # care anyway), in case e.g. the server reports a memory leak. |
| 1226 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1227 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1228 | return |
| 1229 | fi |
| 1230 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1231 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1232 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1233 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1234 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1235 | 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] | 1236 | return |
| 1237 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1238 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1239 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1240 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1241 | # 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] | 1242 | while [ $# -gt 0 ] |
| 1243 | do |
| 1244 | case $1 in |
| 1245 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1246 | 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] | 1247 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1248 | return |
| 1249 | fi |
| 1250 | ;; |
| 1251 | |
| 1252 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1253 | 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] | 1254 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1255 | return |
| 1256 | fi |
| 1257 | ;; |
| 1258 | |
| 1259 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1260 | 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] | 1261 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1262 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1263 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1264 | return |
| 1265 | fi |
| 1266 | ;; |
| 1267 | |
| 1268 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1269 | 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] | 1270 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1271 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1272 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1273 | return |
| 1274 | fi |
| 1275 | ;; |
| 1276 | |
| 1277 | # The filtering in the following two options (-u and -U) do the following |
| 1278 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1279 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1280 | # - keep one of each non-unique line |
| 1281 | # - count how many lines remain |
| 1282 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1283 | # if there were no duplicates. |
| 1284 | "-U") |
| 1285 | 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 |
| 1286 | fail "lines following pattern '$2' must be unique in Server output" |
| 1287 | return |
| 1288 | fi |
| 1289 | ;; |
| 1290 | |
| 1291 | "-u") |
| 1292 | 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 |
| 1293 | 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] | 1294 | return |
| 1295 | fi |
| 1296 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1297 | "-F") |
| 1298 | if ! $2 "$SRV_OUT"; then |
| 1299 | fail "function call to '$2' failed on Server output" |
| 1300 | return |
| 1301 | fi |
| 1302 | ;; |
| 1303 | "-f") |
| 1304 | if ! $2 "$CLI_OUT"; then |
| 1305 | fail "function call to '$2' failed on Client output" |
| 1306 | return |
| 1307 | fi |
| 1308 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1309 | "-g") |
| 1310 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1311 | fail "function call to '$2' failed on Server and Client output" |
| 1312 | return |
| 1313 | fi |
| 1314 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1315 | |
| 1316 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1317 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1318 | exit 1 |
| 1319 | esac |
| 1320 | shift 2 |
| 1321 | done |
| 1322 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1323 | # check valgrind's results |
| 1324 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1325 | 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] | 1326 | fail "Server has memory errors" |
| 1327 | return |
| 1328 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1329 | 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] | 1330 | fail "Client has memory errors" |
| 1331 | return |
| 1332 | fi |
| 1333 | fi |
| 1334 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1335 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1336 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1337 | } |
| 1338 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1339 | # Run the current test case: start the server and if applicable the proxy, run |
| 1340 | # the client, wait for all processes to finish or time out. |
| 1341 | # |
| 1342 | # Inputs: |
| 1343 | # * $NAME: test case name |
| 1344 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1345 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1346 | # |
| 1347 | # Outputs: |
| 1348 | # * $CLI_EXIT: client return code |
| 1349 | # * $SRV_RET: server return code |
| 1350 | do_run_test_once() { |
| 1351 | # run the commands |
| 1352 | if [ -n "$PXY_CMD" ]; then |
| 1353 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1354 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1355 | PXY_PID=$! |
| 1356 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1357 | fi |
| 1358 | |
| 1359 | check_osrv_dtls |
| 1360 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1361 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1362 | SRV_PID=$! |
| 1363 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1364 | |
| 1365 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1366 | # The client must be a subprocess of the script in order for killing it to |
| 1367 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1368 | # not at the end of the line: the latter approach will spawn eval as a |
| 1369 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1370 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1371 | wait_client_done |
| 1372 | |
| 1373 | sleep 0.05 |
| 1374 | |
| 1375 | # terminate the server (and the proxy) |
| 1376 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1377 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1378 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1379 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1380 | SRV_RET=$? |
| 1381 | |
| 1382 | if [ -n "$PXY_CMD" ]; then |
| 1383 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1384 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1385 | fi |
| 1386 | } |
| 1387 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1388 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1389 | # Options: -s pattern pattern that must be present in server output |
| 1390 | # -c pattern pattern that must be present in client output |
| 1391 | # -u pattern lines after pattern must be unique in client output |
| 1392 | # -f call shell function on client output |
| 1393 | # -S pattern pattern that must be absent in server output |
| 1394 | # -C pattern pattern that must be absent in client output |
| 1395 | # -U pattern lines after pattern must be unique in server output |
| 1396 | # -F call shell function on server output |
| 1397 | # -g call shell function on server and client output |
| 1398 | run_test() { |
| 1399 | NAME="$1" |
| 1400 | shift 1 |
| 1401 | |
| 1402 | if is_excluded "$NAME"; then |
| 1403 | SKIP_NEXT="NO" |
| 1404 | # There was no request to run the test, so don't record its outcome. |
| 1405 | return |
| 1406 | fi |
| 1407 | |
| 1408 | print_name "$NAME" |
| 1409 | |
| 1410 | # Do we only run numbered tests? |
| 1411 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1412 | case ",$RUN_TEST_NUMBER," in |
| 1413 | *",$TESTS,"*) :;; |
| 1414 | *) SKIP_NEXT="YES";; |
| 1415 | esac |
| 1416 | fi |
| 1417 | |
| 1418 | # does this test use a proxy? |
| 1419 | if [ "X$1" = "X-p" ]; then |
| 1420 | PXY_CMD="$2" |
| 1421 | shift 2 |
| 1422 | else |
| 1423 | PXY_CMD="" |
| 1424 | fi |
| 1425 | |
| 1426 | # get commands and client output |
| 1427 | SRV_CMD="$1" |
| 1428 | CLI_CMD="$2" |
| 1429 | CLI_EXPECT="$3" |
| 1430 | shift 3 |
| 1431 | |
| 1432 | # Check if test uses files |
| 1433 | case "$SRV_CMD $CLI_CMD" in |
| 1434 | *data_files/*) |
| 1435 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1436 | esac |
| 1437 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1438 | # Check if the test uses DTLS. |
| 1439 | detect_dtls "$SRV_CMD" |
| 1440 | if [ "$DTLS" -eq 1 ]; then |
| 1441 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1442 | fi |
| 1443 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1444 | # If the client or server requires certain features that can be detected |
| 1445 | # from their command-line arguments, check that they're enabled. |
| 1446 | detect_required_features "$SRV_CMD" "$@" |
| 1447 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1448 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1449 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1450 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1451 | |
| 1452 | # should we skip? |
| 1453 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1454 | SKIP_NEXT="NO" |
| 1455 | record_outcome "SKIP" |
| 1456 | SKIPS=$(( $SKIPS + 1 )) |
| 1457 | return |
| 1458 | fi |
| 1459 | |
| 1460 | analyze_test_commands "$@" |
| 1461 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1462 | # One regular run and two retries |
| 1463 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1464 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1465 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1466 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1467 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1468 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1469 | check_test_failure "$@" |
| 1470 | case $outcome in |
| 1471 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1472 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1473 | FAIL) return;; |
| 1474 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1475 | done |
| 1476 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1477 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1478 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1479 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1480 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1481 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1482 | if [ -n "$PXY_CMD" ]; then |
| 1483 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1484 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1485 | fi |
| 1486 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1487 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1488 | } |
| 1489 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1490 | run_test_psa() { |
| 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 | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1493 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1494 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1495 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1496 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1497 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1498 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1499 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1500 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +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."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1503 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1504 | -S "error" \ |
| 1505 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1506 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1507 | } |
| 1508 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1509 | run_test_psa_force_curve() { |
| 1510 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1511 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1512 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1513 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1514 | "$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] | 1515 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1516 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1517 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1518 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1519 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1520 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1521 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1522 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1523 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1524 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1525 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1526 | } |
| 1527 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1528 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1529 | # a maximum fragment length. |
| 1530 | # first argument ($1) is MFL for SSL client |
| 1531 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1532 | run_test_memory_after_hanshake_with_mfl() |
| 1533 | { |
| 1534 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1535 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1536 | |
| 1537 | # Leave some margin for robustness |
| 1538 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1539 | |
| 1540 | run_test "Handshake memory usage (MFL $1)" \ |
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 max_frag_len=$1" \ |
| 1545 | 0 \ |
| 1546 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1547 | } |
| 1548 | |
| 1549 | |
| 1550 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1551 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1552 | run_tests_memory_after_hanshake() |
| 1553 | { |
| 1554 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1555 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1556 | |
| 1557 | # first test with default MFU is to get reference memory usage |
| 1558 | MEMORY_USAGE_MFL_16K=0 |
| 1559 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1560 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1561 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1562 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1563 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1564 | 0 \ |
| 1565 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1566 | |
| 1567 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1568 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1569 | |
| 1570 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1571 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1572 | |
| 1573 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1574 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1575 | |
| 1576 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1577 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1578 | } |
| 1579 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1580 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1581 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1582 | rm -f context_srv.txt |
| 1583 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1584 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1585 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1586 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1587 | 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] | 1588 | exit 1 |
| 1589 | } |
| 1590 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1591 | # |
| 1592 | # MAIN |
| 1593 | # |
| 1594 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1595 | get_options "$@" |
| 1596 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame^] | 1597 | # Make the outcome file path relative to the original directory, not |
| 1598 | # to .../tests |
| 1599 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1600 | [!/]*) |
| 1601 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1602 | ;; |
| 1603 | esac |
| 1604 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1605 | populate_enabled_hash_algs |
| 1606 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1607 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1608 | # patterns rather than regular expressions, use a case statement instead |
| 1609 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1610 | # detects simple cases: plain substring, everything, nothing. |
| 1611 | # |
| 1612 | # As an exception, the character '.' is treated as an ordinary character |
| 1613 | # if it is the only special character in the string. This is because it's |
| 1614 | # rare to need "any one character", but needing a literal '.' is common |
| 1615 | # (e.g. '-f "DTLS 1.2"'). |
| 1616 | need_grep= |
| 1617 | case "$FILTER" in |
| 1618 | '^$') simple_filter=;; |
| 1619 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1620 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1621 | need_grep=1;; |
| 1622 | *) # No regexp or shell-pattern special character |
| 1623 | simple_filter="*$FILTER*";; |
| 1624 | esac |
| 1625 | case "$EXCLUDE" in |
| 1626 | '^$') simple_exclude=;; |
| 1627 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1628 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1629 | need_grep=1;; |
| 1630 | *) # No regexp or shell-pattern special character |
| 1631 | simple_exclude="*$EXCLUDE*";; |
| 1632 | esac |
| 1633 | if [ -n "$need_grep" ]; then |
| 1634 | is_excluded () { |
| 1635 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1636 | } |
| 1637 | else |
| 1638 | is_excluded () { |
| 1639 | case "$1" in |
| 1640 | $simple_exclude) true;; |
| 1641 | $simple_filter) false;; |
| 1642 | *) true;; |
| 1643 | esac |
| 1644 | } |
| 1645 | fi |
| 1646 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1647 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1648 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1649 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1650 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1651 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1652 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1653 | exit 1 |
| 1654 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1655 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1656 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1657 | exit 1 |
| 1658 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1659 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1660 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1661 | exit 1 |
| 1662 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1663 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1664 | if which valgrind >/dev/null 2>&1; then :; else |
| 1665 | echo "Memcheck not possible. Valgrind not found" |
| 1666 | exit 1 |
| 1667 | fi |
| 1668 | fi |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 1669 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1670 | echo "Command '$OPENSSL' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1671 | exit 1 |
| 1672 | fi |
| 1673 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1674 | # used by watchdog |
| 1675 | MAIN_PID="$$" |
| 1676 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1677 | # We use somewhat arbitrary delays for tests: |
| 1678 | # - how long do we wait for the server to start (when lsof not available)? |
| 1679 | # - how long do we allow for the client to finish? |
| 1680 | # (not to check performance, just to avoid waiting indefinitely) |
| 1681 | # Things are slower with valgrind, so give extra time here. |
| 1682 | # |
| 1683 | # Note: without lsof, there is a trade-off between the running time of this |
| 1684 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1685 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1686 | # 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] | 1687 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1688 | START_DELAY=6 |
| 1689 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1690 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1691 | START_DELAY=2 |
| 1692 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1693 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1694 | |
| 1695 | # some particular tests need more time: |
| 1696 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1697 | # - for the server, we sleep for a number of seconds after the client exits |
| 1698 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1699 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1700 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1701 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1702 | # 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] | 1703 | # +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] | 1704 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1705 | # 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] | 1706 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1707 | 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] | 1708 | 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] | 1709 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1710 | 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] | 1711 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1712 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1713 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1714 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1715 | 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] | 1716 | 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] | 1717 | fi |
| 1718 | |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1719 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 1720 | # low-security ones. This covers not just cipher suites but also protocol |
| 1721 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 1722 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 1723 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 1724 | # a way to discover it from -help, so check the openssl version. |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 1725 | case $($OPENSSL version) in |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1726 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 1727 | *) |
| 1728 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 1729 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 1730 | ;; |
| 1731 | esac |
| 1732 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1733 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1734 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1735 | 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] | 1736 | 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] | 1737 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1738 | 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] | 1739 | fi |
| 1740 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1741 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1742 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1743 | 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] | 1744 | fi |
| 1745 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1746 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1747 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1748 | 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] | 1749 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1750 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1751 | # Allow SHA-1, because many of our test certificates use it |
| 1752 | P_SRV="$P_SRV allow_sha1=1" |
| 1753 | P_CLI="$P_CLI allow_sha1=1" |
| 1754 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1755 | # Also pick a unique name for intermediate files |
| 1756 | SRV_OUT="srv_out.$$" |
| 1757 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1758 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1759 | SESSION="session.$$" |
| 1760 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1761 | SKIP_NEXT="NO" |
| 1762 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1763 | trap cleanup INT TERM HUP |
| 1764 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1765 | # Basic test |
| 1766 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1767 | # Checks that: |
| 1768 | # - 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] | 1769 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1771 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1772 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1773 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1774 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1775 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1776 | "$P_CLI" \ |
| 1777 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1778 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1779 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1780 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1781 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1782 | -S "error" \ |
| 1783 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1784 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1786 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1787 | run_test "Default, DTLS" \ |
| 1788 | "$P_SRV dtls=1" \ |
| 1789 | "$P_CLI dtls=1" \ |
| 1790 | 0 \ |
| 1791 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1792 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1793 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1795 | run_test "TLS client auth: required" \ |
| 1796 | "$P_SRV auth_mode=required" \ |
| 1797 | "$P_CLI" \ |
| 1798 | 0 \ |
| 1799 | -s "Verifying peer X.509 certificate... ok" |
| 1800 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1802 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1803 | "$P_SRV" \ |
| 1804 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1805 | 0 \ |
| 1806 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1807 | -c "Key size is 256" |
| 1808 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1810 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1811 | "$P_SRV" \ |
| 1812 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1813 | 0 \ |
| 1814 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1815 | -c "Key size is 128" |
| 1816 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1818 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1819 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1820 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1821 | run_test "TLS: password protected client key" \ |
| 1822 | "$P_SRV auth_mode=required" \ |
| 1823 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1824 | 0 |
| 1825 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1827 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1828 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1829 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1830 | run_test "TLS: password protected server key" \ |
| 1831 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1832 | "$P_CLI" \ |
| 1833 | 0 |
| 1834 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1836 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1837 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1838 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1839 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1840 | run_test "TLS: password protected server key, two certificates" \ |
| 1841 | "$P_SRV \ |
| 1842 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1843 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1844 | "$P_CLI" \ |
| 1845 | 0 |
| 1846 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1848 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1849 | run_test "CA callback on client" \ |
| 1850 | "$P_SRV debug_level=3" \ |
| 1851 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1852 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1853 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1854 | -S "error" \ |
| 1855 | -C "error" |
| 1856 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1858 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1859 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1860 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1861 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1862 | run_test "CA callback on server" \ |
| 1863 | "$P_SRV auth_mode=required" \ |
| 1864 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1865 | key_file=data_files/server5.key" \ |
| 1866 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1867 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1868 | -s "Verifying peer X.509 certificate... ok" \ |
| 1869 | -S "error" \ |
| 1870 | -C "error" |
| 1871 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1872 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1874 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1875 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1876 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1877 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1878 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1879 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1880 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1881 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1882 | 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] | 1883 | 0 \ |
| 1884 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1885 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1886 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1887 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1888 | -S "error" \ |
| 1889 | -C "error" |
| 1890 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1891 | # Test using a RSA opaque private key for client authentication |
| 1892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1893 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1894 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1895 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1896 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1897 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1898 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1899 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1900 | key_file=data_files/server2.key" \ |
| 1901 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1902 | 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] | 1903 | 0 \ |
| 1904 | -c "key type: Opaque" \ |
| 1905 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1906 | -s "Verifying peer X.509 certificate... ok" \ |
| 1907 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1908 | -S "error" \ |
| 1909 | -C "error" |
| 1910 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1912 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1913 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1914 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1915 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1916 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1917 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1918 | key_file=data_files/server2.key" \ |
| 1919 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1920 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1921 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1922 | 0 \ |
| 1923 | -c "key type: Opaque" \ |
| 1924 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1925 | -s "Verifying peer X.509 certificate... ok" \ |
| 1926 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1927 | -S "error" \ |
| 1928 | -C "error" |
| 1929 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1930 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1932 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1933 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1934 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1935 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1936 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1937 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1938 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1939 | "$P_CLI" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1940 | 0 \ |
| 1941 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1942 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1943 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1944 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1945 | -S "error" \ |
| 1946 | -C "error" |
| 1947 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1949 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1950 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1951 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1952 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1953 | run_test "Opaque key for server authentication: ECDH-" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1954 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1955 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1956 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1957 | "$P_CLI" \ |
| 1958 | 0 \ |
| 1959 | -c "Verifying peer X.509 certificate... ok" \ |
| 1960 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1961 | -s "key types: Opaque, none" \ |
| 1962 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1963 | -S "error" \ |
| 1964 | -C "error" |
| 1965 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1967 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1968 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1969 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1970 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1971 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1972 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 1973 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 1974 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1975 | debug_level=1" \ |
| 1976 | "$P_CLI" \ |
| 1977 | 1 \ |
| 1978 | -s "key types: Opaque, none" \ |
| 1979 | -s "error" \ |
| 1980 | -c "error" \ |
| 1981 | -c "Public key type mismatch" |
| 1982 | |
| 1983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1984 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1985 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1986 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1987 | requires_config_enabled MBEDTLS_RSA_C |
| 1988 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1989 | requires_hash_alg SHA_256 |
| 1990 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 1991 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1992 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 1993 | debug_level=1" \ |
| 1994 | "$P_CLI" \ |
| 1995 | 1 \ |
| 1996 | -s "key types: Opaque, none" \ |
| 1997 | -s "error" \ |
| 1998 | -c "error" \ |
| 1999 | -c "Public key type mismatch" |
| 2000 | |
| 2001 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2002 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2003 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2004 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2005 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2006 | requires_hash_alg SHA_256 |
| 2007 | 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] | 2008 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2009 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2010 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2011 | "$P_CLI" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2012 | 1 \ |
| 2013 | -s "key types: Opaque, none" \ |
| 2014 | -s "got ciphersuites in common, but none of them usable" \ |
| 2015 | -s "error" \ |
| 2016 | -c "error" |
| 2017 | |
| 2018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2019 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2020 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2021 | requires_config_enabled MBEDTLS_ECDSA_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2022 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2023 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2024 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2025 | 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] | 2026 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2027 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2028 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2029 | "$P_CLI" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2030 | 1 \ |
| 2031 | -s "key types: Opaque, none" \ |
| 2032 | -s "got ciphersuites in common, but none of them usable" \ |
| 2033 | -s "error" \ |
| 2034 | -c "error" |
| 2035 | |
| 2036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2037 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2038 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2039 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2040 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2041 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2042 | 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] | 2043 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2044 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 2045 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2046 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2047 | 1 \ |
| 2048 | -s "key types: Opaque, none" \ |
| 2049 | -s "got ciphersuites in common, but none of them usable" \ |
| 2050 | -s "error" \ |
| 2051 | -c "error" |
| 2052 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2054 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2055 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2056 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2057 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2058 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2059 | 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] | 2060 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2061 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2062 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2063 | key_opaque_algs2=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2064 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2065 | 0 \ |
| 2066 | -c "Verifying peer X.509 certificate... ok" \ |
| 2067 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2068 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2069 | -s "key types: Opaque, Opaque" \ |
| 2070 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2071 | -S "error" \ |
| 2072 | -C "error" |
| 2073 | |
| 2074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2076 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2077 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2078 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2079 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2080 | 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] | 2081 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2082 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2083 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2084 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2085 | "$P_CLI force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2086 | 0 \ |
| 2087 | -c "Verifying peer X.509 certificate... ok" \ |
| 2088 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2089 | -c "CN=Polarssl Test EC CA" \ |
| 2090 | -s "key types: Opaque, Opaque" \ |
| 2091 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2092 | -S "error" \ |
| 2093 | -C "error" |
| 2094 | |
| 2095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2096 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2097 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2098 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2099 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2100 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2101 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2102 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2103 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2104 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2105 | crt_file2=data_files/server2-sha256.crt \ |
| 2106 | 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] | 2107 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2108 | 0 \ |
| 2109 | -c "Verifying peer X.509 certificate... ok" \ |
| 2110 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2111 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2112 | -s "key types: Opaque, Opaque" \ |
| 2113 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2114 | -S "error" \ |
| 2115 | -C "error" |
| 2116 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2118 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2119 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2120 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2121 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2122 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2123 | "$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] | 2124 | "$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] | 2125 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2126 | -s "The SSL configuration is tls13 only" \ |
| 2127 | -c "key type: Opaque" \ |
| 2128 | -s "key types: Opaque, Opaque" \ |
| 2129 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2130 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2131 | |
| 2132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2133 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2134 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2136 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2137 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2138 | "$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] | 2139 | "$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] | 2140 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2141 | -s "The SSL configuration is tls13 only" \ |
| 2142 | -c "key type: Opaque" \ |
| 2143 | -s "key types: Opaque, Opaque" \ |
| 2144 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2145 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2146 | |
| 2147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2148 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2149 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2150 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2151 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2152 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
| 2153 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
| 2154 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2155 | 0 \ |
| 2156 | -s "The SSL configuration is tls13 only" \ |
| 2157 | -s "key types: Opaque, Opaque" \ |
| 2158 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2159 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2160 | -C "error" \ |
| 2161 | -S "error" \ |
| 2162 | |
| 2163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2164 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2165 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2167 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2168 | 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] | 2169 | "$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] | 2170 | "$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] | 2171 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2172 | -s "The SSL configuration is tls13 only" \ |
| 2173 | -c "key type: Opaque" \ |
| 2174 | -s "key types: Opaque, Opaque" \ |
| 2175 | -C "error" \ |
| 2176 | -S "error" \ |
| 2177 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2178 | # Test using a RSA opaque private key for server authentication |
| 2179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2180 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2181 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2182 | requires_config_enabled MBEDTLS_ECDSA_C |
| 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: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2186 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2187 | 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] | 2188 | "$P_CLI" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2189 | 0 \ |
| 2190 | -c "Verifying peer X.509 certificate... ok" \ |
| 2191 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2192 | -s "key types: Opaque, none" \ |
| 2193 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2194 | -S "error" \ |
| 2195 | -C "error" |
| 2196 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2198 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2199 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2200 | requires_config_enabled MBEDTLS_ECDSA_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: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2204 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2205 | 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] | 2206 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2207 | 0 \ |
| 2208 | -c "Verifying peer X.509 certificate... ok" \ |
| 2209 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2210 | -s "key types: Opaque, none" \ |
| 2211 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2212 | -S "error" \ |
| 2213 | -C "error" |
| 2214 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2216 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2217 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 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: RSA-PSK" \ |
| 2221 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2222 | psk=abc123 psk_identity=foo" \ |
| 2223 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 2224 | psk=abc123 psk_identity=foo" \ |
| 2225 | 0 \ |
| 2226 | -c "Verifying peer X.509 certificate... ok" \ |
| 2227 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2228 | -s "key types: Opaque, Opaque" \ |
| 2229 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2230 | -S "error" \ |
| 2231 | -C "error" |
| 2232 | |
| 2233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2234 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2235 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2236 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2237 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2238 | run_test "Opaque key for server authentication: RSA-" \ |
| 2239 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
| 2240 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
| 2241 | 0 \ |
| 2242 | -c "Verifying peer X.509 certificate... ok" \ |
| 2243 | -c "Ciphersuite is TLS-RSA-" \ |
| 2244 | -s "key types: Opaque, Opaque" \ |
| 2245 | -s "Ciphersuite is TLS-RSA-" \ |
| 2246 | -S "error" \ |
| 2247 | -C "error" |
| 2248 | |
| 2249 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2250 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2251 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2252 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2253 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2254 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2255 | 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] | 2256 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2257 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2258 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2259 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2260 | 1 \ |
| 2261 | -s "key types: Opaque, none" \ |
| 2262 | -s "got ciphersuites in common, but none of them usable" \ |
| 2263 | -s "error" \ |
| 2264 | -c "error" |
| 2265 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2267 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2268 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2269 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2270 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2271 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2272 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2273 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2274 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2275 | 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] | 2276 | crt_file2=data_files/server4.crt \ |
| 2277 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2278 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2279 | 0 \ |
| 2280 | -c "Verifying peer X.509 certificate... ok" \ |
| 2281 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2282 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2283 | -s "key types: Opaque, Opaque" \ |
| 2284 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2285 | -S "error" \ |
| 2286 | -C "error" |
| 2287 | |
| 2288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2289 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2290 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2291 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2292 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2293 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2294 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2295 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2296 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2297 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2298 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2299 | crt_file2=data_files/server4.crt \ |
| 2300 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2301 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2302 | 0 \ |
| 2303 | -c "Verifying peer X.509 certificate... ok" \ |
| 2304 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2305 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2306 | -s "key types: Opaque, Opaque" \ |
| 2307 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2308 | -S "error" \ |
| 2309 | -C "error" |
| 2310 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2311 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2313 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2314 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2315 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2316 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2317 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2318 | "$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] | 2319 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2320 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2321 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2322 | 0 \ |
| 2323 | -c "key type: Opaque" \ |
| 2324 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2325 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2326 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2327 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2328 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2329 | -S "error" \ |
| 2330 | -C "error" |
| 2331 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2332 | # Test using a RSA opaque private key for client/server authentication |
| 2333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2334 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2335 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2336 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2337 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2338 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2339 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2340 | "$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] | 2341 | 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] | 2342 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2343 | 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] | 2344 | 0 \ |
| 2345 | -c "key type: Opaque" \ |
| 2346 | -c "Verifying peer X.509 certificate... ok" \ |
| 2347 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2348 | -s "key types: Opaque, none" \ |
| 2349 | -s "Verifying peer X.509 certificate... ok" \ |
| 2350 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2351 | -S "error" \ |
| 2352 | -C "error" |
| 2353 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2355 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2356 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2357 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2358 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2359 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2360 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2361 | "$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] | 2362 | 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] | 2363 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2364 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2365 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2366 | 0 \ |
| 2367 | -c "key type: Opaque" \ |
| 2368 | -c "Verifying peer X.509 certificate... ok" \ |
| 2369 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2370 | -s "key types: Opaque, none" \ |
| 2371 | -s "Verifying peer X.509 certificate... ok" \ |
| 2372 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2373 | -S "error" \ |
| 2374 | -C "error" |
| 2375 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2376 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2377 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2378 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2379 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2380 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2381 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2382 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2383 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2384 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2385 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2386 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2387 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2388 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2390 | run_test_psa_force_curve "secp521r1" |
| 2391 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2392 | run_test_psa_force_curve "brainpoolP512r1" |
| 2393 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2394 | run_test_psa_force_curve "secp384r1" |
| 2395 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2396 | run_test_psa_force_curve "brainpoolP384r1" |
| 2397 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2398 | run_test_psa_force_curve "secp256r1" |
| 2399 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2400 | run_test_psa_force_curve "secp256k1" |
| 2401 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2402 | run_test_psa_force_curve "brainpoolP256r1" |
| 2403 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2404 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2405 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2406 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2407 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2408 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2409 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2410 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2411 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2412 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2413 | run_test_psa_force_curve "secp192r1" |
| 2414 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2415 | run_test_psa_force_curve "secp192k1" |
| 2416 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2417 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2419 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2420 | run_test "ServerHello contains gmt_unix_time" \ |
| 2421 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2422 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2423 | 0 \ |
| 2424 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2425 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2426 | |
| 2427 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2429 | run_test "Unique IV in GCM" \ |
| 2430 | "$P_SRV exchanges=20 debug_level=4" \ |
| 2431 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2432 | 0 \ |
| 2433 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2434 | -U "IV used" |
| 2435 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2436 | # Test for correctness of sent single supported algorithm |
| 2437 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2439 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2440 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2441 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2442 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2443 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2444 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2445 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2446 | "$P_CLI sig_algs=ecdsa_secp256r1_sha256 debug_level=3" \ |
| 2447 | 0 \ |
| 2448 | -c "Supported Signature Algorithm found: 04 03" |
| 2449 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2451 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2452 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2453 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2454 | requires_hash_alg SHA_256 |
| 2455 | run_test "Single supported algorithm sending: openssl client" \ |
| 2456 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2457 | "$O_CLI -cert data_files/server6.crt \ |
| 2458 | -key data_files/server6.key" \ |
| 2459 | 0 |
| 2460 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2461 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2463 | run_test "Configuration-specific CRT verification callback" \ |
| 2464 | "$P_SRV debug_level=3" \ |
| 2465 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 2466 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2467 | -S "error" \ |
| 2468 | -c "Verify requested for " \ |
| 2469 | -c "Use configuration-specific verification callback" \ |
| 2470 | -C "Use context-specific verification callback" \ |
| 2471 | -C "error" |
| 2472 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2474 | run_test "Context-specific CRT verification callback" \ |
| 2475 | "$P_SRV debug_level=3" \ |
| 2476 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 2477 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2478 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2479 | -c "Verify requested for " \ |
| 2480 | -c "Use context-specific verification callback" \ |
| 2481 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2482 | -C "error" |
| 2483 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2484 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2486 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2487 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2488 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2489 | 1 \ |
| 2490 | -c "The certificate is signed with an unacceptable hash" |
| 2491 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2493 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2494 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2495 | "$P_CLI allow_sha1=1" \ |
| 2496 | 0 |
| 2497 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2499 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2500 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2501 | "$P_CLI allow_sha1=0" \ |
| 2502 | 0 |
| 2503 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2505 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2506 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2507 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2508 | 1 \ |
| 2509 | -s "The certificate is signed with an unacceptable hash" |
| 2510 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2512 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 2513 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2514 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2515 | 0 |
| 2516 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2518 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2519 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2520 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2521 | 0 |
| 2522 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2523 | # Dummy TLS 1.3 test |
| 2524 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2525 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2529 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2530 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2531 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2532 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2533 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2534 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2537 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2538 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2539 | 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] | 2540 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2541 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2542 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2543 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2546 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2547 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2548 | 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] | 2549 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2550 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2551 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2552 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2555 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2556 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2557 | run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2558 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2559 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 2560 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2561 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2564 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2565 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2566 | run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2567 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2568 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2569 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2570 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2573 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2574 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2575 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2576 | "$P_SRV tls13_kex_modes=all" \ |
| 2577 | "$P_CLI tls13_kex_modes=all" \ |
| 2578 | 0 |
| 2579 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2580 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2582 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2583 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2584 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2585 | 0 \ |
| 2586 | -c "next record in same datagram" \ |
| 2587 | -s "next record in same datagram" |
| 2588 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2590 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2591 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2592 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2593 | 0 \ |
| 2594 | -s "next record in same datagram" \ |
| 2595 | -C "next record in same datagram" |
| 2596 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2598 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2599 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2600 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2601 | 0 \ |
| 2602 | -S "next record in same datagram" \ |
| 2603 | -c "next record in same datagram" |
| 2604 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2606 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2607 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2608 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2609 | 0 \ |
| 2610 | -S "next record in same datagram" \ |
| 2611 | -C "next record in same datagram" |
| 2612 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2613 | # Tests for Context serialization |
| 2614 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2616 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2617 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2618 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2619 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2620 | 0 \ |
| 2621 | -c "Deserializing connection..." \ |
| 2622 | -S "Deserializing connection..." |
| 2623 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2625 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2626 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2627 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2628 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2629 | 0 \ |
| 2630 | -c "Deserializing connection..." \ |
| 2631 | -S "Deserializing connection..." |
| 2632 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2634 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2635 | run_test "Context serialization, client serializes, GCM" \ |
| 2636 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2637 | "$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] | 2638 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2639 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2640 | -S "Deserializing connection..." |
| 2641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2643 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2644 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2645 | run_test "Context serialization, client serializes, with CID" \ |
| 2646 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2647 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2648 | 0 \ |
| 2649 | -c "Deserializing connection..." \ |
| 2650 | -S "Deserializing connection..." |
| 2651 | |
| 2652 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2653 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2654 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2655 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2656 | 0 \ |
| 2657 | -C "Deserializing connection..." \ |
| 2658 | -s "Deserializing connection..." |
| 2659 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2661 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2662 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2663 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2664 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2665 | 0 \ |
| 2666 | -C "Deserializing connection..." \ |
| 2667 | -s "Deserializing connection..." |
| 2668 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2670 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2671 | run_test "Context serialization, server serializes, GCM" \ |
| 2672 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2673 | "$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] | 2674 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2675 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2676 | -s "Deserializing connection..." |
| 2677 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2679 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2680 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2681 | run_test "Context serialization, server serializes, with CID" \ |
| 2682 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2683 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2684 | 0 \ |
| 2685 | -C "Deserializing connection..." \ |
| 2686 | -s "Deserializing connection..." |
| 2687 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2689 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2690 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2691 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2692 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2693 | 0 \ |
| 2694 | -c "Deserializing connection..." \ |
| 2695 | -s "Deserializing connection..." |
| 2696 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2698 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2699 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2700 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2701 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2702 | 0 \ |
| 2703 | -c "Deserializing connection..." \ |
| 2704 | -s "Deserializing connection..." |
| 2705 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2707 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2708 | run_test "Context serialization, both serialize, GCM" \ |
| 2709 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2710 | "$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] | 2711 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2712 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2713 | -s "Deserializing connection..." |
| 2714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2716 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2717 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2718 | run_test "Context serialization, both serialize, with CID" \ |
| 2719 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2720 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2721 | 0 \ |
| 2722 | -c "Deserializing connection..." \ |
| 2723 | -s "Deserializing connection..." |
| 2724 | |
| 2725 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2726 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2727 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2728 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2729 | 0 \ |
| 2730 | -c "Deserializing connection..." \ |
| 2731 | -S "Deserializing connection..." |
| 2732 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2734 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2735 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2736 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2737 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2738 | 0 \ |
| 2739 | -c "Deserializing connection..." \ |
| 2740 | -S "Deserializing connection..." |
| 2741 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2743 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2744 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2745 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2746 | "$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] | 2747 | 0 \ |
| 2748 | -c "Deserializing connection..." \ |
| 2749 | -S "Deserializing connection..." |
| 2750 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2752 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2753 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2754 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2755 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2756 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2757 | 0 \ |
| 2758 | -c "Deserializing connection..." \ |
| 2759 | -S "Deserializing connection..." |
| 2760 | |
| 2761 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2762 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2763 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2764 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2765 | 0 \ |
| 2766 | -C "Deserializing connection..." \ |
| 2767 | -s "Deserializing connection..." |
| 2768 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2770 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2771 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2772 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2773 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2774 | 0 \ |
| 2775 | -C "Deserializing connection..." \ |
| 2776 | -s "Deserializing connection..." |
| 2777 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2779 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2780 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2781 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2782 | "$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] | 2783 | 0 \ |
| 2784 | -C "Deserializing connection..." \ |
| 2785 | -s "Deserializing connection..." |
| 2786 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2788 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2789 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2790 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2791 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2792 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2793 | 0 \ |
| 2794 | -C "Deserializing connection..." \ |
| 2795 | -s "Deserializing connection..." |
| 2796 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2798 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2799 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2800 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2801 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2802 | 0 \ |
| 2803 | -c "Deserializing connection..." \ |
| 2804 | -s "Deserializing connection..." |
| 2805 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2807 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2808 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2809 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2810 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2811 | 0 \ |
| 2812 | -c "Deserializing connection..." \ |
| 2813 | -s "Deserializing connection..." |
| 2814 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2816 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2817 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2818 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2819 | "$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] | 2820 | 0 \ |
| 2821 | -c "Deserializing connection..." \ |
| 2822 | -s "Deserializing connection..." |
| 2823 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2825 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2826 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2827 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2828 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2829 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2830 | 0 \ |
| 2831 | -c "Deserializing connection..." \ |
| 2832 | -s "Deserializing connection..." |
| 2833 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2835 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2836 | run_test "Saving the serialized context to a file" \ |
| 2837 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2838 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2839 | 0 \ |
| 2840 | -s "Save serialized context to a file... ok" \ |
| 2841 | -c "Save serialized context to a file... ok" |
| 2842 | rm -f context_srv.txt |
| 2843 | rm -f context_cli.txt |
| 2844 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2845 | # Tests for DTLS Connection ID extension |
| 2846 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2847 | # So far, the CID API isn't implemented, so we can't |
| 2848 | # grep for output witnessing its use. This needs to be |
| 2849 | # changed once the CID extension is implemented. |
| 2850 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2852 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2853 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2854 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2855 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2856 | 0 \ |
| 2857 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2858 | -s "found CID extension" \ |
| 2859 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2860 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2861 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2862 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2863 | -C "found CID extension" \ |
| 2864 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2865 | -C "Copy CIDs into SSL transform" \ |
| 2866 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2867 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2869 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2870 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2871 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2872 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2873 | 0 \ |
| 2874 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2875 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2876 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2877 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2878 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2879 | -C "found CID extension" \ |
| 2880 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2881 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2882 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2883 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2885 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2886 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2887 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2888 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2889 | 0 \ |
| 2890 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2891 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2892 | -c "client hello, adding CID extension" \ |
| 2893 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2894 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2895 | -s "server hello, adding CID extension" \ |
| 2896 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2897 | -c "Use of CID extension negotiated" \ |
| 2898 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2899 | -c "Copy CIDs into SSL transform" \ |
| 2900 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2901 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2902 | -s "Use of Connection ID has been negotiated" \ |
| 2903 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2904 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2906 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2907 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2908 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2909 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2910 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2911 | 0 \ |
| 2912 | -c "Enable use of CID extension." \ |
| 2913 | -s "Enable use of CID extension." \ |
| 2914 | -c "client hello, adding CID extension" \ |
| 2915 | -s "found CID extension" \ |
| 2916 | -s "Use of CID extension negotiated" \ |
| 2917 | -s "server hello, adding CID extension" \ |
| 2918 | -c "found CID extension" \ |
| 2919 | -c "Use of CID extension negotiated" \ |
| 2920 | -s "Copy CIDs into SSL transform" \ |
| 2921 | -c "Copy CIDs into SSL transform" \ |
| 2922 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2923 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2924 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2925 | -c "Use of Connection ID has been negotiated" \ |
| 2926 | -c "ignoring unexpected CID" \ |
| 2927 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2928 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2930 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2931 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2932 | -p "$P_PXY mtu=800" \ |
| 2933 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2934 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2935 | 0 \ |
| 2936 | -c "Enable use of CID extension." \ |
| 2937 | -s "Enable use of CID extension." \ |
| 2938 | -c "client hello, adding CID extension" \ |
| 2939 | -s "found CID extension" \ |
| 2940 | -s "Use of CID extension negotiated" \ |
| 2941 | -s "server hello, adding CID extension" \ |
| 2942 | -c "found CID extension" \ |
| 2943 | -c "Use of CID extension negotiated" \ |
| 2944 | -s "Copy CIDs into SSL transform" \ |
| 2945 | -c "Copy CIDs into SSL transform" \ |
| 2946 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2947 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2948 | -s "Use of Connection ID has been negotiated" \ |
| 2949 | -c "Use of Connection ID has been negotiated" |
| 2950 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2952 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2953 | 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] | 2954 | -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] | 2955 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2956 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2957 | 0 \ |
| 2958 | -c "Enable use of CID extension." \ |
| 2959 | -s "Enable use of CID extension." \ |
| 2960 | -c "client hello, adding CID extension" \ |
| 2961 | -s "found CID extension" \ |
| 2962 | -s "Use of CID extension negotiated" \ |
| 2963 | -s "server hello, adding CID extension" \ |
| 2964 | -c "found CID extension" \ |
| 2965 | -c "Use of CID extension negotiated" \ |
| 2966 | -s "Copy CIDs into SSL transform" \ |
| 2967 | -c "Copy CIDs into SSL transform" \ |
| 2968 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2969 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2970 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2971 | -c "Use of Connection ID has been negotiated" \ |
| 2972 | -c "ignoring unexpected CID" \ |
| 2973 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2974 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2977 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2978 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2979 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2980 | 0 \ |
| 2981 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2982 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2983 | -c "client hello, adding CID extension" \ |
| 2984 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2985 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2986 | -s "server hello, adding CID extension" \ |
| 2987 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2988 | -c "Use of CID extension negotiated" \ |
| 2989 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2990 | -c "Copy CIDs into SSL transform" \ |
| 2991 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2992 | -s "Peer CID (length 0 Bytes):" \ |
| 2993 | -s "Use of Connection ID has been negotiated" \ |
| 2994 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2995 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2997 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2998 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2999 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3000 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3001 | 0 \ |
| 3002 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3003 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3004 | -c "client hello, adding CID extension" \ |
| 3005 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3006 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3007 | -s "server hello, adding CID extension" \ |
| 3008 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3009 | -c "Use of CID extension negotiated" \ |
| 3010 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3011 | -c "Copy CIDs into SSL transform" \ |
| 3012 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3013 | -c "Peer CID (length 0 Bytes):" \ |
| 3014 | -s "Use of Connection ID has been negotiated" \ |
| 3015 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3016 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3018 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3019 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3020 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3021 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3022 | 0 \ |
| 3023 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3024 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3025 | -c "client hello, adding CID extension" \ |
| 3026 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3027 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3028 | -s "server hello, adding CID extension" \ |
| 3029 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3030 | -c "Use of CID extension negotiated" \ |
| 3031 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3032 | -c "Copy CIDs into SSL transform" \ |
| 3033 | -S "Use of Connection ID has been negotiated" \ |
| 3034 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3035 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3037 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3038 | 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] | 3039 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3040 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3041 | 0 \ |
| 3042 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3043 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3044 | -c "client hello, adding CID extension" \ |
| 3045 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3046 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3047 | -s "server hello, adding CID extension" \ |
| 3048 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3049 | -c "Use of CID extension negotiated" \ |
| 3050 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3051 | -c "Copy CIDs into SSL transform" \ |
| 3052 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3053 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3054 | -s "Use of Connection ID has been negotiated" \ |
| 3055 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3056 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3058 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3059 | 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] | 3060 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3061 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3062 | 0 \ |
| 3063 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3064 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3065 | -c "client hello, adding CID extension" \ |
| 3066 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3067 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3068 | -s "server hello, adding CID extension" \ |
| 3069 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3070 | -c "Use of CID extension negotiated" \ |
| 3071 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3072 | -c "Copy CIDs into SSL transform" \ |
| 3073 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3074 | -s "Peer CID (length 0 Bytes):" \ |
| 3075 | -s "Use of Connection ID has been negotiated" \ |
| 3076 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3077 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3079 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3080 | 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] | 3081 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3082 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3083 | 0 \ |
| 3084 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3085 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3086 | -c "client hello, adding CID extension" \ |
| 3087 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3088 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3089 | -s "server hello, adding CID extension" \ |
| 3090 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3091 | -c "Use of CID extension negotiated" \ |
| 3092 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3093 | -c "Copy CIDs into SSL transform" \ |
| 3094 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3095 | -c "Peer CID (length 0 Bytes):" \ |
| 3096 | -s "Use of Connection ID has been negotiated" \ |
| 3097 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3098 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3100 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3101 | 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] | 3102 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3103 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3104 | 0 \ |
| 3105 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3106 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3107 | -c "client hello, adding CID extension" \ |
| 3108 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3109 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3110 | -s "server hello, adding CID extension" \ |
| 3111 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3112 | -c "Use of CID extension negotiated" \ |
| 3113 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3114 | -c "Copy CIDs into SSL transform" \ |
| 3115 | -S "Use of Connection ID has been negotiated" \ |
| 3116 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3119 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3120 | 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] | 3121 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3122 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3123 | 0 \ |
| 3124 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3125 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3126 | -c "client hello, adding CID extension" \ |
| 3127 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3128 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3129 | -s "server hello, adding CID extension" \ |
| 3130 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3131 | -c "Use of CID extension negotiated" \ |
| 3132 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3133 | -c "Copy CIDs into SSL transform" \ |
| 3134 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3135 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3136 | -s "Use of Connection ID has been negotiated" \ |
| 3137 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3138 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3140 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3141 | 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] | 3142 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3143 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3144 | 0 \ |
| 3145 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3146 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3147 | -c "client hello, adding CID extension" \ |
| 3148 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3149 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3150 | -s "server hello, adding CID extension" \ |
| 3151 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3152 | -c "Use of CID extension negotiated" \ |
| 3153 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3154 | -c "Copy CIDs into SSL transform" \ |
| 3155 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3156 | -s "Peer CID (length 0 Bytes):" \ |
| 3157 | -s "Use of Connection ID has been negotiated" \ |
| 3158 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3159 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3161 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3162 | 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] | 3163 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3164 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3165 | 0 \ |
| 3166 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3167 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3168 | -c "client hello, adding CID extension" \ |
| 3169 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3170 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3171 | -s "server hello, adding CID extension" \ |
| 3172 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3173 | -c "Use of CID extension negotiated" \ |
| 3174 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3175 | -c "Copy CIDs into SSL transform" \ |
| 3176 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3177 | -c "Peer CID (length 0 Bytes):" \ |
| 3178 | -s "Use of Connection ID has been negotiated" \ |
| 3179 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3180 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3182 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3183 | 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] | 3184 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3185 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3186 | 0 \ |
| 3187 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3188 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3189 | -c "client hello, adding CID extension" \ |
| 3190 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3191 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3192 | -s "server hello, adding CID extension" \ |
| 3193 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3194 | -c "Use of CID extension negotiated" \ |
| 3195 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3196 | -c "Copy CIDs into SSL transform" \ |
| 3197 | -S "Use of Connection ID has been negotiated" \ |
| 3198 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 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 | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3203 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3204 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3205 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3206 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 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): de ad" \ |
| 3212 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 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 | b42ec0d | 2019-05-03 17:30:59 +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: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3220 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3221 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3222 | 0 \ |
| 3223 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3224 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3225 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3226 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3227 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3228 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3229 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3230 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3231 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3233 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3234 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3235 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3236 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3237 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3238 | 0 \ |
| 3239 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3240 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3241 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3242 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3243 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3244 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3245 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3246 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3249 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3250 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3251 | 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] | 3252 | -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] | 3253 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3254 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3255 | 0 \ |
| 3256 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3257 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3258 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3259 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3260 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3261 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3262 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3263 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3264 | -c "ignoring unexpected CID" \ |
| 3265 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 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 | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3269 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3270 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3271 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3272 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3273 | 0 \ |
| 3274 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3275 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3276 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3277 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3278 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3279 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3280 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3281 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3282 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3284 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3285 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3286 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3287 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3288 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3289 | 0 \ |
| 3290 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3291 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3292 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3293 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3294 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3295 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3296 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3297 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3298 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3300 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3301 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3302 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3303 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3304 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3305 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3306 | 0 \ |
| 3307 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3308 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3309 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3310 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3311 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3312 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3313 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3314 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3315 | -c "ignoring unexpected CID" \ |
| 3316 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3317 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3319 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3320 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3321 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3322 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3323 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3324 | 0 \ |
| 3325 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3326 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3327 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3328 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3329 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3330 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3331 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3333 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3334 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3335 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3336 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3337 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3338 | 0 \ |
| 3339 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3340 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3341 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3342 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3343 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3344 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3345 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3347 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3348 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3349 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3350 | -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] | 3351 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3352 | "$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" \ |
| 3353 | 0 \ |
| 3354 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3355 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3356 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3357 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3358 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3359 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3360 | -c "ignoring unexpected CID" \ |
| 3361 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3362 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3364 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3365 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3366 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3367 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3368 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3369 | 0 \ |
| 3370 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3371 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3372 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3373 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3374 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3375 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3376 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3377 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3378 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3381 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3382 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3383 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3384 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3385 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3386 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3387 | 0 \ |
| 3388 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3389 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3390 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3391 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3392 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3393 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3394 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3395 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3396 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3397 | -c "ignoring unexpected CID" \ |
| 3398 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3399 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3403 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3404 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3405 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3406 | 0 \ |
| 3407 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3408 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3409 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3410 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3411 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3412 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3413 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3414 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3415 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3416 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3418 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3420 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3421 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3422 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3423 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3424 | 0 \ |
| 3425 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3426 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3427 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3428 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3429 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3430 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3431 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3432 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3433 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3434 | -c "ignoring unexpected CID" \ |
| 3435 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3436 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3437 | # 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] | 3438 | # tests check that the buffer contents are reallocated when the message is |
| 3439 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3441 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3442 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3443 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3444 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3445 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3446 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3447 | 0 \ |
| 3448 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3449 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3450 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3451 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3452 | -s "Reallocating in_buf" \ |
| 3453 | -s "Reallocating out_buf" |
| 3454 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3456 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3457 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3458 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3459 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3460 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3461 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3462 | 0 \ |
| 3463 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3464 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3465 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3466 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3467 | -s "Reallocating in_buf" \ |
| 3468 | -s "Reallocating out_buf" |
| 3469 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3470 | # Tests for Encrypt-then-MAC extension |
| 3471 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3473 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3474 | "$P_SRV debug_level=3 \ |
| 3475 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3476 | "$P_CLI debug_level=3" \ |
| 3477 | 0 \ |
| 3478 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3479 | -s "found encrypt then mac extension" \ |
| 3480 | -s "server hello, adding encrypt then mac extension" \ |
| 3481 | -c "found encrypt_then_mac extension" \ |
| 3482 | -c "using encrypt then mac" \ |
| 3483 | -s "using encrypt then mac" |
| 3484 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3486 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3487 | "$P_SRV debug_level=3 etm=0 \ |
| 3488 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3489 | "$P_CLI debug_level=3 etm=1" \ |
| 3490 | 0 \ |
| 3491 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3492 | -s "found encrypt then mac extension" \ |
| 3493 | -S "server hello, adding encrypt then mac extension" \ |
| 3494 | -C "found encrypt_then_mac extension" \ |
| 3495 | -C "using encrypt then mac" \ |
| 3496 | -S "using encrypt then mac" |
| 3497 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3499 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3500 | "$P_SRV debug_level=3 etm=1 \ |
| 3501 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3502 | "$P_CLI debug_level=3 etm=1" \ |
| 3503 | 0 \ |
| 3504 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3505 | -s "found encrypt then mac extension" \ |
| 3506 | -S "server hello, adding encrypt then mac extension" \ |
| 3507 | -C "found encrypt_then_mac extension" \ |
| 3508 | -C "using encrypt then mac" \ |
| 3509 | -S "using encrypt then mac" |
| 3510 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3512 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3513 | "$P_SRV debug_level=3 etm=1 \ |
| 3514 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3515 | "$P_CLI debug_level=3 etm=0" \ |
| 3516 | 0 \ |
| 3517 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3518 | -S "found encrypt then mac extension" \ |
| 3519 | -S "server hello, adding encrypt then mac extension" \ |
| 3520 | -C "found encrypt_then_mac extension" \ |
| 3521 | -C "using encrypt then mac" \ |
| 3522 | -S "using encrypt then mac" |
| 3523 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3524 | # Tests for Extended Master Secret extension |
| 3525 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3527 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3528 | run_test "Extended Master Secret: default" \ |
| 3529 | "$P_SRV debug_level=3" \ |
| 3530 | "$P_CLI debug_level=3" \ |
| 3531 | 0 \ |
| 3532 | -c "client hello, adding extended_master_secret extension" \ |
| 3533 | -s "found extended master secret extension" \ |
| 3534 | -s "server hello, adding extended master secret extension" \ |
| 3535 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3536 | -c "session hash for extended master secret" \ |
| 3537 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3538 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3540 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3541 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3542 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3543 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3544 | 0 \ |
| 3545 | -c "client hello, adding extended_master_secret extension" \ |
| 3546 | -s "found extended master secret extension" \ |
| 3547 | -S "server hello, adding extended master secret extension" \ |
| 3548 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3549 | -C "session hash for extended master secret" \ |
| 3550 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3553 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3554 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3555 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3556 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3557 | 0 \ |
| 3558 | -C "client hello, adding extended_master_secret extension" \ |
| 3559 | -S "found extended master secret extension" \ |
| 3560 | -S "server hello, adding extended master secret extension" \ |
| 3561 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3562 | -C "session hash for extended master secret" \ |
| 3563 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3564 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3565 | # Test sending and receiving empty application data records |
| 3566 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3568 | run_test "Encrypt then MAC: empty application data record" \ |
| 3569 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3570 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3571 | 0 \ |
| 3572 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3573 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3574 | -c "0 bytes written in 1 fragments" |
| 3575 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3577 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3578 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3579 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3580 | 0 \ |
| 3581 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3582 | -c "0 bytes written in 1 fragments" |
| 3583 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3585 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3586 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3587 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3588 | 0 \ |
| 3589 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3590 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3591 | -c "0 bytes written in 1 fragments" |
| 3592 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3594 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3595 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3596 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3597 | 0 \ |
| 3598 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3599 | -c "0 bytes written in 1 fragments" |
| 3600 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3601 | # Tests for CBC 1/n-1 record splitting |
| 3602 | |
| 3603 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3604 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3605 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3606 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3607 | 0 \ |
| 3608 | -s "Read from client: 123 bytes read" \ |
| 3609 | -S "Read from client: 1 bytes read" \ |
| 3610 | -S "122 bytes read" |
| 3611 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3612 | # Tests for Session Tickets |
| 3613 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3615 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3616 | "$P_SRV debug_level=3 tickets=1" \ |
| 3617 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3618 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3619 | -c "client hello, adding session ticket extension" \ |
| 3620 | -s "found session ticket extension" \ |
| 3621 | -s "server hello, adding session ticket extension" \ |
| 3622 | -c "found session_ticket extension" \ |
| 3623 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3624 | -S "session successfully restored from cache" \ |
| 3625 | -s "session successfully restored from ticket" \ |
| 3626 | -s "a session has been resumed" \ |
| 3627 | -c "a session has been resumed" |
| 3628 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3630 | run_test "Session resume using tickets: manual rotation" \ |
| 3631 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3632 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3633 | 0 \ |
| 3634 | -c "client hello, adding session ticket extension" \ |
| 3635 | -s "found session ticket extension" \ |
| 3636 | -s "server hello, adding session ticket extension" \ |
| 3637 | -c "found session_ticket extension" \ |
| 3638 | -c "parse new session ticket" \ |
| 3639 | -S "session successfully restored from cache" \ |
| 3640 | -s "session successfully restored from ticket" \ |
| 3641 | -s "a session has been resumed" \ |
| 3642 | -c "a session has been resumed" |
| 3643 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3645 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3646 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3647 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3648 | 0 \ |
| 3649 | -c "client hello, adding session ticket extension" \ |
| 3650 | -s "found session ticket extension" \ |
| 3651 | -s "server hello, adding session ticket extension" \ |
| 3652 | -c "found session_ticket extension" \ |
| 3653 | -c "parse new session ticket" \ |
| 3654 | -S "session successfully restored from cache" \ |
| 3655 | -s "session successfully restored from ticket" \ |
| 3656 | -s "a session has been resumed" \ |
| 3657 | -c "a session has been resumed" |
| 3658 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3660 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3661 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 3662 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3663 | 0 \ |
| 3664 | -c "client hello, adding session ticket extension" \ |
| 3665 | -s "found session ticket extension" \ |
| 3666 | -s "server hello, adding session ticket extension" \ |
| 3667 | -c "found session_ticket extension" \ |
| 3668 | -c "parse new session ticket" \ |
| 3669 | -S "session successfully restored from cache" \ |
| 3670 | -S "session successfully restored from ticket" \ |
| 3671 | -S "a session has been resumed" \ |
| 3672 | -C "a session has been resumed" |
| 3673 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3675 | run_test "Session resume using tickets: session copy" \ |
| 3676 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3677 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3678 | 0 \ |
| 3679 | -c "client hello, adding session ticket extension" \ |
| 3680 | -s "found session ticket extension" \ |
| 3681 | -s "server hello, adding session ticket extension" \ |
| 3682 | -c "found session_ticket extension" \ |
| 3683 | -c "parse new session ticket" \ |
| 3684 | -S "session successfully restored from cache" \ |
| 3685 | -s "session successfully restored from ticket" \ |
| 3686 | -s "a session has been resumed" \ |
| 3687 | -c "a session has been resumed" |
| 3688 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3690 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3691 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3692 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3693 | 0 \ |
| 3694 | -c "client hello, adding session ticket extension" \ |
| 3695 | -c "found session_ticket extension" \ |
| 3696 | -c "parse new session ticket" \ |
| 3697 | -c "a session has been resumed" |
| 3698 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3700 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3701 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3702 | "( $O_CLI -sess_out $SESSION; \ |
| 3703 | $O_CLI -sess_in $SESSION; \ |
| 3704 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3705 | 0 \ |
| 3706 | -s "found session ticket extension" \ |
| 3707 | -s "server hello, adding session ticket extension" \ |
| 3708 | -S "session successfully restored from cache" \ |
| 3709 | -s "session successfully restored from ticket" \ |
| 3710 | -s "a session has been resumed" |
| 3711 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3713 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3714 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3715 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3716 | 0 \ |
| 3717 | -c "client hello, adding session ticket extension" \ |
| 3718 | -s "found session ticket extension" \ |
| 3719 | -s "server hello, adding session ticket extension" \ |
| 3720 | -c "found session_ticket extension" \ |
| 3721 | -c "parse new session ticket" \ |
| 3722 | -S "session successfully restored from cache" \ |
| 3723 | -s "session successfully restored from ticket" \ |
| 3724 | -s "a session has been resumed" \ |
| 3725 | -c "a session has been resumed" |
| 3726 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3728 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3729 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3730 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3731 | 0 \ |
| 3732 | -c "client hello, adding session ticket extension" \ |
| 3733 | -s "found session ticket extension" \ |
| 3734 | -s "server hello, adding session ticket extension" \ |
| 3735 | -c "found session_ticket extension" \ |
| 3736 | -c "parse new session ticket" \ |
| 3737 | -S "session successfully restored from cache" \ |
| 3738 | -s "session successfully restored from ticket" \ |
| 3739 | -s "a session has been resumed" \ |
| 3740 | -c "a session has been resumed" |
| 3741 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3743 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3744 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3745 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3746 | 0 \ |
| 3747 | -c "client hello, adding session ticket extension" \ |
| 3748 | -s "found session ticket extension" \ |
| 3749 | -s "server hello, adding session ticket extension" \ |
| 3750 | -c "found session_ticket extension" \ |
| 3751 | -c "parse new session ticket" \ |
| 3752 | -S "session successfully restored from cache" \ |
| 3753 | -s "session successfully restored from ticket" \ |
| 3754 | -s "a session has been resumed" \ |
| 3755 | -c "a session has been resumed" |
| 3756 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3758 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3759 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3760 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3761 | 0 \ |
| 3762 | -c "client hello, adding session ticket extension" \ |
| 3763 | -s "found session ticket extension" \ |
| 3764 | -s "server hello, adding session ticket extension" \ |
| 3765 | -c "found session_ticket extension" \ |
| 3766 | -c "parse new session ticket" \ |
| 3767 | -S "session successfully restored from cache" \ |
| 3768 | -s "session successfully restored from ticket" \ |
| 3769 | -s "a session has been resumed" \ |
| 3770 | -c "a session has been resumed" |
| 3771 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3773 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3774 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3775 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3776 | 0 \ |
| 3777 | -c "client hello, adding session ticket extension" \ |
| 3778 | -s "found session ticket extension" \ |
| 3779 | -s "server hello, adding session ticket extension" \ |
| 3780 | -c "found session_ticket extension" \ |
| 3781 | -c "parse new session ticket" \ |
| 3782 | -S "session successfully restored from cache" \ |
| 3783 | -s "session successfully restored from ticket" \ |
| 3784 | -s "a session has been resumed" \ |
| 3785 | -c "a session has been resumed" |
| 3786 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3788 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3789 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3790 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3791 | 0 \ |
| 3792 | -c "client hello, adding session ticket extension" \ |
| 3793 | -s "found session ticket extension" \ |
| 3794 | -s "server hello, adding session ticket extension" \ |
| 3795 | -c "found session_ticket extension" \ |
| 3796 | -c "parse new session ticket" \ |
| 3797 | -S "session successfully restored from cache" \ |
| 3798 | -s "session successfully restored from ticket" \ |
| 3799 | -s "a session has been resumed" \ |
| 3800 | -c "a session has been resumed" |
| 3801 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3803 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3804 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3805 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3806 | 0 \ |
| 3807 | -c "client hello, adding session ticket extension" \ |
| 3808 | -s "found session ticket extension" \ |
| 3809 | -s "server hello, adding session ticket extension" \ |
| 3810 | -c "found session_ticket extension" \ |
| 3811 | -c "parse new session ticket" \ |
| 3812 | -S "session successfully restored from cache" \ |
| 3813 | -s "session successfully restored from ticket" \ |
| 3814 | -s "a session has been resumed" \ |
| 3815 | -c "a session has been resumed" |
| 3816 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3818 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3819 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3820 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3821 | 0 \ |
| 3822 | -c "client hello, adding session ticket extension" \ |
| 3823 | -s "found session ticket extension" \ |
| 3824 | -s "server hello, adding session ticket extension" \ |
| 3825 | -c "found session_ticket extension" \ |
| 3826 | -c "parse new session ticket" \ |
| 3827 | -S "session successfully restored from cache" \ |
| 3828 | -s "session successfully restored from ticket" \ |
| 3829 | -s "a session has been resumed" \ |
| 3830 | -c "a session has been resumed" |
| 3831 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3833 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3834 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3835 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3836 | 0 \ |
| 3837 | -c "client hello, adding session ticket extension" \ |
| 3838 | -s "found session ticket extension" \ |
| 3839 | -s "server hello, adding session ticket extension" \ |
| 3840 | -c "found session_ticket extension" \ |
| 3841 | -c "parse new session ticket" \ |
| 3842 | -S "session successfully restored from cache" \ |
| 3843 | -s "session successfully restored from ticket" \ |
| 3844 | -s "a session has been resumed" \ |
| 3845 | -c "a session has been resumed" |
| 3846 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3848 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3849 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3850 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3851 | 0 \ |
| 3852 | -c "client hello, adding session ticket extension" \ |
| 3853 | -s "found session ticket extension" \ |
| 3854 | -s "server hello, adding session ticket extension" \ |
| 3855 | -c "found session_ticket extension" \ |
| 3856 | -c "parse new session ticket" \ |
| 3857 | -S "session successfully restored from cache" \ |
| 3858 | -s "session successfully restored from ticket" \ |
| 3859 | -s "a session has been resumed" \ |
| 3860 | -c "a session has been resumed" |
| 3861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3863 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3864 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3865 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3866 | 0 \ |
| 3867 | -c "client hello, adding session ticket extension" \ |
| 3868 | -s "found session ticket extension" \ |
| 3869 | -s "server hello, adding session ticket extension" \ |
| 3870 | -c "found session_ticket extension" \ |
| 3871 | -c "parse new session ticket" \ |
| 3872 | -S "session successfully restored from cache" \ |
| 3873 | -s "session successfully restored from ticket" \ |
| 3874 | -s "a session has been resumed" \ |
| 3875 | -c "a session has been resumed" |
| 3876 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3878 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3879 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3880 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3881 | 0 \ |
| 3882 | -c "client hello, adding session ticket extension" \ |
| 3883 | -s "found session ticket extension" \ |
| 3884 | -s "server hello, adding session ticket extension" \ |
| 3885 | -c "found session_ticket extension" \ |
| 3886 | -c "parse new session ticket" \ |
| 3887 | -S "session successfully restored from cache" \ |
| 3888 | -s "session successfully restored from ticket" \ |
| 3889 | -s "a session has been resumed" \ |
| 3890 | -c "a session has been resumed" |
| 3891 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3893 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3894 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3895 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3896 | 0 \ |
| 3897 | -c "client hello, adding session ticket extension" \ |
| 3898 | -s "found session ticket extension" \ |
| 3899 | -s "server hello, adding session ticket extension" \ |
| 3900 | -c "found session_ticket extension" \ |
| 3901 | -c "parse new session ticket" \ |
| 3902 | -S "session successfully restored from cache" \ |
| 3903 | -s "session successfully restored from ticket" \ |
| 3904 | -s "a session has been resumed" \ |
| 3905 | -c "a session has been resumed" |
| 3906 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3908 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3909 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3910 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 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 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3923 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3924 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3925 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 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 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3937 | # Tests for Session Tickets with DTLS |
| 3938 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3940 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3941 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3942 | "$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] | 3943 | 0 \ |
| 3944 | -c "client hello, adding session ticket extension" \ |
| 3945 | -s "found session ticket extension" \ |
| 3946 | -s "server hello, adding session ticket extension" \ |
| 3947 | -c "found session_ticket extension" \ |
| 3948 | -c "parse new session ticket" \ |
| 3949 | -S "session successfully restored from cache" \ |
| 3950 | -s "session successfully restored from ticket" \ |
| 3951 | -s "a session has been resumed" \ |
| 3952 | -c "a session has been resumed" |
| 3953 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3955 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3956 | "$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] | 3957 | "$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] | 3958 | 0 \ |
| 3959 | -c "client hello, adding session ticket extension" \ |
| 3960 | -s "found session ticket extension" \ |
| 3961 | -s "server hello, adding session ticket extension" \ |
| 3962 | -c "found session_ticket extension" \ |
| 3963 | -c "parse new session ticket" \ |
| 3964 | -S "session successfully restored from cache" \ |
| 3965 | -s "session successfully restored from ticket" \ |
| 3966 | -s "a session has been resumed" \ |
| 3967 | -c "a session has been resumed" |
| 3968 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3970 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3971 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 3972 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3973 | 0 \ |
| 3974 | -c "client hello, adding session ticket extension" \ |
| 3975 | -s "found session ticket extension" \ |
| 3976 | -s "server hello, adding session ticket extension" \ |
| 3977 | -c "found session_ticket extension" \ |
| 3978 | -c "parse new session ticket" \ |
| 3979 | -S "session successfully restored from cache" \ |
| 3980 | -S "session successfully restored from ticket" \ |
| 3981 | -S "a session has been resumed" \ |
| 3982 | -C "a session has been resumed" |
| 3983 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3985 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3986 | "$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] | 3987 | "$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] | 3988 | 0 \ |
| 3989 | -c "client hello, adding session ticket extension" \ |
| 3990 | -s "found session ticket extension" \ |
| 3991 | -s "server hello, adding session ticket extension" \ |
| 3992 | -c "found session_ticket extension" \ |
| 3993 | -c "parse new session ticket" \ |
| 3994 | -S "session successfully restored from cache" \ |
| 3995 | -s "session successfully restored from ticket" \ |
| 3996 | -s "a session has been resumed" \ |
| 3997 | -c "a session has been resumed" |
| 3998 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4000 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4001 | "$O_SRV -dtls" \ |
| 4002 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4003 | 0 \ |
| 4004 | -c "client hello, adding session ticket extension" \ |
| 4005 | -c "found session_ticket extension" \ |
| 4006 | -c "parse new session ticket" \ |
| 4007 | -c "a session has been resumed" |
| 4008 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4009 | # 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] | 4010 | # 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] | 4011 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4013 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4014 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4015 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4016 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4017 | rm -f $SESSION )" \ |
| 4018 | 0 \ |
| 4019 | -s "found session ticket extension" \ |
| 4020 | -s "server hello, adding session ticket extension" \ |
| 4021 | -S "session successfully restored from cache" \ |
| 4022 | -s "session successfully restored from ticket" \ |
| 4023 | -s "a session has been resumed" |
| 4024 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4025 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +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: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4030 | "$P_SRV debug_level=3 tickets=0" \ |
| 4031 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4032 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4033 | -c "client hello, adding session ticket extension" \ |
| 4034 | -s "found session ticket extension" \ |
| 4035 | -S "server hello, adding session ticket extension" \ |
| 4036 | -C "found session_ticket extension" \ |
| 4037 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4038 | -s "session successfully restored from cache" \ |
| 4039 | -S "session successfully restored from ticket" \ |
| 4040 | -s "a session has been resumed" \ |
| 4041 | -c "a session has been resumed" |
| 4042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4044 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4045 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4046 | "$P_SRV debug_level=3 tickets=1" \ |
| 4047 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4048 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4049 | -C "client hello, adding session ticket extension" \ |
| 4050 | -S "found session ticket extension" \ |
| 4051 | -S "server hello, adding session ticket extension" \ |
| 4052 | -C "found session_ticket extension" \ |
| 4053 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4054 | -s "session successfully restored from cache" \ |
| 4055 | -S "session successfully restored from ticket" \ |
| 4056 | -s "a session has been resumed" \ |
| 4057 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4058 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4060 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4061 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4062 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 4063 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4064 | 0 \ |
| 4065 | -S "session successfully restored from cache" \ |
| 4066 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4067 | -S "a session has been resumed" \ |
| 4068 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4069 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4071 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4072 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4073 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 4074 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4075 | 0 \ |
| 4076 | -s "session successfully restored from cache" \ |
| 4077 | -S "session successfully restored from ticket" \ |
| 4078 | -s "a session has been resumed" \ |
| 4079 | -c "a session has been resumed" |
| 4080 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4082 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4083 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4084 | "$P_SRV debug_level=3 tickets=0" \ |
| 4085 | "$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] | 4086 | 0 \ |
| 4087 | -s "session successfully restored from cache" \ |
| 4088 | -S "session successfully restored from ticket" \ |
| 4089 | -s "a session has been resumed" \ |
| 4090 | -c "a session has been resumed" |
| 4091 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4093 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4094 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4095 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4096 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4097 | 0 \ |
| 4098 | -S "session successfully restored from cache" \ |
| 4099 | -S "session successfully restored from ticket" \ |
| 4100 | -S "a session has been resumed" \ |
| 4101 | -C "a session has been resumed" |
| 4102 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4104 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4105 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4106 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4107 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4108 | 0 \ |
| 4109 | -s "session successfully restored from cache" \ |
| 4110 | -S "session successfully restored from ticket" \ |
| 4111 | -s "a session has been resumed" \ |
| 4112 | -c "a session has been resumed" |
| 4113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4115 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4116 | run_test "Session resume using cache: session copy" \ |
| 4117 | "$P_SRV debug_level=3 tickets=0" \ |
| 4118 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 4119 | 0 \ |
| 4120 | -s "session successfully restored from cache" \ |
| 4121 | -S "session successfully restored from ticket" \ |
| 4122 | -s "a session has been resumed" \ |
| 4123 | -c "a session has been resumed" |
| 4124 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4126 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4127 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4128 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4129 | "( $O_CLI -sess_out $SESSION; \ |
| 4130 | $O_CLI -sess_in $SESSION; \ |
| 4131 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4132 | 0 \ |
| 4133 | -s "found session ticket extension" \ |
| 4134 | -S "server hello, adding session ticket extension" \ |
| 4135 | -s "session successfully restored from cache" \ |
| 4136 | -S "session successfully restored from ticket" \ |
| 4137 | -s "a session has been resumed" |
| 4138 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4140 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4141 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4142 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4143 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4144 | 0 \ |
| 4145 | -C "found session_ticket extension" \ |
| 4146 | -C "parse new session ticket" \ |
| 4147 | -c "a session has been resumed" |
| 4148 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4149 | # Tests for Session resume and extensions |
| 4150 | |
| 4151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4152 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4153 | run_test "Session resume and connection ID" \ |
| 4154 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4155 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4156 | 0 \ |
| 4157 | -c "Enable use of CID extension." \ |
| 4158 | -s "Enable use of CID extension." \ |
| 4159 | -c "client hello, adding CID extension" \ |
| 4160 | -s "found CID extension" \ |
| 4161 | -s "Use of CID extension negotiated" \ |
| 4162 | -s "server hello, adding CID extension" \ |
| 4163 | -c "found CID extension" \ |
| 4164 | -c "Use of CID extension negotiated" \ |
| 4165 | -s "Copy CIDs into SSL transform" \ |
| 4166 | -c "Copy CIDs into SSL transform" \ |
| 4167 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4168 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4169 | -s "Use of Connection ID has been negotiated" \ |
| 4170 | -c "Use of Connection ID has been negotiated" |
| 4171 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4172 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 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: tickets enabled on client" \ |
| 4177 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4178 | "$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] | 4179 | 0 \ |
| 4180 | -c "client hello, adding session ticket extension" \ |
| 4181 | -s "found session ticket extension" \ |
| 4182 | -S "server hello, adding session ticket extension" \ |
| 4183 | -C "found session_ticket extension" \ |
| 4184 | -C "parse new session ticket" \ |
| 4185 | -s "session successfully restored from cache" \ |
| 4186 | -S "session successfully restored from ticket" \ |
| 4187 | -s "a session has been resumed" \ |
| 4188 | -c "a session has been resumed" |
| 4189 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4191 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4192 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4193 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4194 | "$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] | 4195 | 0 \ |
| 4196 | -C "client hello, adding session ticket extension" \ |
| 4197 | -S "found session ticket extension" \ |
| 4198 | -S "server hello, adding session ticket extension" \ |
| 4199 | -C "found session_ticket extension" \ |
| 4200 | -C "parse new session ticket" \ |
| 4201 | -s "session successfully restored from cache" \ |
| 4202 | -S "session successfully restored from ticket" \ |
| 4203 | -s "a session has been resumed" \ |
| 4204 | -c "a session has been resumed" |
| 4205 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4207 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4208 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4209 | "$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] | 4210 | "$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] | 4211 | 0 \ |
| 4212 | -S "session successfully restored from cache" \ |
| 4213 | -S "session successfully restored from ticket" \ |
| 4214 | -S "a session has been resumed" \ |
| 4215 | -C "a session has been resumed" |
| 4216 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4218 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4219 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4220 | "$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] | 4221 | "$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] | 4222 | 0 \ |
| 4223 | -s "session successfully restored from cache" \ |
| 4224 | -S "session successfully restored from ticket" \ |
| 4225 | -s "a session has been resumed" \ |
| 4226 | -c "a session has been resumed" |
| 4227 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4229 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4230 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4231 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4232 | "$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] | 4233 | 0 \ |
| 4234 | -s "session successfully restored from cache" \ |
| 4235 | -S "session successfully restored from ticket" \ |
| 4236 | -s "a session has been resumed" \ |
| 4237 | -c "a session has been resumed" |
| 4238 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4240 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4241 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4242 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4243 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4244 | 0 \ |
| 4245 | -S "session successfully restored from cache" \ |
| 4246 | -S "session successfully restored from ticket" \ |
| 4247 | -S "a session has been resumed" \ |
| 4248 | -C "a session has been resumed" |
| 4249 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4251 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4252 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4253 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4254 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4255 | 0 \ |
| 4256 | -s "session successfully restored from cache" \ |
| 4257 | -S "session successfully restored from ticket" \ |
| 4258 | -s "a session has been resumed" \ |
| 4259 | -c "a session has been resumed" |
| 4260 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4262 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4263 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4264 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4265 | "$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] | 4266 | 0 \ |
| 4267 | -s "session successfully restored from cache" \ |
| 4268 | -S "session successfully restored from ticket" \ |
| 4269 | -s "a session has been resumed" \ |
| 4270 | -c "a session has been resumed" |
| 4271 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4272 | # 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] | 4273 | # 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] | 4274 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4276 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4277 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4278 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4279 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4280 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4281 | rm -f $SESSION )" \ |
| 4282 | 0 \ |
| 4283 | -s "found session ticket extension" \ |
| 4284 | -S "server hello, adding session ticket extension" \ |
| 4285 | -s "session successfully restored from cache" \ |
| 4286 | -S "session successfully restored from ticket" \ |
| 4287 | -s "a session has been resumed" |
| 4288 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4290 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4291 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4292 | "$O_SRV -dtls" \ |
| 4293 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4294 | 0 \ |
| 4295 | -C "found session_ticket extension" \ |
| 4296 | -C "parse new session ticket" \ |
| 4297 | -c "a session has been resumed" |
| 4298 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4299 | # Tests for Max Fragment Length extension |
| 4300 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4301 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4303 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4304 | "$P_SRV debug_level=3" \ |
| 4305 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4306 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4307 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4308 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4309 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4310 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4311 | -C "client hello, adding max_fragment_length extension" \ |
| 4312 | -S "found max fragment length extension" \ |
| 4313 | -S "server hello, max_fragment_length extension" \ |
| 4314 | -C "found max_fragment_length extension" |
| 4315 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4316 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4318 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4319 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4320 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4321 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4322 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4323 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4324 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4325 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4326 | -C "client hello, adding max_fragment_length extension" \ |
| 4327 | -S "found max fragment length extension" \ |
| 4328 | -S "server hello, max_fragment_length extension" \ |
| 4329 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4330 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4331 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4332 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4333 | |
| 4334 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4335 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4336 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4337 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4338 | "$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] | 4339 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4340 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4341 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4342 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4343 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4344 | -C "client hello, adding max_fragment_length extension" \ |
| 4345 | -S "found max fragment length extension" \ |
| 4346 | -S "server hello, max_fragment_length extension" \ |
| 4347 | -C "found max_fragment_length extension" \ |
| 4348 | -c "fragment larger than.*maximum " |
| 4349 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4350 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4351 | # (session fragment length will be 16384 regardless of mbedtls |
| 4352 | # content length configuration.) |
| 4353 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4354 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4356 | run_test "Max fragment length: disabled, larger message" \ |
| 4357 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4358 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4359 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4360 | -C "Maximum incoming record payload length is 16384" \ |
| 4361 | -C "Maximum outgoing record payload length is 16384" \ |
| 4362 | -S "Maximum incoming record payload length is 16384" \ |
| 4363 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4364 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4365 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4366 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4367 | |
| 4368 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4370 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4371 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4372 | "$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] | 4373 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4374 | -C "Maximum incoming record payload length is 16384" \ |
| 4375 | -C "Maximum outgoing record payload length is 16384" \ |
| 4376 | -S "Maximum incoming record payload length is 16384" \ |
| 4377 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4378 | -c "fragment larger than.*maximum " |
| 4379 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4380 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [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 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4383 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4384 | "$P_SRV debug_level=3" \ |
| 4385 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4386 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4387 | -c "Maximum incoming record payload length is 4096" \ |
| 4388 | -c "Maximum outgoing record payload length is 4096" \ |
| 4389 | -s "Maximum incoming record payload length is 4096" \ |
| 4390 | -s "Maximum outgoing record payload length is 4096" \ |
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 1024 |
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 1024" \ |
| 4400 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 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 2048 |
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 512, server 2048" \ |
| 4416 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4417 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4418 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4419 | -c "Maximum incoming record payload length is 512" \ |
| 4420 | -c "Maximum outgoing record payload length is 512" \ |
| 4421 | -s "Maximum incoming record payload length is 512" \ |
| 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 4096 |
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 512, server 4096" \ |
| 4432 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4433 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4434 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4435 | -c "Maximum incoming record payload length is 512" \ |
| 4436 | -c "Maximum outgoing record payload length is 512" \ |
| 4437 | -s "Maximum incoming record payload length is 512" \ |
| 4438 | -s "Maximum outgoing record payload length is 512" \ |
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 1024 |
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 512" \ |
| 4448 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 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 512" \ |
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 1024, server 2048" \ |
| 4464 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4465 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4466 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4467 | -c "Maximum incoming record payload length is 1024" \ |
| 4468 | -c "Maximum outgoing record payload length is 1024" \ |
| 4469 | -s "Maximum incoming record payload length is 1024" \ |
| 4470 | -s "Maximum outgoing record payload length is 1024" \ |
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 4096 |
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 1024, server 4096" \ |
| 4480 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4481 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4482 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4483 | -c "Maximum incoming record payload length is 1024" \ |
| 4484 | -c "Maximum outgoing record payload length is 1024" \ |
| 4485 | -s "Maximum incoming record payload length is 1024" \ |
| 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 2048 |
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 512" \ |
| 4496 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 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 512" \ |
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 2048 |
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 2048, server 1024" \ |
| 4512 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4513 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4514 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4515 | -c "Maximum incoming record payload length is 2048" \ |
| 4516 | -c "Maximum outgoing record payload length is 2048" \ |
| 4517 | -s "Maximum incoming record payload length is 2048" \ |
| 4518 | -s "Maximum outgoing record payload length is 1024" \ |
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 2048, server 4096" \ |
| 4528 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4529 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4530 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4531 | -c "Maximum incoming record payload length is 2048" \ |
| 4532 | -c "Maximum outgoing record payload length is 2048" \ |
| 4533 | -s "Maximum incoming record payload length is 2048" \ |
| 4534 | -s "Maximum outgoing record payload length is 2048" \ |
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 512" \ |
| 4544 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 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 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4559 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4560 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4561 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4562 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4563 | -c "Maximum incoming record payload length is 4096" \ |
| 4564 | -c "Maximum outgoing record payload length is 4096" \ |
| 4565 | -s "Maximum incoming record payload length is 4096" \ |
| 4566 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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" |
| 4571 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4572 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4573 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4575 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4576 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4577 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4578 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4579 | -c "Maximum incoming record payload length is 4096" \ |
| 4580 | -c "Maximum outgoing record payload length is 4096" \ |
| 4581 | -s "Maximum incoming record payload length is 4096" \ |
| 4582 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4583 | -c "client hello, adding max_fragment_length extension" \ |
| 4584 | -s "found max fragment length extension" \ |
| 4585 | -s "server hello, max_fragment_length extension" \ |
| 4586 | -c "found max_fragment_length extension" |
| 4587 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4588 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4589 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4591 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4592 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4593 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4594 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4595 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4596 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4597 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4598 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4599 | -C "client hello, adding max_fragment_length extension" \ |
| 4600 | -S "found max fragment length extension" \ |
| 4601 | -S "server hello, max_fragment_length extension" \ |
| 4602 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4603 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4604 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4605 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4606 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4608 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4609 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4610 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4611 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4612 | -c "Maximum incoming record payload length is 4096" \ |
| 4613 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4614 | -c "client hello, adding max_fragment_length extension" \ |
| 4615 | -c "found max_fragment_length extension" |
| 4616 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4617 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4618 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4620 | run_test "Max fragment length: client, message just fits" \ |
| 4621 | "$P_SRV debug_level=3" \ |
| 4622 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4623 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4624 | -c "Maximum incoming record payload length is 2048" \ |
| 4625 | -c "Maximum outgoing record payload length is 2048" \ |
| 4626 | -s "Maximum incoming record payload length is 2048" \ |
| 4627 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4628 | -c "client hello, adding max_fragment_length extension" \ |
| 4629 | -s "found max fragment length extension" \ |
| 4630 | -s "server hello, max_fragment_length extension" \ |
| 4631 | -c "found max_fragment_length extension" \ |
| 4632 | -c "2048 bytes written in 1 fragments" \ |
| 4633 | -s "2048 bytes read" |
| 4634 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4635 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4636 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4638 | run_test "Max fragment length: client, larger message" \ |
| 4639 | "$P_SRV debug_level=3" \ |
| 4640 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4641 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4642 | -c "Maximum incoming record payload length is 2048" \ |
| 4643 | -c "Maximum outgoing record payload length is 2048" \ |
| 4644 | -s "Maximum incoming record payload length is 2048" \ |
| 4645 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4646 | -c "client hello, adding max_fragment_length extension" \ |
| 4647 | -s "found max fragment length extension" \ |
| 4648 | -s "server hello, max_fragment_length extension" \ |
| 4649 | -c "found max_fragment_length extension" \ |
| 4650 | -c "2345 bytes written in 2 fragments" \ |
| 4651 | -s "2048 bytes read" \ |
| 4652 | -s "297 bytes read" |
| 4653 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4654 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4655 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4657 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4658 | "$P_SRV debug_level=3 dtls=1" \ |
| 4659 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4660 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4661 | -c "Maximum incoming record payload length is 2048" \ |
| 4662 | -c "Maximum outgoing record payload length is 2048" \ |
| 4663 | -s "Maximum incoming record payload length is 2048" \ |
| 4664 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4665 | -c "client hello, adding max_fragment_length extension" \ |
| 4666 | -s "found max fragment length extension" \ |
| 4667 | -s "server hello, max_fragment_length extension" \ |
| 4668 | -c "found max_fragment_length extension" \ |
| 4669 | -c "fragment larger than.*maximum" |
| 4670 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4671 | # Tests for Record Size Limit extension |
| 4672 | |
| 4673 | # gnutls feature tests: check if the record size limit extension is supported with TLS 1.2. |
| 4674 | requires_gnutls_record_size_limit |
| 4675 | run_test "Record Size Limit: Test gnutls record size limit feature" \ |
| 4676 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+CIPHER-ALL --disable-client-cert -d 4" \ |
| 4677 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2 -V -d 4" \ |
| 4678 | 0 \ |
| 4679 | -c "Preparing extension (Record Size Limit/28) for 'client hello'"\ |
| 4680 | -s "Parsing extension 'Record Size Limit/28' (2 bytes)" \ |
| 4681 | -s "Preparing extension (Record Size Limit/28) for 'TLS 1.2 server hello'" \ |
| 4682 | -c "Parsing extension 'Record Size Limit/28' (2 bytes)" \ |
| 4683 | -s "Version: TLS1.2" \ |
| 4684 | -c "Version: TLS1.2" |
| 4685 | |
| 4686 | # gnutls feature tests: check if the record size limit extension is supported with TLS 1.3. |
| 4687 | requires_gnutls_tls1_3 |
| 4688 | requires_gnutls_record_size_limit |
| 4689 | run_test "Record Size Limit: TLS 1.3: Test gnutls record size limit feature" \ |
| 4690 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL --disable-client-cert -d 4" \ |
| 4691 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \ |
| 4692 | 0 \ |
| 4693 | -c "Preparing extension (Record Size Limit/28) for 'client hello'"\ |
| 4694 | -s "Parsing extension 'Record Size Limit/28' (2 bytes)" \ |
| 4695 | -s "Preparing extension (Record Size Limit/28) for 'encrypted extensions'" \ |
| 4696 | -c "Parsing extension 'Record Size Limit/28' (2 bytes)" \ |
| 4697 | -s "Version: TLS1.3" \ |
| 4698 | -c "Version: TLS1.3" |
| 4699 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4700 | # Tests for renegotiation |
| 4701 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4702 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4704 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4705 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4706 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4707 | 0 \ |
| 4708 | -C "client hello, adding renegotiation extension" \ |
| 4709 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4710 | -S "found renegotiation extension" \ |
| 4711 | -s "server hello, secure renegotiation extension" \ |
| 4712 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4713 | -C "=> renegotiate" \ |
| 4714 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4715 | -S "write hello request" |
| 4716 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4717 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4719 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4720 | "$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] | 4721 | "$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] | 4722 | 0 \ |
| 4723 | -c "client hello, adding renegotiation extension" \ |
| 4724 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4725 | -s "found renegotiation extension" \ |
| 4726 | -s "server hello, secure renegotiation extension" \ |
| 4727 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4728 | -c "=> renegotiate" \ |
| 4729 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4730 | -S "write hello request" |
| 4731 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4732 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4734 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4735 | "$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] | 4736 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4737 | 0 \ |
| 4738 | -c "client hello, adding renegotiation extension" \ |
| 4739 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4740 | -s "found renegotiation extension" \ |
| 4741 | -s "server hello, secure renegotiation extension" \ |
| 4742 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4743 | -c "=> renegotiate" \ |
| 4744 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4745 | -s "write hello request" |
| 4746 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4747 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4748 | # 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] | 4749 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4750 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4752 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4753 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4754 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4755 | 0 \ |
| 4756 | -c "client hello, adding renegotiation extension" \ |
| 4757 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4758 | -s "found renegotiation extension" \ |
| 4759 | -s "server hello, secure renegotiation extension" \ |
| 4760 | -c "found renegotiation extension" \ |
| 4761 | -c "=> renegotiate" \ |
| 4762 | -s "=> renegotiate" \ |
| 4763 | -S "write hello request" \ |
| 4764 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4765 | |
| 4766 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4767 | # 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] | 4768 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4771 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4772 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4773 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4774 | 0 \ |
| 4775 | -c "client hello, adding renegotiation extension" \ |
| 4776 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4777 | -s "found renegotiation extension" \ |
| 4778 | -s "server hello, secure renegotiation extension" \ |
| 4779 | -c "found renegotiation extension" \ |
| 4780 | -c "=> renegotiate" \ |
| 4781 | -s "=> renegotiate" \ |
| 4782 | -s "write hello request" \ |
| 4783 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4784 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4785 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4787 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4788 | "$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] | 4789 | "$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] | 4790 | 0 \ |
| 4791 | -c "client hello, adding renegotiation extension" \ |
| 4792 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4793 | -s "found renegotiation extension" \ |
| 4794 | -s "server hello, secure renegotiation extension" \ |
| 4795 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4796 | -c "=> renegotiate" \ |
| 4797 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4798 | -s "write hello request" |
| 4799 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4800 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4801 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4802 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4804 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4805 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4806 | "$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" \ |
| 4807 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4808 | -c "Maximum incoming record payload length is 2048" \ |
| 4809 | -c "Maximum outgoing record payload length is 2048" \ |
| 4810 | -s "Maximum incoming record payload length is 2048" \ |
| 4811 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4812 | -c "client hello, adding max_fragment_length extension" \ |
| 4813 | -s "found max fragment length extension" \ |
| 4814 | -s "server hello, max_fragment_length extension" \ |
| 4815 | -c "found max_fragment_length extension" \ |
| 4816 | -c "client hello, adding renegotiation extension" \ |
| 4817 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4818 | -s "found renegotiation extension" \ |
| 4819 | -s "server hello, secure renegotiation extension" \ |
| 4820 | -c "found renegotiation extension" \ |
| 4821 | -c "=> renegotiate" \ |
| 4822 | -s "=> renegotiate" \ |
| 4823 | -s "write hello request" |
| 4824 | |
| 4825 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4827 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4828 | "$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] | 4829 | "$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] | 4830 | 1 \ |
| 4831 | -c "client hello, adding renegotiation extension" \ |
| 4832 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4833 | -S "found renegotiation extension" \ |
| 4834 | -s "server hello, secure renegotiation extension" \ |
| 4835 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4836 | -c "=> renegotiate" \ |
| 4837 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4838 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4839 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4840 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4841 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4842 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4844 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4845 | "$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] | 4846 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4847 | 0 \ |
| 4848 | -C "client hello, adding renegotiation extension" \ |
| 4849 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4850 | -S "found renegotiation extension" \ |
| 4851 | -s "server hello, secure renegotiation extension" \ |
| 4852 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4853 | -C "=> renegotiate" \ |
| 4854 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4855 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4856 | -S "SSL - An unexpected message was received from our peer" \ |
| 4857 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4858 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4859 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4861 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4862 | "$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] | 4863 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4864 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4865 | 0 \ |
| 4866 | -C "client hello, adding renegotiation extension" \ |
| 4867 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4868 | -S "found renegotiation extension" \ |
| 4869 | -s "server hello, secure renegotiation extension" \ |
| 4870 | -c "found renegotiation extension" \ |
| 4871 | -C "=> renegotiate" \ |
| 4872 | -S "=> renegotiate" \ |
| 4873 | -s "write hello request" \ |
| 4874 | -S "SSL - An unexpected message was received from our peer" \ |
| 4875 | -S "failed" |
| 4876 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4877 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4878 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4880 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4881 | "$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] | 4882 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4883 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4884 | 0 \ |
| 4885 | -C "client hello, adding renegotiation extension" \ |
| 4886 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4887 | -S "found renegotiation extension" \ |
| 4888 | -s "server hello, secure renegotiation extension" \ |
| 4889 | -c "found renegotiation extension" \ |
| 4890 | -C "=> renegotiate" \ |
| 4891 | -S "=> renegotiate" \ |
| 4892 | -s "write hello request" \ |
| 4893 | -S "SSL - An unexpected message was received from our peer" \ |
| 4894 | -S "failed" |
| 4895 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4896 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4898 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4899 | "$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] | 4900 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4901 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4902 | 0 \ |
| 4903 | -C "client hello, adding renegotiation extension" \ |
| 4904 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4905 | -S "found renegotiation extension" \ |
| 4906 | -s "server hello, secure renegotiation extension" \ |
| 4907 | -c "found renegotiation extension" \ |
| 4908 | -C "=> renegotiate" \ |
| 4909 | -S "=> renegotiate" \ |
| 4910 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4911 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4912 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4913 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4915 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4916 | "$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] | 4917 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4918 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4919 | 0 \ |
| 4920 | -c "client hello, adding renegotiation extension" \ |
| 4921 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4922 | -s "found renegotiation extension" \ |
| 4923 | -s "server hello, secure renegotiation extension" \ |
| 4924 | -c "found renegotiation extension" \ |
| 4925 | -c "=> renegotiate" \ |
| 4926 | -s "=> renegotiate" \ |
| 4927 | -s "write hello request" \ |
| 4928 | -S "SSL - An unexpected message was received from our peer" \ |
| 4929 | -S "failed" |
| 4930 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4931 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4933 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4934 | "$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] | 4935 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4936 | 0 \ |
| 4937 | -C "client hello, adding renegotiation extension" \ |
| 4938 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4939 | -S "found renegotiation extension" \ |
| 4940 | -s "server hello, secure renegotiation extension" \ |
| 4941 | -c "found renegotiation extension" \ |
| 4942 | -S "record counter limit reached: renegotiate" \ |
| 4943 | -C "=> renegotiate" \ |
| 4944 | -S "=> renegotiate" \ |
| 4945 | -S "write hello request" \ |
| 4946 | -S "SSL - An unexpected message was received from our peer" \ |
| 4947 | -S "failed" |
| 4948 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4949 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4950 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4952 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4953 | "$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] | 4954 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4955 | 0 \ |
| 4956 | -c "client hello, adding renegotiation extension" \ |
| 4957 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4958 | -s "found renegotiation extension" \ |
| 4959 | -s "server hello, secure renegotiation extension" \ |
| 4960 | -c "found renegotiation extension" \ |
| 4961 | -s "record counter limit reached: renegotiate" \ |
| 4962 | -c "=> renegotiate" \ |
| 4963 | -s "=> renegotiate" \ |
| 4964 | -s "write hello request" \ |
| 4965 | -S "SSL - An unexpected message was received from our peer" \ |
| 4966 | -S "failed" |
| 4967 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4968 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4970 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4971 | "$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] | 4972 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4973 | 0 \ |
| 4974 | -c "client hello, adding renegotiation extension" \ |
| 4975 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4976 | -s "found renegotiation extension" \ |
| 4977 | -s "server hello, secure renegotiation extension" \ |
| 4978 | -c "found renegotiation extension" \ |
| 4979 | -s "record counter limit reached: renegotiate" \ |
| 4980 | -c "=> renegotiate" \ |
| 4981 | -s "=> renegotiate" \ |
| 4982 | -s "write hello request" \ |
| 4983 | -S "SSL - An unexpected message was received from our peer" \ |
| 4984 | -S "failed" |
| 4985 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4986 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4987 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4988 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4989 | "$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] | 4990 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4991 | 0 \ |
| 4992 | -C "client hello, adding renegotiation extension" \ |
| 4993 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4994 | -S "found renegotiation extension" \ |
| 4995 | -s "server hello, secure renegotiation extension" \ |
| 4996 | -c "found renegotiation extension" \ |
| 4997 | -S "record counter limit reached: renegotiate" \ |
| 4998 | -C "=> renegotiate" \ |
| 4999 | -S "=> renegotiate" \ |
| 5000 | -S "write hello request" \ |
| 5001 | -S "SSL - An unexpected message was received from our peer" \ |
| 5002 | -S "failed" |
| 5003 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5004 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5006 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5007 | "$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] | 5008 | "$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] | 5009 | 0 \ |
| 5010 | -c "client hello, adding renegotiation extension" \ |
| 5011 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5012 | -s "found renegotiation extension" \ |
| 5013 | -s "server hello, secure renegotiation extension" \ |
| 5014 | -c "found renegotiation extension" \ |
| 5015 | -c "=> renegotiate" \ |
| 5016 | -s "=> renegotiate" \ |
| 5017 | -S "write hello request" |
| 5018 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5019 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5021 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5022 | "$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] | 5023 | "$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] | 5024 | 0 \ |
| 5025 | -c "client hello, adding renegotiation extension" \ |
| 5026 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5027 | -s "found renegotiation extension" \ |
| 5028 | -s "server hello, secure renegotiation extension" \ |
| 5029 | -c "found renegotiation extension" \ |
| 5030 | -c "=> renegotiate" \ |
| 5031 | -s "=> renegotiate" \ |
| 5032 | -s "write hello request" |
| 5033 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5036 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5037 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5038 | "$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] | 5039 | 0 \ |
| 5040 | -c "client hello, adding renegotiation extension" \ |
| 5041 | -c "found renegotiation extension" \ |
| 5042 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5043 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5044 | -C "error" \ |
| 5045 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5046 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5047 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5048 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5050 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5051 | "$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] | 5052 | "$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] | 5053 | 0 \ |
| 5054 | -c "client hello, adding renegotiation extension" \ |
| 5055 | -c "found renegotiation extension" \ |
| 5056 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5057 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5058 | -C "error" \ |
| 5059 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5060 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5061 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5062 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5064 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5065 | "$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] | 5066 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5067 | 1 \ |
| 5068 | -c "client hello, adding renegotiation extension" \ |
| 5069 | -C "found renegotiation extension" \ |
| 5070 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5071 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5072 | -c "error" \ |
| 5073 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5074 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5075 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5076 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5078 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5079 | "$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] | 5080 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5081 | allow_legacy=0" \ |
| 5082 | 1 \ |
| 5083 | -c "client hello, adding renegotiation extension" \ |
| 5084 | -C "found renegotiation extension" \ |
| 5085 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5086 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5087 | -c "error" \ |
| 5088 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5089 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [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 | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5093 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5094 | "$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] | 5095 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5096 | allow_legacy=1" \ |
| 5097 | 0 \ |
| 5098 | -c "client hello, adding renegotiation extension" \ |
| 5099 | -C "found renegotiation extension" \ |
| 5100 | -c "=> renegotiate" \ |
| 5101 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5102 | -C "error" \ |
| 5103 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5104 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5105 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5107 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5108 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5109 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5110 | 0 \ |
| 5111 | -c "client hello, adding renegotiation extension" \ |
| 5112 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5113 | -s "found renegotiation extension" \ |
| 5114 | -s "server hello, secure renegotiation extension" \ |
| 5115 | -c "found renegotiation extension" \ |
| 5116 | -c "=> renegotiate" \ |
| 5117 | -s "=> renegotiate" \ |
| 5118 | -S "write hello request" |
| 5119 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5120 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5122 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5123 | "$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] | 5124 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5125 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5126 | 0 \ |
| 5127 | -c "client hello, adding renegotiation extension" \ |
| 5128 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5129 | -s "found renegotiation extension" \ |
| 5130 | -s "server hello, secure renegotiation extension" \ |
| 5131 | -c "found renegotiation extension" \ |
| 5132 | -c "=> renegotiate" \ |
| 5133 | -s "=> renegotiate" \ |
| 5134 | -s "write hello request" |
| 5135 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5136 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5138 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5139 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5140 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5141 | 0 \ |
| 5142 | -c "client hello, adding renegotiation extension" \ |
| 5143 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5144 | -s "found renegotiation extension" \ |
| 5145 | -s "server hello, secure renegotiation extension" \ |
| 5146 | -s "record counter limit reached: renegotiate" \ |
| 5147 | -c "=> renegotiate" \ |
| 5148 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5149 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5150 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5151 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5152 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5154 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5155 | "$G_SRV -u --mtu 4096" \ |
| 5156 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5157 | 0 \ |
| 5158 | -c "client hello, adding renegotiation extension" \ |
| 5159 | -c "found renegotiation extension" \ |
| 5160 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5161 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5162 | -C "error" \ |
| 5163 | -s "Extra-header:" |
| 5164 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5165 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5166 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5167 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5169 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5170 | "$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] | 5171 | "$P_CLI debug_level=3" \ |
| 5172 | 0 \ |
| 5173 | -c "found renegotiation extension" \ |
| 5174 | -C "error" \ |
| 5175 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5176 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5177 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5179 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5180 | "$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] | 5181 | "$P_CLI debug_level=3" \ |
| 5182 | 0 \ |
| 5183 | -C "found renegotiation extension" \ |
| 5184 | -C "error" \ |
| 5185 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5186 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5187 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5189 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5190 | "$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] | 5191 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5192 | 1 \ |
| 5193 | -C "found renegotiation extension" \ |
| 5194 | -c "error" \ |
| 5195 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5196 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5197 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5199 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5200 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5201 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5202 | 0 \ |
| 5203 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5204 | -s "server hello, secure renegotiation extension" |
| 5205 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5206 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5208 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5209 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5210 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5211 | 0 \ |
| 5212 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5213 | -S "server hello, secure renegotiation extension" |
| 5214 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5215 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5217 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5218 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5219 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5220 | 1 \ |
| 5221 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5222 | -S "server hello, secure renegotiation extension" |
| 5223 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5224 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5225 | |
| 5226 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5228 | run_test "DER format: no trailing bytes" \ |
| 5229 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5230 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5231 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5232 | 0 \ |
| 5233 | -c "Handshake was completed" \ |
| 5234 | |
| 5235 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5237 | run_test "DER format: with a trailing zero byte" \ |
| 5238 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5239 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5240 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5241 | 0 \ |
| 5242 | -c "Handshake was completed" \ |
| 5243 | |
| 5244 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5246 | run_test "DER format: with a trailing random byte" \ |
| 5247 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5248 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5249 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5250 | 0 \ |
| 5251 | -c "Handshake was completed" \ |
| 5252 | |
| 5253 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5255 | run_test "DER format: with 2 trailing random bytes" \ |
| 5256 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5257 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5258 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5259 | 0 \ |
| 5260 | -c "Handshake was completed" \ |
| 5261 | |
| 5262 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5264 | run_test "DER format: with 4 trailing random bytes" \ |
| 5265 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5266 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5267 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5268 | 0 \ |
| 5269 | -c "Handshake was completed" \ |
| 5270 | |
| 5271 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5273 | run_test "DER format: with 8 trailing random bytes" \ |
| 5274 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5275 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5276 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5277 | 0 \ |
| 5278 | -c "Handshake was completed" \ |
| 5279 | |
| 5280 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5282 | run_test "DER format: with 9 trailing random bytes" \ |
| 5283 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5284 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5285 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5286 | 0 \ |
| 5287 | -c "Handshake was completed" \ |
| 5288 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5289 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5290 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5291 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5292 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5293 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5294 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5295 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5296 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5297 | 1 \ |
| 5298 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5299 | -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] | 5300 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5301 | -c "X509 - Certificate verification failed" |
| 5302 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5304 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5305 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5306 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5307 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5308 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5309 | 0 \ |
| 5310 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5311 | -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] | 5312 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5313 | -C "X509 - Certificate verification failed" |
| 5314 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5316 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5317 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5318 | "$P_SRV" \ |
| 5319 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5320 | 0 \ |
| 5321 | -c "x509_verify_cert() returned" \ |
| 5322 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5323 | -c "! Certificate verification flags"\ |
| 5324 | -C "! mbedtls_ssl_handshake returned" \ |
| 5325 | -C "X509 - Certificate verification failed" \ |
| 5326 | -C "SSL - No CA Chain is set, but required to operate" |
| 5327 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5328 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5329 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5330 | "$P_SRV" \ |
| 5331 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5332 | 1 \ |
| 5333 | -c "x509_verify_cert() returned" \ |
| 5334 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5335 | -c "! Certificate verification flags"\ |
| 5336 | -c "! mbedtls_ssl_handshake returned" \ |
| 5337 | -c "SSL - No CA Chain is set, but required to operate" |
| 5338 | |
| 5339 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5340 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5341 | # the client informs the server about the supported curves - it does, though, in the |
| 5342 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5343 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5344 | # different means to have the server ignoring the client's supported curve list. |
| 5345 | |
| 5346 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5348 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5349 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5350 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5351 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5352 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5353 | 1 \ |
| 5354 | -c "bad certificate (EC key curve)"\ |
| 5355 | -c "! Certificate verification flags"\ |
| 5356 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5357 | |
| 5358 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5360 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5361 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5362 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5363 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5364 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5365 | 1 \ |
| 5366 | -c "bad certificate (EC key curve)"\ |
| 5367 | -c "! Certificate verification flags"\ |
| 5368 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5369 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5371 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5372 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5373 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5374 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5375 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5376 | 0 \ |
| 5377 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5378 | -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] | 5379 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5380 | -C "X509 - Certificate verification failed" |
| 5381 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5383 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5384 | run_test "Authentication: client SHA256, server required" \ |
| 5385 | "$P_SRV auth_mode=required" \ |
| 5386 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5387 | key_file=data_files/server6.key \ |
| 5388 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5389 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5390 | -c "Supported Signature Algorithm found: 04 " \ |
| 5391 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5392 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5394 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5395 | run_test "Authentication: client SHA384, server required" \ |
| 5396 | "$P_SRV auth_mode=required" \ |
| 5397 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5398 | key_file=data_files/server6.key \ |
| 5399 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5400 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5401 | -c "Supported Signature Algorithm found: 04 " \ |
| 5402 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5403 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5404 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5405 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5406 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5407 | "$P_CLI debug_level=3 crt_file=none \ |
| 5408 | key_file=data_files/server5.key" \ |
| 5409 | 1 \ |
| 5410 | -S "skip write certificate request" \ |
| 5411 | -C "skip parse certificate request" \ |
| 5412 | -c "got a certificate request" \ |
| 5413 | -c "= write certificate$" \ |
| 5414 | -C "skip write certificate$" \ |
| 5415 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5416 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5417 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5418 | -s "No client certification received from the client, but required by the authentication mode" |
| 5419 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5420 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5421 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5422 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5423 | "$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] | 5424 | key_file=data_files/server5.key" \ |
| 5425 | 1 \ |
| 5426 | -S "skip write certificate request" \ |
| 5427 | -C "skip parse certificate request" \ |
| 5428 | -c "got a certificate request" \ |
| 5429 | -C "skip write certificate" \ |
| 5430 | -C "skip write certificate verify" \ |
| 5431 | -S "skip parse certificate verify" \ |
| 5432 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5433 | -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] | 5434 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5435 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5436 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5437 | # We don't check that the client receives the alert because it might |
| 5438 | # detect that its write end of the connection is closed and abort |
| 5439 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5440 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5441 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5442 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5443 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5444 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5445 | key_file=data_files/server5.key" \ |
| 5446 | 0 \ |
| 5447 | -S "skip write certificate request" \ |
| 5448 | -C "skip parse certificate request" \ |
| 5449 | -c "got a certificate request" \ |
| 5450 | -C "skip write certificate" \ |
| 5451 | -C "skip write certificate verify" \ |
| 5452 | -S "skip parse certificate verify" \ |
| 5453 | -S "x509_verify_cert() returned" \ |
| 5454 | -S "! The certificate is not correctly signed" \ |
| 5455 | -S "X509 - Certificate verification failed" |
| 5456 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5457 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5458 | run_test "Authentication: client cert not trusted, server required" \ |
| 5459 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5460 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5461 | key_file=data_files/server5.key" \ |
| 5462 | 1 \ |
| 5463 | -S "skip write certificate request" \ |
| 5464 | -C "skip parse certificate request" \ |
| 5465 | -c "got a certificate request" \ |
| 5466 | -C "skip write certificate" \ |
| 5467 | -C "skip write certificate verify" \ |
| 5468 | -S "skip parse certificate verify" \ |
| 5469 | -s "x509_verify_cert() returned" \ |
| 5470 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5471 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5472 | -s "X509 - Certificate verification failed" |
| 5473 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5474 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5475 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5476 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5477 | "$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] | 5478 | key_file=data_files/server5.key" \ |
| 5479 | 0 \ |
| 5480 | -S "skip write certificate request" \ |
| 5481 | -C "skip parse certificate request" \ |
| 5482 | -c "got a certificate request" \ |
| 5483 | -C "skip write certificate" \ |
| 5484 | -C "skip write certificate verify" \ |
| 5485 | -S "skip parse certificate verify" \ |
| 5486 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5487 | -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] | 5488 | -S "! mbedtls_ssl_handshake returned" \ |
| 5489 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5490 | -S "X509 - Certificate verification failed" |
| 5491 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5492 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5493 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5494 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5495 | "$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] | 5496 | key_file=data_files/server5.key" \ |
| 5497 | 0 \ |
| 5498 | -s "skip write certificate request" \ |
| 5499 | -C "skip parse certificate request" \ |
| 5500 | -c "got no certificate request" \ |
| 5501 | -c "skip write certificate" \ |
| 5502 | -c "skip write certificate verify" \ |
| 5503 | -s "skip parse certificate verify" \ |
| 5504 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5505 | -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] | 5506 | -S "! mbedtls_ssl_handshake returned" \ |
| 5507 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5508 | -S "X509 - Certificate verification failed" |
| 5509 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5510 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5511 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5512 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5513 | "$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] | 5514 | 0 \ |
| 5515 | -S "skip write certificate request" \ |
| 5516 | -C "skip parse certificate request" \ |
| 5517 | -c "got a certificate request" \ |
| 5518 | -C "skip write certificate$" \ |
| 5519 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5520 | -c "skip write certificate verify" \ |
| 5521 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5522 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5523 | -S "! mbedtls_ssl_handshake returned" \ |
| 5524 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5525 | -S "X509 - Certificate verification failed" |
| 5526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5528 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5529 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5530 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5531 | "$O_CLI" \ |
| 5532 | 0 \ |
| 5533 | -S "skip write certificate request" \ |
| 5534 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5535 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5536 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5537 | -S "X509 - Certificate verification failed" |
| 5538 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5540 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5541 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5542 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5543 | "$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] | 5544 | 0 \ |
| 5545 | -C "skip parse certificate request" \ |
| 5546 | -c "got a certificate request" \ |
| 5547 | -C "skip write certificate$" \ |
| 5548 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5549 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5550 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5552 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5553 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5554 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5555 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5556 | 1 \ |
| 5557 | -C "skip parse certificate request" \ |
| 5558 | -c "got a certificate request" \ |
| 5559 | -C "skip write certificate$" \ |
| 5560 | -c "skip write certificate verify" \ |
| 5561 | -c "! mbedtls_ssl_handshake returned" |
| 5562 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5563 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5564 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5565 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5566 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5567 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5568 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5569 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5570 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5571 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5572 | # 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] | 5573 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5574 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5575 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5576 | run_test "Authentication: server max_int chain, client default" \ |
| 5577 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5578 | key_file=data_files/dir-maxpath/09.key" \ |
| 5579 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5580 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5581 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5582 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5583 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5584 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5585 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5586 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5587 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5588 | key_file=data_files/dir-maxpath/10.key" \ |
| 5589 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5590 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5591 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5592 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5593 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5594 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5596 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5597 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5598 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5599 | key_file=data_files/dir-maxpath/10.key" \ |
| 5600 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5601 | auth_mode=optional" \ |
| 5602 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5603 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5604 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5605 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5606 | requires_full_size_output_buffer |
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 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5609 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5610 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5611 | key_file=data_files/dir-maxpath/10.key" \ |
| 5612 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5613 | auth_mode=none" \ |
| 5614 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5615 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5616 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5617 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5618 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5619 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5620 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5621 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5622 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5623 | key_file=data_files/dir-maxpath/10.key" \ |
| 5624 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5625 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5626 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5627 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5628 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5629 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5630 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5631 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5632 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5633 | key_file=data_files/dir-maxpath/10.key" \ |
| 5634 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5635 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5636 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5637 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5638 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5639 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5640 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5641 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5642 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5643 | key_file=data_files/dir-maxpath/10.key" \ |
| 5644 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5645 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5646 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5647 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5648 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5649 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5650 | run_test "Authentication: client max_int chain, server required" \ |
| 5651 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5652 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5653 | key_file=data_files/dir-maxpath/09.key" \ |
| 5654 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5655 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5656 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5657 | # Tests for CA list in CertificateRequest messages |
| 5658 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5660 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5661 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5662 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5663 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5664 | key_file=data_files/server6.key" \ |
| 5665 | 0 \ |
| 5666 | -s "requested DN" |
| 5667 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5669 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5670 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5671 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5672 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5673 | key_file=data_files/server6.key" \ |
| 5674 | 0 \ |
| 5675 | -S "requested DN" |
| 5676 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5678 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5679 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5680 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5681 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5682 | key_file=data_files/server5.key" \ |
| 5683 | 1 \ |
| 5684 | -S "requested DN" \ |
| 5685 | -s "x509_verify_cert() returned" \ |
| 5686 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5687 | -s "! mbedtls_ssl_handshake returned" \ |
| 5688 | -c "! mbedtls_ssl_handshake returned" \ |
| 5689 | -s "X509 - Certificate verification failed" |
| 5690 | |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5691 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5692 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5693 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5694 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5695 | crt_file2=data_files/server1.crt \ |
| 5696 | key_file2=data_files/server1.key" \ |
| 5697 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5698 | crt_file=data_files/server6.crt \ |
| 5699 | key_file=data_files/server6.key" \ |
| 5700 | 0 \ |
| 5701 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5702 | |
| 5703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5704 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5705 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5706 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5707 | crt_file2=data_files/server2.crt \ |
| 5708 | key_file2=data_files/server2.key" \ |
| 5709 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5710 | crt_file=data_files/server6.crt \ |
| 5711 | key_file=data_files/server6.key" \ |
| 5712 | 0 \ |
| 5713 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5714 | |
| 5715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5716 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5717 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5718 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5719 | crt_file2=data_files/server1.crt \ |
| 5720 | key_file2=data_files/server1.key" \ |
| 5721 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5722 | crt_file=data_files/server6.crt \ |
| 5723 | key_file=data_files/server6.key" \ |
| 5724 | 0 \ |
| 5725 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5726 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5727 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5728 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5729 | |
| 5730 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5732 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5733 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5734 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5735 | key_file=data_files/server5.key" \ |
| 5736 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5737 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5738 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5739 | -c "x509_verify_cert() returned" \ |
| 5740 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5741 | -c "! mbedtls_ssl_handshake returned" \ |
| 5742 | -c "X509 - Certificate verification failed" |
| 5743 | |
| 5744 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5746 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5747 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5748 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5749 | key_file=data_files/server5.key" \ |
| 5750 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5751 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5752 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5753 | -c "x509_verify_cert() returned" \ |
| 5754 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5755 | -C "! mbedtls_ssl_handshake returned" \ |
| 5756 | -C "X509 - Certificate verification failed" |
| 5757 | |
| 5758 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5759 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5760 | # the client informs the server about the supported curves - it does, though, in the |
| 5761 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5762 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5763 | # different means to have the server ignoring the client's supported curve list. |
| 5764 | |
| 5765 | requires_config_enabled MBEDTLS_ECP_C |
| 5766 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5768 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5769 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5770 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5771 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5772 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5773 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5774 | -c "use CA callback for X.509 CRT verification" \ |
| 5775 | -c "bad certificate (EC key curve)" \ |
| 5776 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5777 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5778 | |
| 5779 | requires_config_enabled MBEDTLS_ECP_C |
| 5780 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5782 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5783 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5784 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5785 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5786 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5787 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5788 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5789 | -c "bad certificate (EC key curve)"\ |
| 5790 | -c "! Certificate verification flags"\ |
| 5791 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5792 | |
| 5793 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5795 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5796 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5797 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5798 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5799 | key_file=data_files/server6.key \ |
| 5800 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5801 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5802 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5803 | -c "Supported Signature Algorithm found: 04 " \ |
| 5804 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5805 | |
| 5806 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5808 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5809 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5810 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5811 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5812 | key_file=data_files/server6.key \ |
| 5813 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5814 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5815 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5816 | -c "Supported Signature Algorithm found: 04 " \ |
| 5817 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5818 | |
| 5819 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5821 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5822 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5823 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5824 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5825 | key_file=data_files/server5.key" \ |
| 5826 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5827 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5828 | -S "skip write certificate request" \ |
| 5829 | -C "skip parse certificate request" \ |
| 5830 | -c "got a certificate request" \ |
| 5831 | -C "skip write certificate" \ |
| 5832 | -C "skip write certificate verify" \ |
| 5833 | -S "skip parse certificate verify" \ |
| 5834 | -s "x509_verify_cert() returned" \ |
| 5835 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5836 | -s "! mbedtls_ssl_handshake returned" \ |
| 5837 | -s "send alert level=2 message=48" \ |
| 5838 | -c "! mbedtls_ssl_handshake returned" \ |
| 5839 | -s "X509 - Certificate verification failed" |
| 5840 | # We don't check that the client receives the alert because it might |
| 5841 | # detect that its write end of the connection is closed and abort |
| 5842 | # before reading the alert message. |
| 5843 | |
| 5844 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5846 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5847 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5848 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5849 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5850 | key_file=data_files/server5.key" \ |
| 5851 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5852 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5853 | -S "skip write certificate request" \ |
| 5854 | -C "skip parse certificate request" \ |
| 5855 | -c "got a certificate request" \ |
| 5856 | -C "skip write certificate" \ |
| 5857 | -C "skip write certificate verify" \ |
| 5858 | -S "skip parse certificate verify" \ |
| 5859 | -s "x509_verify_cert() returned" \ |
| 5860 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5861 | -s "! mbedtls_ssl_handshake returned" \ |
| 5862 | -c "! mbedtls_ssl_handshake returned" \ |
| 5863 | -s "X509 - Certificate verification failed" |
| 5864 | |
| 5865 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5867 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5868 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5869 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5870 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5871 | key_file=data_files/server5.key" \ |
| 5872 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5873 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5874 | -S "skip write certificate request" \ |
| 5875 | -C "skip parse certificate request" \ |
| 5876 | -c "got a certificate request" \ |
| 5877 | -C "skip write certificate" \ |
| 5878 | -C "skip write certificate verify" \ |
| 5879 | -S "skip parse certificate verify" \ |
| 5880 | -s "x509_verify_cert() returned" \ |
| 5881 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5882 | -S "! mbedtls_ssl_handshake returned" \ |
| 5883 | -C "! mbedtls_ssl_handshake returned" \ |
| 5884 | -S "X509 - Certificate verification failed" |
| 5885 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5886 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5887 | requires_full_size_output_buffer |
| 5888 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5890 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5891 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5892 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5893 | key_file=data_files/dir-maxpath/09.key" \ |
| 5894 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5895 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5896 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5897 | -C "X509 - A fatal error occurred" |
| 5898 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5899 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5900 | requires_full_size_output_buffer |
| 5901 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5903 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5904 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5905 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5906 | key_file=data_files/dir-maxpath/10.key" \ |
| 5907 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5908 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5909 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5910 | -c "X509 - A fatal error occurred" |
| 5911 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5912 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5913 | requires_full_size_output_buffer |
| 5914 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5916 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5917 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5918 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5919 | key_file=data_files/dir-maxpath/10.key" \ |
| 5920 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5921 | debug_level=3 auth_mode=optional" \ |
| 5922 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5923 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5924 | -c "X509 - A fatal error occurred" |
| 5925 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5926 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5927 | requires_full_size_output_buffer |
| 5928 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5930 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5931 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5932 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5933 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5934 | key_file=data_files/dir-maxpath/10.key" \ |
| 5935 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5936 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5937 | -s "X509 - A fatal error occurred" |
| 5938 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5939 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5940 | requires_full_size_output_buffer |
| 5941 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5943 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5944 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5945 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5946 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5947 | key_file=data_files/dir-maxpath/10.key" \ |
| 5948 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5949 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5950 | -s "X509 - A fatal error occurred" |
| 5951 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5952 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5953 | requires_full_size_output_buffer |
| 5954 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5956 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5957 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5958 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5959 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5960 | key_file=data_files/dir-maxpath/09.key" \ |
| 5961 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5962 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5963 | -S "X509 - A fatal error occurred" |
| 5964 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5965 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5966 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5967 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5968 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5969 | "$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] | 5970 | key_file=data_files/server5.key \ |
| 5971 | crt_file2=data_files/server5-sha1.crt \ |
| 5972 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5973 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5974 | 0 \ |
| 5975 | -c "signed using.*ECDSA with SHA256" \ |
| 5976 | -C "signed using.*ECDSA with SHA1" |
| 5977 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5978 | # tests for SNI |
| 5979 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5980 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5982 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5983 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5984 | 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] | 5985 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5986 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5987 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5988 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5989 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5990 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5991 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5992 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5993 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5994 | 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] | 5995 | 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] | 5996 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5997 | 0 \ |
| 5998 | -s "parse ServerName extension" \ |
| 5999 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6000 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6001 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6002 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6003 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6004 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6005 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6006 | 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] | 6007 | 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] | 6008 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6009 | 0 \ |
| 6010 | -s "parse ServerName extension" \ |
| 6011 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6012 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6013 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6014 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6015 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6016 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6017 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6018 | 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] | 6019 | 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] | 6020 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6021 | 1 \ |
| 6022 | -s "parse ServerName extension" \ |
| 6023 | -s "ssl_sni_wrapper() returned" \ |
| 6024 | -s "mbedtls_ssl_handshake returned" \ |
| 6025 | -c "mbedtls_ssl_handshake returned" \ |
| 6026 | -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] | 6027 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6028 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6029 | run_test "SNI: client auth no override: optional" \ |
| 6030 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6031 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6032 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6033 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6034 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 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 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6042 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6043 | run_test "SNI: client auth override: none -> optional" \ |
| 6044 | "$P_SRV debug_level=3 auth_mode=none \ |
| 6045 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6046 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6047 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6048 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6049 | -S "skip write certificate request" \ |
| 6050 | -C "skip parse certificate request" \ |
| 6051 | -c "got a certificate request" \ |
| 6052 | -C "skip write certificate" \ |
| 6053 | -C "skip write certificate verify" \ |
| 6054 | -S "skip parse certificate verify" |
| 6055 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6056 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6057 | run_test "SNI: client auth override: optional -> none" \ |
| 6058 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6059 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6060 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6061 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6062 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6063 | -s "skip write certificate request" \ |
| 6064 | -C "skip parse certificate request" \ |
| 6065 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6066 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6067 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6068 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6069 | run_test "SNI: CA no override" \ |
| 6070 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6071 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6072 | ca_file=data_files/test-ca.crt \ |
| 6073 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6074 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6075 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6076 | 1 \ |
| 6077 | -S "skip write certificate request" \ |
| 6078 | -C "skip parse certificate request" \ |
| 6079 | -c "got a certificate request" \ |
| 6080 | -C "skip write certificate" \ |
| 6081 | -C "skip write certificate verify" \ |
| 6082 | -S "skip parse certificate verify" \ |
| 6083 | -s "x509_verify_cert() returned" \ |
| 6084 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6085 | -S "The certificate has been revoked (is on a CRL)" |
| 6086 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6087 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6088 | run_test "SNI: CA override" \ |
| 6089 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6090 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6091 | ca_file=data_files/test-ca.crt \ |
| 6092 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6093 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6094 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6095 | 0 \ |
| 6096 | -S "skip write certificate request" \ |
| 6097 | -C "skip parse certificate request" \ |
| 6098 | -c "got a certificate request" \ |
| 6099 | -C "skip write certificate" \ |
| 6100 | -C "skip write certificate verify" \ |
| 6101 | -S "skip parse certificate verify" \ |
| 6102 | -S "x509_verify_cert() returned" \ |
| 6103 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6104 | -S "The certificate has been revoked (is on a CRL)" |
| 6105 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6106 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6107 | run_test "SNI: CA override with CRL" \ |
| 6108 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6109 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6110 | ca_file=data_files/test-ca.crt \ |
| 6111 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6112 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6113 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6114 | 1 \ |
| 6115 | -S "skip write certificate request" \ |
| 6116 | -C "skip parse certificate request" \ |
| 6117 | -c "got a certificate request" \ |
| 6118 | -C "skip write certificate" \ |
| 6119 | -C "skip write certificate verify" \ |
| 6120 | -S "skip parse certificate verify" \ |
| 6121 | -s "x509_verify_cert() returned" \ |
| 6122 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6123 | -s "The certificate has been revoked (is on a CRL)" |
| 6124 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6125 | # Tests for SNI and DTLS |
| 6126 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6127 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6129 | run_test "SNI: DTLS, no SNI callback" \ |
| 6130 | "$P_SRV debug_level=3 dtls=1 \ |
| 6131 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6132 | "$P_CLI server_name=localhost dtls=1" \ |
| 6133 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6134 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6135 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6136 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6137 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6139 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6140 | "$P_SRV debug_level=3 dtls=1 \ |
| 6141 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6142 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6143 | "$P_CLI server_name=localhost dtls=1" \ |
| 6144 | 0 \ |
| 6145 | -s "parse ServerName extension" \ |
| 6146 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6147 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6148 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6149 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6151 | run_test "SNI: DTLS, matching cert 2" \ |
| 6152 | "$P_SRV debug_level=3 dtls=1 \ |
| 6153 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6154 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6155 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6156 | 0 \ |
| 6157 | -s "parse ServerName extension" \ |
| 6158 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6159 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6160 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6162 | run_test "SNI: DTLS, no matching cert" \ |
| 6163 | "$P_SRV debug_level=3 dtls=1 \ |
| 6164 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6165 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6166 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6167 | 1 \ |
| 6168 | -s "parse ServerName extension" \ |
| 6169 | -s "ssl_sni_wrapper() returned" \ |
| 6170 | -s "mbedtls_ssl_handshake returned" \ |
| 6171 | -c "mbedtls_ssl_handshake returned" \ |
| 6172 | -c "SSL - A fatal alert message was received from our peer" |
| 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 | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6175 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 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 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6179 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6180 | 0 \ |
| 6181 | -S "skip write certificate request" \ |
| 6182 | -C "skip parse certificate request" \ |
| 6183 | -c "got a certificate request" \ |
| 6184 | -C "skip write certificate" \ |
| 6185 | -C "skip write certificate verify" \ |
| 6186 | -S "skip parse certificate verify" |
| 6187 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6189 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6190 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6191 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6192 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6193 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6194 | 0 \ |
| 6195 | -S "skip write certificate request" \ |
| 6196 | -C "skip parse certificate request" \ |
| 6197 | -c "got a certificate request" \ |
| 6198 | -C "skip write certificate" \ |
| 6199 | -C "skip write certificate verify" \ |
| 6200 | -S "skip parse certificate verify" |
| 6201 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6203 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6204 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6205 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6206 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6207 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6208 | 0 \ |
| 6209 | -s "skip write certificate request" \ |
| 6210 | -C "skip parse certificate request" \ |
| 6211 | -c "got no certificate request" \ |
| 6212 | -c "skip write certificate" \ |
| 6213 | -c "skip write certificate verify" \ |
| 6214 | -s "skip parse certificate verify" |
| 6215 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6217 | run_test "SNI: DTLS, CA no override" \ |
| 6218 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6219 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6220 | ca_file=data_files/test-ca.crt \ |
| 6221 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6222 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6223 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6224 | 1 \ |
| 6225 | -S "skip write certificate request" \ |
| 6226 | -C "skip parse certificate request" \ |
| 6227 | -c "got a certificate request" \ |
| 6228 | -C "skip write certificate" \ |
| 6229 | -C "skip write certificate verify" \ |
| 6230 | -S "skip parse certificate verify" \ |
| 6231 | -s "x509_verify_cert() returned" \ |
| 6232 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6233 | -S "The certificate has been revoked (is on a CRL)" |
| 6234 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6235 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6236 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6237 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6238 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6239 | ca_file=data_files/test-ca.crt \ |
| 6240 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6241 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6242 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6243 | 0 \ |
| 6244 | -S "skip write certificate request" \ |
| 6245 | -C "skip parse certificate request" \ |
| 6246 | -c "got a certificate request" \ |
| 6247 | -C "skip write certificate" \ |
| 6248 | -C "skip write certificate verify" \ |
| 6249 | -S "skip parse certificate verify" \ |
| 6250 | -S "x509_verify_cert() returned" \ |
| 6251 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6252 | -S "The certificate has been revoked (is on a CRL)" |
| 6253 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6255 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6256 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6257 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6258 | ca_file=data_files/test-ca.crt \ |
| 6259 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6260 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6261 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6262 | 1 \ |
| 6263 | -S "skip write certificate request" \ |
| 6264 | -C "skip parse certificate request" \ |
| 6265 | -c "got a certificate request" \ |
| 6266 | -C "skip write certificate" \ |
| 6267 | -C "skip write certificate verify" \ |
| 6268 | -S "skip parse certificate verify" \ |
| 6269 | -s "x509_verify_cert() returned" \ |
| 6270 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6271 | -s "The certificate has been revoked (is on a CRL)" |
| 6272 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6273 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6274 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6275 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6276 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6277 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6278 | "$P_CLI nbio=2 tickets=0" \ |
| 6279 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6280 | -S "mbedtls_ssl_handshake returned" \ |
| 6281 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6282 | -c "Read from server: .* bytes read" |
| 6283 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6284 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6285 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6286 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6287 | "$P_CLI nbio=2 tickets=0" \ |
| 6288 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6289 | -S "mbedtls_ssl_handshake returned" \ |
| 6290 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6291 | -c "Read from server: .* bytes read" |
| 6292 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6294 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6295 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6296 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6297 | "$P_CLI nbio=2 tickets=1" \ |
| 6298 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6299 | -S "mbedtls_ssl_handshake returned" \ |
| 6300 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6301 | -c "Read from server: .* bytes read" |
| 6302 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6304 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6305 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6306 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6307 | "$P_CLI nbio=2 tickets=1" \ |
| 6308 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6309 | -S "mbedtls_ssl_handshake returned" \ |
| 6310 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6311 | -c "Read from server: .* bytes read" |
| 6312 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6314 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6315 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6316 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6317 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6318 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6319 | -S "mbedtls_ssl_handshake returned" \ |
| 6320 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6321 | -c "Read from server: .* bytes read" |
| 6322 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6324 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6325 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6326 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6327 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6328 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6329 | -S "mbedtls_ssl_handshake returned" \ |
| 6330 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6331 | -c "Read from server: .* bytes read" |
| 6332 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6334 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6335 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6336 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6337 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 6338 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6339 | -S "mbedtls_ssl_handshake returned" \ |
| 6340 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6341 | -c "Read from server: .* bytes read" |
| 6342 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6343 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6344 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6345 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6346 | run_test "Event-driven I/O: basic handshake" \ |
| 6347 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6348 | "$P_CLI event=1 tickets=0" \ |
| 6349 | 0 \ |
| 6350 | -S "mbedtls_ssl_handshake returned" \ |
| 6351 | -C "mbedtls_ssl_handshake returned" \ |
| 6352 | -c "Read from server: .* bytes read" |
| 6353 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6354 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6355 | run_test "Event-driven I/O: client auth" \ |
| 6356 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6357 | "$P_CLI event=1 tickets=0" \ |
| 6358 | 0 \ |
| 6359 | -S "mbedtls_ssl_handshake returned" \ |
| 6360 | -C "mbedtls_ssl_handshake returned" \ |
| 6361 | -c "Read from server: .* bytes read" |
| 6362 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6364 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6365 | run_test "Event-driven I/O: ticket" \ |
| 6366 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6367 | "$P_CLI event=1 tickets=1" \ |
| 6368 | 0 \ |
| 6369 | -S "mbedtls_ssl_handshake returned" \ |
| 6370 | -C "mbedtls_ssl_handshake returned" \ |
| 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 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6374 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6375 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6376 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6377 | "$P_CLI event=1 tickets=1" \ |
| 6378 | 0 \ |
| 6379 | -S "mbedtls_ssl_handshake returned" \ |
| 6380 | -C "mbedtls_ssl_handshake returned" \ |
| 6381 | -c "Read from server: .* bytes read" |
| 6382 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6384 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6385 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 6386 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6387 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6388 | 0 \ |
| 6389 | -S "mbedtls_ssl_handshake returned" \ |
| 6390 | -C "mbedtls_ssl_handshake returned" \ |
| 6391 | -c "Read from server: .* bytes read" |
| 6392 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6394 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6395 | run_test "Event-driven I/O: ticket + resume" \ |
| 6396 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6397 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6398 | 0 \ |
| 6399 | -S "mbedtls_ssl_handshake returned" \ |
| 6400 | -C "mbedtls_ssl_handshake returned" \ |
| 6401 | -c "Read from server: .* bytes read" |
| 6402 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6404 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6405 | run_test "Event-driven I/O: session-id resume" \ |
| 6406 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6407 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 6408 | 0 \ |
| 6409 | -S "mbedtls_ssl_handshake returned" \ |
| 6410 | -C "mbedtls_ssl_handshake returned" \ |
| 6411 | -c "Read from server: .* bytes read" |
| 6412 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6414 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6415 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6416 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6417 | 0 \ |
| 6418 | -c "Read from server: .* bytes read" |
| 6419 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6421 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6422 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6423 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6424 | 0 \ |
| 6425 | -c "Read from server: .* bytes read" |
| 6426 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6428 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6429 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6430 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6431 | 0 \ |
| 6432 | -c "Read from server: .* bytes read" |
| 6433 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6435 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6436 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6437 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6438 | 0 \ |
| 6439 | -c "Read from server: .* bytes read" |
| 6440 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6441 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6442 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6443 | "$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] | 6444 | "$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] | 6445 | 0 \ |
| 6446 | -c "Read from server: .* bytes read" |
| 6447 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6449 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6450 | "$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] | 6451 | "$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] | 6452 | 0 \ |
| 6453 | -c "Read from server: .* bytes read" |
| 6454 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6456 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6457 | "$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] | 6458 | "$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] | 6459 | 0 \ |
| 6460 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6461 | |
| 6462 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6463 | # During session resumption, the client will send its ApplicationData record |
| 6464 | # within the same datagram as the Finished messages. In this situation, the |
| 6465 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6466 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6468 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6469 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6470 | "$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] | 6471 | "$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] | 6472 | 0 \ |
| 6473 | -c "Read from server: .* bytes read" |
| 6474 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6475 | # Tests for version negotiation |
| 6476 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6478 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6479 | "$P_SRV" \ |
| 6480 | "$P_CLI" \ |
| 6481 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6482 | -S "mbedtls_ssl_handshake returned" \ |
| 6483 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6484 | -s "Protocol is TLSv1.2" \ |
| 6485 | -c "Protocol is TLSv1.2" |
| 6486 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6488 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6489 | "$P_SRV" \ |
| 6490 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6491 | 1 \ |
| 6492 | -s "Handshake protocol not within min/max boundaries" \ |
| 6493 | -c "Error in protocol version" \ |
| 6494 | -S "Protocol is TLSv1.0" \ |
| 6495 | -C "Handshake was completed" |
| 6496 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6498 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6499 | "$P_SRV" \ |
| 6500 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6501 | 1 \ |
| 6502 | -s "Handshake protocol not within min/max boundaries" \ |
| 6503 | -c "Error in protocol version" \ |
| 6504 | -S "Protocol is TLSv1.1" \ |
| 6505 | -C "Handshake was completed" |
| 6506 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6508 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6509 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6510 | "$P_CLI" \ |
| 6511 | 1 \ |
| 6512 | -s "Error in protocol version" \ |
| 6513 | -c "Handshake protocol not within min/max boundaries" \ |
| 6514 | -S "Version: TLS1.0" \ |
| 6515 | -C "Protocol is TLSv1.0" |
| 6516 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6518 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6519 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6520 | "$P_CLI" \ |
| 6521 | 1 \ |
| 6522 | -s "Error in protocol version" \ |
| 6523 | -c "Handshake protocol not within min/max boundaries" \ |
| 6524 | -S "Version: TLS1.1" \ |
| 6525 | -C "Protocol is TLSv1.1" |
| 6526 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6527 | # Tests for ALPN extension |
| 6528 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6529 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6530 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6531 | "$P_SRV debug_level=3" \ |
| 6532 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6533 | 0 \ |
| 6534 | -C "client hello, adding alpn extension" \ |
| 6535 | -S "found alpn extension" \ |
| 6536 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6537 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6538 | -C "found alpn extension " \ |
| 6539 | -C "Application Layer Protocol is" \ |
| 6540 | -S "Application Layer Protocol is" |
| 6541 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6542 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6543 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6544 | "$P_SRV debug_level=3" \ |
| 6545 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6546 | 0 \ |
| 6547 | -c "client hello, adding alpn extension" \ |
| 6548 | -s "found alpn extension" \ |
| 6549 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6550 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6551 | -C "found alpn extension " \ |
| 6552 | -c "Application Layer Protocol is (none)" \ |
| 6553 | -S "Application Layer Protocol is" |
| 6554 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6555 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6556 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6557 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6558 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6559 | 0 \ |
| 6560 | -C "client hello, adding alpn extension" \ |
| 6561 | -S "found alpn extension" \ |
| 6562 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6563 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6564 | -C "found alpn extension " \ |
| 6565 | -C "Application Layer Protocol is" \ |
| 6566 | -s "Application Layer Protocol is (none)" |
| 6567 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6568 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6569 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6570 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6571 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6572 | 0 \ |
| 6573 | -c "client hello, adding alpn extension" \ |
| 6574 | -s "found alpn extension" \ |
| 6575 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6576 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6577 | -c "found alpn extension" \ |
| 6578 | -c "Application Layer Protocol is abc" \ |
| 6579 | -s "Application Layer Protocol is abc" |
| 6580 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6581 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6582 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6583 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6584 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6585 | 0 \ |
| 6586 | -c "client hello, adding alpn extension" \ |
| 6587 | -s "found alpn extension" \ |
| 6588 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6589 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6590 | -c "found alpn extension" \ |
| 6591 | -c "Application Layer Protocol is abc" \ |
| 6592 | -s "Application Layer Protocol is abc" |
| 6593 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6594 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6595 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6596 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6597 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6598 | 0 \ |
| 6599 | -c "client hello, adding alpn extension" \ |
| 6600 | -s "found alpn extension" \ |
| 6601 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6602 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6603 | -c "found alpn extension" \ |
| 6604 | -c "Application Layer Protocol is 1234" \ |
| 6605 | -s "Application Layer Protocol is 1234" |
| 6606 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6607 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6608 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6609 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6610 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6611 | 1 \ |
| 6612 | -c "client hello, adding alpn extension" \ |
| 6613 | -s "found alpn extension" \ |
| 6614 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6615 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6616 | -C "found alpn extension" \ |
| 6617 | -C "Application Layer Protocol is 1234" \ |
| 6618 | -S "Application Layer Protocol is 1234" |
| 6619 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6620 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6621 | # Tests for keyUsage in leaf certificates, part 1: |
| 6622 | # server-side certificate/suite selection |
| 6623 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6625 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6626 | "$P_SRV key_file=data_files/server2.key \ |
| 6627 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6628 | "$P_CLI" \ |
| 6629 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6630 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6631 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6633 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6634 | "$P_SRV key_file=data_files/server2.key \ |
| 6635 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6636 | "$P_CLI" \ |
| 6637 | 0 \ |
| 6638 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6639 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6641 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6642 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6643 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6644 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6645 | 1 \ |
| 6646 | -C "Ciphersuite is " |
| 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 srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6650 | "$P_SRV key_file=data_files/server5.key \ |
| 6651 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6652 | "$P_CLI" \ |
| 6653 | 0 \ |
| 6654 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6655 | |
| 6656 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6658 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6659 | "$P_SRV key_file=data_files/server5.key \ |
| 6660 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6661 | "$P_CLI" \ |
| 6662 | 0 \ |
| 6663 | -c "Ciphersuite is TLS-ECDH-" |
| 6664 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6665 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6666 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6667 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6668 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6669 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6670 | 1 \ |
| 6671 | -C "Ciphersuite is " |
| 6672 | |
| 6673 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6674 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6675 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6677 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6678 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6679 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6680 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6681 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6682 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6683 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6684 | -C "Processing of the Certificate handshake message failed" \ |
| 6685 | -c "Ciphersuite is TLS-" |
| 6686 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6688 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6689 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6690 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6691 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6692 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6693 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6694 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6695 | -C "Processing of the Certificate handshake message failed" \ |
| 6696 | -c "Ciphersuite is TLS-" |
| 6697 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6699 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6700 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6701 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6702 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6703 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6704 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6705 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6706 | -C "Processing of the Certificate handshake message failed" \ |
| 6707 | -c "Ciphersuite is TLS-" |
| 6708 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6710 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6711 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6712 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6713 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6714 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6715 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6716 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6717 | -c "Processing of the Certificate handshake message failed" \ |
| 6718 | -C "Ciphersuite is TLS-" |
| 6719 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6721 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6722 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6723 | -cert data_files/server2.ku-ke.crt" \ |
| 6724 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6725 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6726 | 0 \ |
| 6727 | -c "bad certificate (usage extensions)" \ |
| 6728 | -C "Processing of the Certificate handshake message failed" \ |
| 6729 | -c "Ciphersuite is TLS-" \ |
| 6730 | -c "! Usage does not match the keyUsage extension" |
| 6731 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6733 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6734 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6735 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6736 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6737 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6738 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6739 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6740 | -C "Processing of the Certificate handshake message failed" \ |
| 6741 | -c "Ciphersuite is TLS-" |
| 6742 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6744 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6745 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6746 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6747 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6748 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6749 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6750 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6751 | -c "Processing of the Certificate handshake message failed" \ |
| 6752 | -C "Ciphersuite is TLS-" |
| 6753 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6754 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6755 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6756 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6757 | -cert data_files/server2.ku-ds.crt" \ |
| 6758 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6759 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6760 | 0 \ |
| 6761 | -c "bad certificate (usage extensions)" \ |
| 6762 | -C "Processing of the Certificate handshake message failed" \ |
| 6763 | -c "Ciphersuite is TLS-" \ |
| 6764 | -c "! Usage does not match the keyUsage extension" |
| 6765 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6766 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6767 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6768 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6769 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6770 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6771 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6772 | "$P_CLI debug_level=3" \ |
| 6773 | 0 \ |
| 6774 | -C "bad certificate (usage extensions)" \ |
| 6775 | -C "Processing of the Certificate handshake message failed" \ |
| 6776 | -c "Ciphersuite is" |
| 6777 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6778 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6779 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6780 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6781 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6782 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6783 | -cert data_files/server2.ku-ke.crt" \ |
| 6784 | "$P_CLI debug_level=1" \ |
| 6785 | 1 \ |
| 6786 | -c "bad certificate (usage extensions)" \ |
| 6787 | -c "Processing of the Certificate handshake message failed" \ |
| 6788 | -C "Ciphersuite is" |
| 6789 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6790 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6791 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6792 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6793 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6794 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6795 | -cert data_files/server2.ku-ka.crt" \ |
| 6796 | "$P_CLI debug_level=1" \ |
| 6797 | 1 \ |
| 6798 | -c "bad certificate (usage extensions)" \ |
| 6799 | -c "Processing of the Certificate handshake message failed" \ |
| 6800 | -C "Ciphersuite is" |
| 6801 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6802 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6803 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6804 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6805 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6806 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6807 | -cert data_files/server5.ku-ds.crt" \ |
| 6808 | "$P_CLI debug_level=3" \ |
| 6809 | 0 \ |
| 6810 | -C "bad certificate (usage extensions)" \ |
| 6811 | -C "Processing of the Certificate handshake message failed" \ |
| 6812 | -c "Ciphersuite is" |
| 6813 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6814 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6815 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6816 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6817 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6818 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6819 | -cert data_files/server5.ku-ke.crt" \ |
| 6820 | "$P_CLI debug_level=1" \ |
| 6821 | 1 \ |
| 6822 | -c "bad certificate (usage extensions)" \ |
| 6823 | -c "Processing of the Certificate handshake message failed" \ |
| 6824 | -C "Ciphersuite is" |
| 6825 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6826 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6827 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6828 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6829 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6830 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6831 | -cert data_files/server5.ku-ka.crt" \ |
| 6832 | "$P_CLI debug_level=1" \ |
| 6833 | 1 \ |
| 6834 | -c "bad certificate (usage extensions)" \ |
| 6835 | -c "Processing of the Certificate handshake message failed" \ |
| 6836 | -C "Ciphersuite is" |
| 6837 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6838 | # Tests for keyUsage in leaf certificates, part 3: |
| 6839 | # server-side checking of client cert |
| 6840 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6842 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6843 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6844 | "$O_CLI -key data_files/server2.key \ |
| 6845 | -cert data_files/server2.ku-ds.crt" \ |
| 6846 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6847 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6848 | -S "bad certificate (usage extensions)" \ |
| 6849 | -S "Processing of the Certificate handshake message failed" |
| 6850 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6852 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6853 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6854 | "$O_CLI -key data_files/server2.key \ |
| 6855 | -cert data_files/server2.ku-ke.crt" \ |
| 6856 | 0 \ |
| 6857 | -s "bad certificate (usage extensions)" \ |
| 6858 | -S "Processing of the Certificate handshake message failed" |
| 6859 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6861 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6862 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6863 | "$O_CLI -key data_files/server2.key \ |
| 6864 | -cert data_files/server2.ku-ke.crt" \ |
| 6865 | 1 \ |
| 6866 | -s "bad certificate (usage extensions)" \ |
| 6867 | -s "Processing of the Certificate handshake message failed" |
| 6868 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6870 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6871 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6872 | "$O_CLI -key data_files/server5.key \ |
| 6873 | -cert data_files/server5.ku-ds.crt" \ |
| 6874 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6875 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6876 | -S "bad certificate (usage extensions)" \ |
| 6877 | -S "Processing of the Certificate handshake message failed" |
| 6878 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6880 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6881 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6882 | "$O_CLI -key data_files/server5.key \ |
| 6883 | -cert data_files/server5.ku-ka.crt" \ |
| 6884 | 0 \ |
| 6885 | -s "bad certificate (usage extensions)" \ |
| 6886 | -S "Processing of the Certificate handshake message failed" |
| 6887 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6888 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6889 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6890 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6891 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6892 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6893 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6894 | -cert data_files/server2.ku-ds.crt" \ |
| 6895 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6896 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6897 | -S "bad certificate (usage extensions)" \ |
| 6898 | -S "Processing of the Certificate handshake message failed" |
| 6899 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6900 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6901 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6902 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6903 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6904 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6905 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6906 | -cert data_files/server2.ku-ke.crt" \ |
| 6907 | 0 \ |
| 6908 | -s "bad certificate (usage extensions)" \ |
| 6909 | -S "Processing of the Certificate handshake message failed" |
| 6910 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6911 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6912 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6913 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6914 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6915 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6916 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6917 | -cert data_files/server5.ku-ds.crt" \ |
| 6918 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6919 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6920 | -S "bad certificate (usage extensions)" \ |
| 6921 | -S "Processing of the Certificate handshake message failed" |
| 6922 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6923 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6924 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6925 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6926 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6927 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6928 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6929 | -cert data_files/server5.ku-ka.crt" \ |
| 6930 | 0 \ |
| 6931 | -s "bad certificate (usage extensions)" \ |
| 6932 | -S "Processing of the Certificate handshake message failed" |
| 6933 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6934 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6935 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6937 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6938 | "$P_SRV key_file=data_files/server5.key \ |
| 6939 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6940 | "$P_CLI" \ |
| 6941 | 0 |
| 6942 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6944 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6945 | "$P_SRV key_file=data_files/server5.key \ |
| 6946 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6947 | "$P_CLI" \ |
| 6948 | 0 |
| 6949 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6951 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6952 | "$P_SRV key_file=data_files/server5.key \ |
| 6953 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6954 | "$P_CLI" \ |
| 6955 | 0 |
| 6956 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6958 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6959 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6960 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6961 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6962 | 1 |
| 6963 | |
| 6964 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6965 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6967 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6968 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6969 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6970 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6971 | 0 \ |
| 6972 | -C "bad certificate (usage extensions)" \ |
| 6973 | -C "Processing of the Certificate handshake message failed" \ |
| 6974 | -c "Ciphersuite is TLS-" |
| 6975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6977 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6978 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6979 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6980 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6981 | 0 \ |
| 6982 | -C "bad certificate (usage extensions)" \ |
| 6983 | -C "Processing of the Certificate handshake message failed" \ |
| 6984 | -c "Ciphersuite is TLS-" |
| 6985 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6987 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6988 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6989 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6990 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6991 | 0 \ |
| 6992 | -C "bad certificate (usage extensions)" \ |
| 6993 | -C "Processing of the Certificate handshake message failed" \ |
| 6994 | -c "Ciphersuite is TLS-" |
| 6995 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6997 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6998 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6999 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7000 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7001 | 1 \ |
| 7002 | -c "bad certificate (usage extensions)" \ |
| 7003 | -c "Processing of the Certificate handshake message failed" \ |
| 7004 | -C "Ciphersuite is TLS-" |
| 7005 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7006 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7007 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7008 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7009 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 7010 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7011 | -cert data_files/server5.eku-srv.crt" \ |
| 7012 | "$P_CLI debug_level=1" \ |
| 7013 | 0 \ |
| 7014 | -C "bad certificate (usage extensions)" \ |
| 7015 | -C "Processing of the Certificate handshake message failed" \ |
| 7016 | -c "Ciphersuite is" |
| 7017 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7018 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7019 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7020 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7021 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 7022 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7023 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7024 | "$P_CLI debug_level=1" \ |
| 7025 | 0 \ |
| 7026 | -C "bad certificate (usage extensions)" \ |
| 7027 | -C "Processing of the Certificate handshake message failed" \ |
| 7028 | -c "Ciphersuite is" |
| 7029 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7030 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7031 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7032 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7033 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 7034 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7035 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7036 | "$P_CLI debug_level=1" \ |
| 7037 | 0 \ |
| 7038 | -C "bad certificate (usage extensions)" \ |
| 7039 | -C "Processing of the Certificate handshake message failed" \ |
| 7040 | -c "Ciphersuite is" |
| 7041 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7042 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7043 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7044 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7045 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 7046 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7047 | -cert data_files/server5.eku-cs.crt" \ |
| 7048 | "$P_CLI debug_level=1" \ |
| 7049 | 1 \ |
| 7050 | -c "bad certificate (usage extensions)" \ |
| 7051 | -c "Processing of the Certificate handshake message failed" \ |
| 7052 | -C "Ciphersuite is" |
| 7053 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7054 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 7055 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7057 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7058 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7059 | "$O_CLI -key data_files/server5.key \ |
| 7060 | -cert data_files/server5.eku-cli.crt" \ |
| 7061 | 0 \ |
| 7062 | -S "bad certificate (usage extensions)" \ |
| 7063 | -S "Processing of the Certificate handshake message failed" |
| 7064 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7065 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7066 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7067 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7068 | "$O_CLI -key data_files/server5.key \ |
| 7069 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7070 | 0 \ |
| 7071 | -S "bad certificate (usage extensions)" \ |
| 7072 | -S "Processing of the Certificate handshake message failed" |
| 7073 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7075 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7076 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7077 | "$O_CLI -key data_files/server5.key \ |
| 7078 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7079 | 0 \ |
| 7080 | -S "bad certificate (usage extensions)" \ |
| 7081 | -S "Processing of the Certificate handshake message failed" |
| 7082 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7084 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7085 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7086 | "$O_CLI -key data_files/server5.key \ |
| 7087 | -cert data_files/server5.eku-cs.crt" \ |
| 7088 | 0 \ |
| 7089 | -s "bad certificate (usage extensions)" \ |
| 7090 | -S "Processing of the Certificate handshake message failed" |
| 7091 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7093 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7094 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7095 | "$O_CLI -key data_files/server5.key \ |
| 7096 | -cert data_files/server5.eku-cs.crt" \ |
| 7097 | 1 \ |
| 7098 | -s "bad certificate (usage extensions)" \ |
| 7099 | -s "Processing of the Certificate handshake message failed" |
| 7100 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7101 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7102 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7103 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7104 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7105 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7106 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7107 | -cert data_files/server5.eku-cli.crt" \ |
| 7108 | 0 \ |
| 7109 | -S "bad certificate (usage extensions)" \ |
| 7110 | -S "Processing of the Certificate handshake message failed" |
| 7111 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7112 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7113 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7114 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7115 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7116 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7117 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7118 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7119 | 0 \ |
| 7120 | -S "bad certificate (usage extensions)" \ |
| 7121 | -S "Processing of the Certificate handshake message failed" |
| 7122 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7123 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7124 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7125 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7126 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7127 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7128 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7129 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7130 | 0 \ |
| 7131 | -S "bad certificate (usage extensions)" \ |
| 7132 | -S "Processing of the Certificate handshake message failed" |
| 7133 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7134 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7135 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7136 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7137 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7138 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7139 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7140 | -cert data_files/server5.eku-cs.crt" \ |
| 7141 | 0 \ |
| 7142 | -s "bad certificate (usage extensions)" \ |
| 7143 | -S "Processing of the Certificate handshake message failed" |
| 7144 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7145 | # Tests for DHM parameters loading |
| 7146 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7148 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7149 | "$P_SRV" \ |
| 7150 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7151 | debug_level=3" \ |
| 7152 | 0 \ |
| 7153 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7154 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7155 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7157 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7158 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7159 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7160 | debug_level=3" \ |
| 7161 | 0 \ |
| 7162 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 7163 | -c "value of 'DHM: G ' (2 bits)" |
| 7164 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7165 | # Tests for DHM client-side size checking |
| 7166 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7168 | run_test "DHM size: server default, client default, OK" \ |
| 7169 | "$P_SRV" \ |
| 7170 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7171 | debug_level=1" \ |
| 7172 | 0 \ |
| 7173 | -C "DHM prime too short:" |
| 7174 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7176 | run_test "DHM size: server default, client 2048, OK" \ |
| 7177 | "$P_SRV" \ |
| 7178 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7179 | debug_level=1 dhmlen=2048" \ |
| 7180 | 0 \ |
| 7181 | -C "DHM prime too short:" |
| 7182 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7184 | run_test "DHM size: server 1024, client default, OK" \ |
| 7185 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7186 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7187 | debug_level=1" \ |
| 7188 | 0 \ |
| 7189 | -C "DHM prime too short:" |
| 7190 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7192 | run_test "DHM size: server 999, client 999, OK" \ |
| 7193 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7194 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7195 | debug_level=1 dhmlen=999" \ |
| 7196 | 0 \ |
| 7197 | -C "DHM prime too short:" |
| 7198 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7200 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 7201 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7202 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7203 | debug_level=1 dhmlen=1000" \ |
| 7204 | 0 \ |
| 7205 | -C "DHM prime too short:" |
| 7206 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7208 | run_test "DHM size: server 1000, client default, rejected" \ |
| 7209 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7210 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7211 | debug_level=1" \ |
| 7212 | 1 \ |
| 7213 | -c "DHM prime too short:" |
| 7214 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7216 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7217 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7218 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7219 | debug_level=1 dhmlen=1001" \ |
| 7220 | 1 \ |
| 7221 | -c "DHM prime too short:" |
| 7222 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7224 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7225 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7226 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7227 | debug_level=1 dhmlen=1000" \ |
| 7228 | 1 \ |
| 7229 | -c "DHM prime too short:" |
| 7230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7232 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7233 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7234 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7235 | debug_level=1 dhmlen=999" \ |
| 7236 | 1 \ |
| 7237 | -c "DHM prime too short:" |
| 7238 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7240 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7241 | "$P_SRV" \ |
| 7242 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7243 | debug_level=1 dhmlen=2049" \ |
| 7244 | 1 \ |
| 7245 | -c "DHM prime too short:" |
| 7246 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7247 | # Tests for PSK callback |
| 7248 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7249 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7250 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7251 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7252 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7253 | psk_identity=foo psk=abc123" \ |
| 7254 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7255 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7256 | -S "SSL - Unknown identity received" \ |
| 7257 | -S "SSL - Verification of the message MAC failed" |
| 7258 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7259 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7261 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7262 | "$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] | 7263 | "$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] | 7264 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7265 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7266 | -C "session hash for extended master secret"\ |
| 7267 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7268 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7269 | -S "SSL - Unknown identity received" \ |
| 7270 | -S "SSL - Verification of the message MAC failed" |
| 7271 | |
| 7272 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7274 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7275 | "$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] | 7276 | "$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] | 7277 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7278 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7279 | -C "session hash for extended master secret"\ |
| 7280 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7281 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7282 | -S "SSL - Unknown identity received" \ |
| 7283 | -S "SSL - Verification of the message MAC failed" |
| 7284 | |
| 7285 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7287 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7288 | "$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] | 7289 | "$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] | 7290 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7291 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7292 | -c "session hash for extended master secret"\ |
| 7293 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7294 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7295 | -S "SSL - Unknown identity received" \ |
| 7296 | -S "SSL - Verification of the message MAC failed" |
| 7297 | |
| 7298 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7300 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7301 | "$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] | 7302 | "$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] | 7303 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7304 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7305 | -c "session hash for extended master secret"\ |
| 7306 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7307 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7308 | -S "SSL - Unknown identity received" \ |
| 7309 | -S "SSL - Verification of the message MAC failed" |
| 7310 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7311 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7313 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7314 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7315 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7316 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7317 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7318 | -C "session hash for extended master secret"\ |
| 7319 | -S "session hash for extended master secret"\ |
| 7320 | -S "SSL - The handshake negotiation failed" \ |
| 7321 | -S "SSL - Unknown identity received" \ |
| 7322 | -S "SSL - Verification of the message MAC failed" |
| 7323 | |
| 7324 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7326 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7327 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7328 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7329 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7330 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7331 | -C "session hash for extended master secret"\ |
| 7332 | -S "session hash for extended master secret"\ |
| 7333 | -S "SSL - The handshake negotiation failed" \ |
| 7334 | -S "SSL - Unknown identity received" \ |
| 7335 | -S "SSL - Verification of the message MAC failed" |
| 7336 | |
| 7337 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7339 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7340 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7341 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7342 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7343 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7344 | -c "session hash for extended master secret"\ |
| 7345 | -s "session hash for extended master secret"\ |
| 7346 | -S "SSL - The handshake negotiation failed" \ |
| 7347 | -S "SSL - Unknown identity received" \ |
| 7348 | -S "SSL - Verification of the message MAC failed" |
| 7349 | |
| 7350 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7352 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7353 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7354 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7355 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7356 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7357 | -c "session hash for extended master secret"\ |
| 7358 | -s "session hash for extended master secret"\ |
| 7359 | -S "SSL - The handshake negotiation failed" \ |
| 7360 | -S "SSL - Unknown identity received" \ |
| 7361 | -S "SSL - Verification of the message MAC failed" |
| 7362 | |
| 7363 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7365 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7366 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7367 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7368 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7369 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7370 | -C "session hash for extended master secret"\ |
| 7371 | -S "session hash for extended master secret"\ |
| 7372 | -S "SSL - The handshake negotiation failed" \ |
| 7373 | -S "SSL - Unknown identity received" \ |
| 7374 | -S "SSL - Verification of the message MAC failed" |
| 7375 | |
| 7376 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7378 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7379 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7380 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7381 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7382 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7383 | -C "session hash for extended master secret"\ |
| 7384 | -S "session hash for extended master secret"\ |
| 7385 | -S "SSL - The handshake negotiation failed" \ |
| 7386 | -S "SSL - Unknown identity received" \ |
| 7387 | -S "SSL - Verification of the message MAC failed" |
| 7388 | |
| 7389 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7391 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7392 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7393 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7394 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7395 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7396 | -c "session hash for extended master secret"\ |
| 7397 | -s "session hash for extended master secret"\ |
| 7398 | -S "SSL - The handshake negotiation failed" \ |
| 7399 | -S "SSL - Unknown identity received" \ |
| 7400 | -S "SSL - Verification of the message MAC failed" |
| 7401 | |
| 7402 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7404 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7405 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7406 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7407 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7408 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7409 | -c "session hash for extended master secret"\ |
| 7410 | -s "session hash for extended master secret"\ |
| 7411 | -S "SSL - The handshake negotiation failed" \ |
| 7412 | -S "SSL - Unknown identity received" \ |
| 7413 | -S "SSL - Verification of the message MAC failed" |
| 7414 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7415 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7417 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7418 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7419 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7420 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7421 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7422 | -C "session hash for extended master secret"\ |
| 7423 | -S "session hash for extended master secret"\ |
| 7424 | -S "SSL - The handshake negotiation failed" \ |
| 7425 | -S "SSL - Unknown identity received" \ |
| 7426 | -S "SSL - Verification of the message MAC failed" |
| 7427 | |
| 7428 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7430 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7431 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7432 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7433 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7434 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7435 | -C "session hash for extended master secret"\ |
| 7436 | -S "session hash for extended master secret"\ |
| 7437 | -S "SSL - The handshake negotiation failed" \ |
| 7438 | -S "SSL - Unknown identity received" \ |
| 7439 | -S "SSL - Verification of the message MAC failed" |
| 7440 | |
| 7441 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7443 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7444 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7445 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7446 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7447 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7448 | -c "session hash for extended master secret"\ |
| 7449 | -s "session hash for extended master secret"\ |
| 7450 | -S "SSL - The handshake negotiation failed" \ |
| 7451 | -S "SSL - Unknown identity received" \ |
| 7452 | -S "SSL - Verification of the message MAC failed" |
| 7453 | |
| 7454 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7456 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7457 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7458 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7459 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7460 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7461 | -c "session hash for extended master secret"\ |
| 7462 | -s "session hash for extended master secret"\ |
| 7463 | -S "SSL - The handshake negotiation failed" \ |
| 7464 | -S "SSL - Unknown identity received" \ |
| 7465 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7466 | |
| 7467 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7469 | 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] | 7470 | "$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" \ |
| 7471 | "$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] | 7472 | psk_identity=foo psk=abc123" \ |
| 7473 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7474 | -C "session hash for extended master secret"\ |
| 7475 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7476 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7477 | -S "SSL - Unknown identity received" \ |
| 7478 | -S "SSL - Verification of the message MAC failed" |
| 7479 | |
| 7480 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7482 | 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] | 7483 | "$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" \ |
| 7484 | "$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] | 7485 | psk_identity=foo psk=abc123" \ |
| 7486 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7487 | -C "session hash for extended master secret"\ |
| 7488 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7489 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7490 | -S "SSL - Unknown identity received" \ |
| 7491 | -S "SSL - Verification of the message MAC failed" |
| 7492 | |
| 7493 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7495 | 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] | 7496 | "$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] | 7497 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7498 | "$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] | 7499 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7500 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7501 | -c "session hash for extended master secret"\ |
| 7502 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7503 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7504 | -S "SSL - Unknown identity received" \ |
| 7505 | -S "SSL - Verification of the message MAC failed" |
| 7506 | |
| 7507 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7509 | 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] | 7510 | "$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] | 7511 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7512 | "$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] | 7513 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7514 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7515 | -c "session hash for extended master secret"\ |
| 7516 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7517 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7518 | -S "SSL - Unknown identity received" \ |
| 7519 | -S "SSL - Verification of the message MAC failed" |
| 7520 | |
| 7521 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7523 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7524 | "$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" \ |
| 7525 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7526 | psk_identity=foo psk=abc123" \ |
| 7527 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7528 | -C "session hash for extended master secret"\ |
| 7529 | -S "session hash for extended master secret"\ |
| 7530 | -S "SSL - The handshake negotiation failed" \ |
| 7531 | -S "SSL - Unknown identity received" \ |
| 7532 | -S "SSL - Verification of the message MAC failed" |
| 7533 | |
| 7534 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7536 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7537 | "$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" \ |
| 7538 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7539 | psk_identity=foo psk=abc123" \ |
| 7540 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7541 | -C "session hash for extended master secret"\ |
| 7542 | -S "session hash for extended master secret"\ |
| 7543 | -S "SSL - The handshake negotiation failed" \ |
| 7544 | -S "SSL - Unknown identity received" \ |
| 7545 | -S "SSL - Verification of the message MAC failed" |
| 7546 | |
| 7547 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7549 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7550 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7551 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7552 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7553 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7554 | 0 \ |
| 7555 | -c "session hash for extended master secret"\ |
| 7556 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7557 | -S "SSL - The handshake negotiation failed" \ |
| 7558 | -S "SSL - Unknown identity received" \ |
| 7559 | -S "SSL - Verification of the message MAC failed" |
| 7560 | |
| 7561 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7563 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7564 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7565 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7566 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7567 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7568 | 0 \ |
| 7569 | -c "session hash for extended master secret"\ |
| 7570 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7571 | -S "SSL - The handshake negotiation failed" \ |
| 7572 | -S "SSL - Unknown identity received" \ |
| 7573 | -S "SSL - Verification of the message MAC failed" |
| 7574 | |
| 7575 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7577 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7578 | "$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" \ |
| 7579 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7580 | psk_identity=foo psk=abc123" \ |
| 7581 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7582 | -C "session hash for extended master secret"\ |
| 7583 | -S "session hash for extended master secret"\ |
| 7584 | -S "SSL - The handshake negotiation failed" \ |
| 7585 | -S "SSL - Unknown identity received" \ |
| 7586 | -S "SSL - Verification of the message MAC failed" |
| 7587 | |
| 7588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7590 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7591 | "$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" \ |
| 7592 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7593 | psk_identity=foo psk=abc123" \ |
| 7594 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7595 | -C "session hash for extended master secret"\ |
| 7596 | -S "session hash for extended master secret"\ |
| 7597 | -S "SSL - The handshake negotiation failed" \ |
| 7598 | -S "SSL - Unknown identity received" \ |
| 7599 | -S "SSL - Verification of the message MAC failed" |
| 7600 | |
| 7601 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7603 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7604 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7605 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7606 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7607 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7608 | 0 \ |
| 7609 | -c "session hash for extended master secret"\ |
| 7610 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7611 | -S "SSL - The handshake negotiation failed" \ |
| 7612 | -S "SSL - Unknown identity received" \ |
| 7613 | -S "SSL - Verification of the message MAC failed" |
| 7614 | |
| 7615 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7617 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7618 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7619 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7620 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7621 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7622 | 0 \ |
| 7623 | -c "session hash for extended master secret"\ |
| 7624 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7625 | -S "SSL - The handshake negotiation failed" \ |
| 7626 | -S "SSL - Unknown identity received" \ |
| 7627 | -S "SSL - Verification of the message MAC failed" |
| 7628 | |
| 7629 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7631 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7632 | "$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" \ |
| 7633 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7634 | psk_identity=foo psk=abc123" \ |
| 7635 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7636 | -C "session hash for extended master secret"\ |
| 7637 | -S "session hash for extended master secret"\ |
| 7638 | -S "SSL - The handshake negotiation failed" \ |
| 7639 | -S "SSL - Unknown identity received" \ |
| 7640 | -S "SSL - Verification of the message MAC failed" |
| 7641 | |
| 7642 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7644 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7645 | "$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" \ |
| 7646 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7647 | psk_identity=foo psk=abc123" \ |
| 7648 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7649 | -C "session hash for extended master secret"\ |
| 7650 | -S "session hash for extended master secret"\ |
| 7651 | -S "SSL - The handshake negotiation failed" \ |
| 7652 | -S "SSL - Unknown identity received" \ |
| 7653 | -S "SSL - Verification of the message MAC failed" |
| 7654 | |
| 7655 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7657 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7658 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7659 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7660 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7661 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7662 | 0 \ |
| 7663 | -c "session hash for extended master secret"\ |
| 7664 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7665 | -S "SSL - The handshake negotiation failed" \ |
| 7666 | -S "SSL - Unknown identity received" \ |
| 7667 | -S "SSL - Verification of the message MAC failed" |
| 7668 | |
| 7669 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7671 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7672 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7673 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7674 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7675 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7676 | 0 \ |
| 7677 | -c "session hash for extended master secret"\ |
| 7678 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7679 | -S "SSL - The handshake negotiation failed" \ |
| 7680 | -S "SSL - Unknown identity received" \ |
| 7681 | -S "SSL - Verification of the message MAC failed" |
| 7682 | |
| 7683 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7685 | 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] | 7686 | "$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" \ |
| 7687 | "$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] | 7688 | psk_identity=def psk=beef" \ |
| 7689 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7690 | -C "session hash for extended master secret"\ |
| 7691 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7692 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7693 | -S "SSL - Unknown identity received" \ |
| 7694 | -S "SSL - Verification of the message MAC failed" |
| 7695 | |
| 7696 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7698 | 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] | 7699 | "$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" \ |
| 7700 | "$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] | 7701 | psk_identity=def psk=beef" \ |
| 7702 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7703 | -C "session hash for extended master secret"\ |
| 7704 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7705 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7706 | -S "SSL - Unknown identity received" \ |
| 7707 | -S "SSL - Verification of the message MAC failed" |
| 7708 | |
| 7709 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7711 | 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] | 7712 | "$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] | 7713 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7714 | "$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] | 7715 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7716 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7717 | -c "session hash for extended master secret"\ |
| 7718 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7719 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7720 | -S "SSL - Unknown identity received" \ |
| 7721 | -S "SSL - Verification of the message MAC failed" |
| 7722 | |
| 7723 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7725 | 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] | 7726 | "$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] | 7727 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7728 | "$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] | 7729 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7730 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7731 | -c "session hash for extended master secret"\ |
| 7732 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7733 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7734 | -S "SSL - Unknown identity received" \ |
| 7735 | -S "SSL - Verification of the message MAC failed" |
| 7736 | |
| 7737 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7739 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7740 | "$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" \ |
| 7741 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7742 | psk_identity=def psk=beef" \ |
| 7743 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7744 | -C "session hash for extended master secret"\ |
| 7745 | -S "session hash for extended master secret"\ |
| 7746 | -S "SSL - The handshake negotiation failed" \ |
| 7747 | -S "SSL - Unknown identity received" \ |
| 7748 | -S "SSL - Verification of the message MAC failed" |
| 7749 | |
| 7750 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7752 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7753 | "$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" \ |
| 7754 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7755 | psk_identity=def psk=beef" \ |
| 7756 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7757 | -C "session hash for extended master secret"\ |
| 7758 | -S "session hash for extended master secret"\ |
| 7759 | -S "SSL - The handshake negotiation failed" \ |
| 7760 | -S "SSL - Unknown identity received" \ |
| 7761 | -S "SSL - Verification of the message MAC failed" |
| 7762 | |
| 7763 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7765 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7766 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7767 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7768 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7769 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7770 | 0 \ |
| 7771 | -c "session hash for extended master secret"\ |
| 7772 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7773 | -S "SSL - The handshake negotiation failed" \ |
| 7774 | -S "SSL - Unknown identity received" \ |
| 7775 | -S "SSL - Verification of the message MAC failed" |
| 7776 | |
| 7777 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7779 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7780 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7781 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7782 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7783 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7784 | 0 \ |
| 7785 | -c "session hash for extended master secret"\ |
| 7786 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7787 | -S "SSL - The handshake negotiation failed" \ |
| 7788 | -S "SSL - Unknown identity received" \ |
| 7789 | -S "SSL - Verification of the message MAC failed" |
| 7790 | |
| 7791 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7793 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7794 | "$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" \ |
| 7795 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7796 | psk_identity=def psk=beef" \ |
| 7797 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7798 | -C "session hash for extended master secret"\ |
| 7799 | -S "session hash for extended master secret"\ |
| 7800 | -S "SSL - The handshake negotiation failed" \ |
| 7801 | -S "SSL - Unknown identity received" \ |
| 7802 | -S "SSL - Verification of the message MAC failed" |
| 7803 | |
| 7804 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7806 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7807 | "$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" \ |
| 7808 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7809 | psk_identity=def psk=beef" \ |
| 7810 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7811 | -C "session hash for extended master secret"\ |
| 7812 | -S "session hash for extended master secret"\ |
| 7813 | -S "SSL - The handshake negotiation failed" \ |
| 7814 | -S "SSL - Unknown identity received" \ |
| 7815 | -S "SSL - Verification of the message MAC failed" |
| 7816 | |
| 7817 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7819 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7820 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7821 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7822 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7823 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7824 | 0 \ |
| 7825 | -c "session hash for extended master secret"\ |
| 7826 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7827 | -S "SSL - The handshake negotiation failed" \ |
| 7828 | -S "SSL - Unknown identity received" \ |
| 7829 | -S "SSL - Verification of the message MAC failed" |
| 7830 | |
| 7831 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7833 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7834 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7835 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7836 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7837 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7838 | 0 \ |
| 7839 | -c "session hash for extended master secret"\ |
| 7840 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7841 | -S "SSL - The handshake negotiation failed" \ |
| 7842 | -S "SSL - Unknown identity received" \ |
| 7843 | -S "SSL - Verification of the message MAC failed" |
| 7844 | |
| 7845 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7847 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7848 | "$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" \ |
| 7849 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7850 | psk_identity=def psk=beef" \ |
| 7851 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7852 | -C "session hash for extended master secret"\ |
| 7853 | -S "session hash for extended master secret"\ |
| 7854 | -S "SSL - The handshake negotiation failed" \ |
| 7855 | -S "SSL - Unknown identity received" \ |
| 7856 | -S "SSL - Verification of the message MAC failed" |
| 7857 | |
| 7858 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7860 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7861 | "$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" \ |
| 7862 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7863 | psk_identity=def psk=beef" \ |
| 7864 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7865 | -C "session hash for extended master secret"\ |
| 7866 | -S "session hash for extended master secret"\ |
| 7867 | -S "SSL - The handshake negotiation failed" \ |
| 7868 | -S "SSL - Unknown identity received" \ |
| 7869 | -S "SSL - Verification of the message MAC failed" |
| 7870 | |
| 7871 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7873 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7874 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7875 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7876 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7877 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7878 | 0 \ |
| 7879 | -c "session hash for extended master secret"\ |
| 7880 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7881 | -S "SSL - The handshake negotiation failed" \ |
| 7882 | -S "SSL - Unknown identity received" \ |
| 7883 | -S "SSL - Verification of the message MAC failed" |
| 7884 | |
| 7885 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7887 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7888 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7889 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7890 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7891 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7892 | 0 \ |
| 7893 | -c "session hash for extended master secret"\ |
| 7894 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7895 | -S "SSL - The handshake negotiation failed" \ |
| 7896 | -S "SSL - Unknown identity received" \ |
| 7897 | -S "SSL - Verification of the message MAC failed" |
| 7898 | |
| 7899 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7901 | 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] | 7902 | "$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" \ |
| 7903 | "$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] | 7904 | psk_identity=def psk=beef" \ |
| 7905 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7906 | -C "session hash for extended master secret"\ |
| 7907 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7908 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7909 | -S "SSL - Unknown identity received" \ |
| 7910 | -S "SSL - Verification of the message MAC failed" |
| 7911 | |
| 7912 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7914 | 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] | 7915 | "$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" \ |
| 7916 | "$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] | 7917 | psk_identity=def psk=beef" \ |
| 7918 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7919 | -C "session hash for extended master secret"\ |
| 7920 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7921 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7922 | -S "SSL - Unknown identity received" \ |
| 7923 | -S "SSL - Verification of the message MAC failed" |
| 7924 | |
| 7925 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7927 | 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] | 7928 | "$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" \ |
| 7929 | "$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] | 7930 | psk_identity=def psk=beef" \ |
| 7931 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7932 | -C "session hash for extended master secret"\ |
| 7933 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7934 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7935 | -S "SSL - Unknown identity received" \ |
| 7936 | -S "SSL - Verification of the message MAC failed" |
| 7937 | |
| 7938 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7940 | 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] | 7941 | "$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" \ |
| 7942 | "$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] | 7943 | psk_identity=def psk=beef" \ |
| 7944 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7945 | -C "session hash for extended master secret"\ |
| 7946 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7947 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7948 | -S "SSL - Unknown identity received" \ |
| 7949 | -S "SSL - Verification of the message MAC failed" |
| 7950 | |
| 7951 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7953 | 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] | 7954 | "$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" \ |
| 7955 | "$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] | 7956 | psk_identity=def psk=beef" \ |
| 7957 | 1 \ |
| 7958 | -s "SSL - Verification of the message MAC failed" |
| 7959 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7961 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7962 | "$P_SRV" \ |
| 7963 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7964 | psk_identity=foo psk=abc123" \ |
| 7965 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7966 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7967 | -S "SSL - Unknown identity received" \ |
| 7968 | -S "SSL - Verification of the message MAC failed" |
| 7969 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7971 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7972 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7973 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7974 | psk_identity=foo psk=abc123" \ |
| 7975 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7976 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7977 | -s "SSL - Unknown identity received" \ |
| 7978 | -S "SSL - Verification of the message MAC failed" |
| 7979 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7981 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7982 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7983 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7984 | psk_identity=abc psk=dead" \ |
| 7985 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7986 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7987 | -S "SSL - Unknown identity received" \ |
| 7988 | -S "SSL - Verification of the message MAC failed" |
| 7989 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7991 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7992 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7993 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7994 | psk_identity=def psk=beef" \ |
| 7995 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7996 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7997 | -S "SSL - Unknown identity received" \ |
| 7998 | -S "SSL - Verification of the message MAC failed" |
| 7999 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8000 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8001 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8002 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8003 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8004 | psk_identity=ghi psk=beef" \ |
| 8005 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8006 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8007 | -s "SSL - Unknown identity received" \ |
| 8008 | -S "SSL - Verification of the message MAC failed" |
| 8009 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8011 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8012 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8013 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8014 | psk_identity=abc psk=beef" \ |
| 8015 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8016 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8017 | -S "SSL - Unknown identity received" \ |
| 8018 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8019 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8020 | # Tests for EC J-PAKE |
| 8021 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8022 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8024 | run_test "ECJPAKE: client not configured" \ |
| 8025 | "$P_SRV debug_level=3" \ |
| 8026 | "$P_CLI debug_level=3" \ |
| 8027 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 8028 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8029 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8030 | -S "found ecjpake kkpp extension" \ |
| 8031 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8032 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8033 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8034 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8035 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8036 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8037 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8038 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8039 | run_test "ECJPAKE: server not configured" \ |
| 8040 | "$P_SRV debug_level=3" \ |
| 8041 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8042 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8043 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8044 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8045 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8046 | -s "found ecjpake kkpp extension" \ |
| 8047 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8048 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8049 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8050 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8051 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8052 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8053 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8054 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8055 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8057 | run_test "ECJPAKE: working, TLS" \ |
| 8058 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8059 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8060 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 8061 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8062 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8063 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8064 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8065 | -s "found ecjpake kkpp extension" \ |
| 8066 | -S "skip ecjpake kkpp extension" \ |
| 8067 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8068 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8069 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8070 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8071 | -S "SSL - Verification of the message MAC failed" |
| 8072 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8073 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 8074 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8076 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8077 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8078 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8079 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8080 | 0 \ |
| 8081 | -c "add ciphersuite: c0ff" \ |
| 8082 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 8083 | -c "using opaque password" \ |
| 8084 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8085 | -C "re-using cached ecjpake parameters" \ |
| 8086 | -s "found ecjpake kkpp extension" \ |
| 8087 | -S "skip ecjpake kkpp extension" \ |
| 8088 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8089 | -s "server hello, ecjpake kkpp extension" \ |
| 8090 | -c "found ecjpake_kkpp extension" \ |
| 8091 | -S "SSL - The handshake negotiation failed" \ |
| 8092 | -S "SSL - Verification of the message MAC failed" |
| 8093 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8094 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8095 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8096 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8097 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8099 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8100 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8101 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8102 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8103 | 0 \ |
| 8104 | -c "add ciphersuite: c0ff" \ |
| 8105 | -c "adding ecjpake_kkpp extension" \ |
| 8106 | -c "using opaque password" \ |
| 8107 | -S "using opaque password" \ |
| 8108 | -C "re-using cached ecjpake parameters" \ |
| 8109 | -s "found ecjpake kkpp extension" \ |
| 8110 | -S "skip ecjpake kkpp extension" \ |
| 8111 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8112 | -s "server hello, ecjpake kkpp extension" \ |
| 8113 | -c "found ecjpake_kkpp extension" \ |
| 8114 | -S "SSL - The handshake negotiation failed" \ |
| 8115 | -S "SSL - Verification of the message MAC failed" |
| 8116 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8117 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8118 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8119 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8120 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8122 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8123 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8124 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 8125 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8126 | 0 \ |
| 8127 | -c "add ciphersuite: c0ff" \ |
| 8128 | -c "adding ecjpake_kkpp extension" \ |
| 8129 | -C "using opaque password" \ |
| 8130 | -s "using opaque password" \ |
| 8131 | -C "re-using cached ecjpake parameters" \ |
| 8132 | -s "found ecjpake kkpp extension" \ |
| 8133 | -S "skip ecjpake kkpp extension" \ |
| 8134 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8135 | -s "server hello, ecjpake kkpp extension" \ |
| 8136 | -c "found ecjpake_kkpp extension" \ |
| 8137 | -S "SSL - The handshake negotiation failed" \ |
| 8138 | -S "SSL - Verification of the message MAC failed" |
| 8139 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8140 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8141 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8143 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 8144 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8145 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 8146 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8147 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8148 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8149 | -s "SSL - Verification of the message MAC failed" |
| 8150 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8151 | server_needs_more_time 1 |
| 8152 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8153 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8155 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 8156 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8157 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 8158 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8159 | 1 \ |
| 8160 | -c "using opaque password" \ |
| 8161 | -s "using opaque password" \ |
| 8162 | -C "re-using cached ecjpake parameters" \ |
| 8163 | -s "SSL - Verification of the message MAC failed" |
| 8164 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8165 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8167 | run_test "ECJPAKE: working, DTLS" \ |
| 8168 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8169 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8170 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8171 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8172 | -c "re-using cached ecjpake parameters" \ |
| 8173 | -S "SSL - Verification of the message MAC failed" |
| 8174 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8175 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8177 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 8178 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 8179 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8180 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8181 | 0 \ |
| 8182 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8183 | -S "SSL - Verification of the message MAC failed" |
| 8184 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8185 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8186 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8188 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 8189 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8190 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 8191 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8192 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8193 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8194 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8195 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8196 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8197 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8199 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8200 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8201 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8202 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8203 | 0 |
| 8204 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8205 | # Test for ClientHello without extensions |
| 8206 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8207 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8209 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 8210 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8211 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8212 | 0 \ |
| 8213 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8214 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8215 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8216 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8217 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8219 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8220 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8221 | "$P_CLI request_size=100" \ |
| 8222 | 0 \ |
| 8223 | -s "Read from client: 100 bytes read$" |
| 8224 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8226 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8227 | "$P_SRV buffer_size=100" \ |
| 8228 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8229 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8230 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8231 | |
| 8232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8233 | requires_max_content_len 200 |
| 8234 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8235 | "$P_SRV buffer_size=100" \ |
| 8236 | "$P_CLI request_size=200" \ |
| 8237 | 0 \ |
| 8238 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8239 | |
| 8240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8241 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 8242 | "$P_SRV buffer_size=100" \ |
| 8243 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8244 | 0 \ |
| 8245 | -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] | 8246 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8247 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8248 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8249 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8250 | "$P_SRV force_version=tls12" \ |
| 8251 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8252 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8253 | 0 \ |
| 8254 | -s "Read from client: 1 bytes read" |
| 8255 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8256 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8257 | "$P_SRV force_version=tls12" \ |
| 8258 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8259 | 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] | 8260 | 0 \ |
| 8261 | -s "Read from client: 1 bytes read" |
| 8262 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8263 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8264 | "$P_SRV force_version=tls12" \ |
| 8265 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8266 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8267 | 0 \ |
| 8268 | -s "Read from client: 1 bytes read" |
| 8269 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8270 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8271 | "$P_SRV force_version=tls12" \ |
| 8272 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8273 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8274 | 0 \ |
| 8275 | -s "Read from client: 1 bytes read" |
| 8276 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8277 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8278 | "$P_SRV force_version=tls12" \ |
| 8279 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8280 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8281 | 0 \ |
| 8282 | -s "Read from client: 1 bytes read" |
| 8283 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8284 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8285 | run_test "Small client packet TLS 1.3 AEAD" \ |
| 8286 | "$P_SRV force_version=tls13" \ |
| 8287 | "$P_CLI request_size=1 \ |
| 8288 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8289 | 0 \ |
| 8290 | -s "Read from client: 1 bytes read" |
| 8291 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8292 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8293 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
| 8294 | "$P_SRV force_version=tls13" \ |
| 8295 | "$P_CLI request_size=1 \ |
| 8296 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8297 | 0 \ |
| 8298 | -s "Read from client: 1 bytes read" |
| 8299 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8300 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8301 | |
| 8302 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8303 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8304 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8305 | "$P_CLI dtls=1 request_size=1 \ |
| 8306 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8307 | 0 \ |
| 8308 | -s "Read from client: 1 bytes read" |
| 8309 | |
| 8310 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8311 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8312 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8313 | "$P_CLI dtls=1 request_size=1 \ |
| 8314 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8315 | 0 \ |
| 8316 | -s "Read from client: 1 bytes read" |
| 8317 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8318 | # Tests for small server packets |
| 8319 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8320 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8321 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8322 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8323 | 0 \ |
| 8324 | -c "Read from server: 1 bytes read" |
| 8325 | |
| 8326 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8327 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8328 | "$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] | 8329 | 0 \ |
| 8330 | -c "Read from server: 1 bytes read" |
| 8331 | |
| 8332 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8333 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8334 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8335 | 0 \ |
| 8336 | -c "Read from server: 1 bytes read" |
| 8337 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8338 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8339 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8340 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8341 | 0 \ |
| 8342 | -c "Read from server: 1 bytes read" |
| 8343 | |
| 8344 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8345 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8346 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8347 | 0 \ |
| 8348 | -c "Read from server: 1 bytes read" |
| 8349 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8350 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8351 | run_test "Small server packet TLS 1.3 AEAD" \ |
| 8352 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8353 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8354 | 0 \ |
| 8355 | -c "Read from server: 1 bytes read" |
| 8356 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8357 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8358 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
| 8359 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8360 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8361 | 0 \ |
| 8362 | -c "Read from server: 1 bytes read" |
| 8363 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8364 | # Tests for small server packets in DTLS |
| 8365 | |
| 8366 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8367 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8368 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8369 | "$P_CLI dtls=1 \ |
| 8370 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8371 | 0 \ |
| 8372 | -c "Read from server: 1 bytes read" |
| 8373 | |
| 8374 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8375 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8376 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8377 | "$P_CLI dtls=1 \ |
| 8378 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8379 | 0 \ |
| 8380 | -c "Read from server: 1 bytes read" |
| 8381 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8382 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8383 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8384 | # How many fragments do we expect to write $1 bytes? |
| 8385 | fragments_for_write() { |
| 8386 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8387 | } |
| 8388 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8389 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8390 | "$P_SRV force_version=tls12" \ |
| 8391 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8392 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8393 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8394 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8395 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8396 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8397 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8398 | "$P_SRV force_version=tls12" \ |
| 8399 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8400 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8401 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8402 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8403 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8404 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8405 | "$P_SRV force_version=tls12" \ |
| 8406 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8407 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8408 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8409 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8410 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8411 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8412 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8413 | "$P_SRV force_version=tls12" \ |
| 8414 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8415 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8416 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8417 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8418 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8419 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8420 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8421 | "$P_SRV force_version=tls12" \ |
| 8422 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8423 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8424 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8425 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8426 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8427 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8428 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8429 | run_test "Large client packet TLS 1.3 AEAD" \ |
| 8430 | "$P_SRV force_version=tls13" \ |
| 8431 | "$P_CLI request_size=16384 \ |
| 8432 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8433 | 0 \ |
| 8434 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8435 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8436 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8437 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8438 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
| 8439 | "$P_SRV force_version=tls13" \ |
| 8440 | "$P_CLI request_size=16384 \ |
| 8441 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8442 | 0 \ |
| 8443 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8444 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8445 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8446 | # 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] | 8447 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8448 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8449 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8450 | 0 \ |
| 8451 | -c "Read from server: 16384 bytes read" |
| 8452 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8453 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8454 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8455 | "$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] | 8456 | 0 \ |
| 8457 | -s "16384 bytes written in 1 fragments" \ |
| 8458 | -c "Read from server: 16384 bytes read" |
| 8459 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8460 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8461 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8462 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8463 | 0 \ |
| 8464 | -c "Read from server: 16384 bytes read" |
| 8465 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8466 | 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] | 8467 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8468 | "$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] | 8469 | 0 \ |
| 8470 | -s "16384 bytes written in 1 fragments" \ |
| 8471 | -c "Read from server: 16384 bytes read" |
| 8472 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8473 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8474 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8475 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8476 | 0 \ |
| 8477 | -c "Read from server: 16384 bytes read" |
| 8478 | |
| 8479 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8480 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8481 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8482 | 0 \ |
| 8483 | -c "Read from server: 16384 bytes read" |
| 8484 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8485 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8486 | run_test "Large server packet TLS 1.3 AEAD" \ |
| 8487 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8488 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8489 | 0 \ |
| 8490 | -c "Read from server: 16384 bytes read" |
| 8491 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8492 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8493 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
| 8494 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8495 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8496 | 0 \ |
| 8497 | -c "Read from server: 16384 bytes read" |
| 8498 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8499 | # Tests for restartable ECC |
| 8500 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8501 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8502 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8503 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8504 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8506 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8507 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8508 | "$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] | 8509 | 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] | 8510 | debug_level=1" \ |
| 8511 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8512 | -C "x509_verify_cert.*4b00" \ |
| 8513 | -C "mbedtls_pk_verify.*4b00" \ |
| 8514 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8515 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8516 | |
| 8517 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8518 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8520 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8521 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8522 | "$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] | 8523 | 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] | 8524 | debug_level=1 ec_max_ops=0" \ |
| 8525 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8526 | -C "x509_verify_cert.*4b00" \ |
| 8527 | -C "mbedtls_pk_verify.*4b00" \ |
| 8528 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8529 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8530 | |
| 8531 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8532 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8534 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8535 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8536 | "$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] | 8537 | 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] | 8538 | debug_level=1 ec_max_ops=65535" \ |
| 8539 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8540 | -C "x509_verify_cert.*4b00" \ |
| 8541 | -C "mbedtls_pk_verify.*4b00" \ |
| 8542 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8543 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8544 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8545 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8546 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8547 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8549 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8550 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8551 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8552 | "$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] | 8553 | 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] | 8554 | debug_level=1 ec_max_ops=1000" \ |
| 8555 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8556 | -c "x509_verify_cert.*4b00" \ |
| 8557 | -c "mbedtls_pk_verify.*4b00" \ |
| 8558 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8559 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8560 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8561 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8562 | # everything except ECDH (where TLS calls PSA directly). |
| 8563 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8564 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8566 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8567 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
| 8568 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 8569 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8570 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8571 | debug_level=1 ec_max_ops=1000" \ |
| 8572 | 0 \ |
| 8573 | -c "x509_verify_cert.*4b00" \ |
| 8574 | -c "mbedtls_pk_verify.*4b00" \ |
| 8575 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8576 | -c "mbedtls_pk_sign.*4b00" |
| 8577 | |
| 8578 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 8579 | # we abort as soon as we determined the cert is bad. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8580 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8581 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8583 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8584 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8585 | crt_file=data_files/server5-badsign.crt \ |
| 8586 | key_file=data_files/server5.key" \ |
| 8587 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8588 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8589 | debug_level=1 ec_max_ops=1000" \ |
| 8590 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8591 | -c "x509_verify_cert.*4b00" \ |
| 8592 | -C "mbedtls_pk_verify.*4b00" \ |
| 8593 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8594 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8595 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8596 | -c "! mbedtls_ssl_handshake returned" \ |
| 8597 | -c "X509 - Certificate verification failed" |
| 8598 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8599 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8600 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8601 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8603 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8604 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8605 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8606 | crt_file=data_files/server5-badsign.crt \ |
| 8607 | key_file=data_files/server5.key" \ |
| 8608 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8609 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8610 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8611 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8612 | -c "x509_verify_cert.*4b00" \ |
| 8613 | -c "mbedtls_pk_verify.*4b00" \ |
| 8614 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8615 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8616 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8617 | -C "! mbedtls_ssl_handshake returned" \ |
| 8618 | -C "X509 - Certificate verification failed" |
| 8619 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8620 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8621 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8622 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8623 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8625 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8626 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (USE_PSA)" \ |
| 8627 | "$P_SRV curves=secp256r1 auth_mode=required \ |
| 8628 | crt_file=data_files/server5-badsign.crt \ |
| 8629 | key_file=data_files/server5.key" \ |
| 8630 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8631 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8632 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8633 | 0 \ |
| 8634 | -c "x509_verify_cert.*4b00" \ |
| 8635 | -c "mbedtls_pk_verify.*4b00" \ |
| 8636 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8637 | -c "mbedtls_pk_sign.*4b00" \ |
| 8638 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8639 | -C "! mbedtls_ssl_handshake returned" \ |
| 8640 | -C "X509 - Certificate verification failed" |
| 8641 | |
| 8642 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8643 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8644 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8646 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8647 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8648 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8649 | crt_file=data_files/server5-badsign.crt \ |
| 8650 | key_file=data_files/server5.key" \ |
| 8651 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8652 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8653 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8654 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8655 | -C "x509_verify_cert.*4b00" \ |
| 8656 | -c "mbedtls_pk_verify.*4b00" \ |
| 8657 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8658 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8659 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8660 | -C "! mbedtls_ssl_handshake returned" \ |
| 8661 | -C "X509 - Certificate verification failed" |
| 8662 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8663 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8664 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8665 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8666 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8668 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8669 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (USE_PSA)" \ |
| 8670 | "$P_SRV curves=secp256r1 auth_mode=required \ |
| 8671 | crt_file=data_files/server5-badsign.crt \ |
| 8672 | key_file=data_files/server5.key" \ |
| 8673 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8674 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8675 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8676 | 0 \ |
| 8677 | -C "x509_verify_cert.*4b00" \ |
| 8678 | -c "mbedtls_pk_verify.*4b00" \ |
| 8679 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8680 | -c "mbedtls_pk_sign.*4b00" \ |
| 8681 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8682 | -C "! mbedtls_ssl_handshake returned" \ |
| 8683 | -C "X509 - Certificate verification failed" |
| 8684 | |
| 8685 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8686 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8687 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8689 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8690 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8691 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8692 | "$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] | 8693 | 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] | 8694 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8695 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8696 | -c "x509_verify_cert.*4b00" \ |
| 8697 | -c "mbedtls_pk_verify.*4b00" \ |
| 8698 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8699 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8700 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8701 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8702 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8703 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8704 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8706 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8707 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
| 8708 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
| 8709 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8710 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8711 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8712 | 0 \ |
| 8713 | -c "x509_verify_cert.*4b00" \ |
| 8714 | -c "mbedtls_pk_verify.*4b00" \ |
| 8715 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8716 | -c "mbedtls_pk_sign.*4b00" |
| 8717 | |
| 8718 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8719 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8720 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8722 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8723 | run_test "EC restart: TLS, max_ops=1000 no client auth (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8724 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8725 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8726 | debug_level=1 ec_max_ops=1000" \ |
| 8727 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8728 | -c "x509_verify_cert.*4b00" \ |
| 8729 | -c "mbedtls_pk_verify.*4b00" \ |
| 8730 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8731 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8732 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8733 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8734 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8735 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8736 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8737 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8739 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8740 | run_test "EC restart: TLS, max_ops=1000 no client auth (USE_PSA)" \ |
| 8741 | "$P_SRV curves=secp256r1" \ |
| 8742 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8743 | debug_level=1 ec_max_ops=1000" \ |
| 8744 | 0 \ |
| 8745 | -c "x509_verify_cert.*4b00" \ |
| 8746 | -c "mbedtls_pk_verify.*4b00" \ |
| 8747 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8748 | -C "mbedtls_pk_sign.*4b00" |
| 8749 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8750 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 8751 | # restartable behaviour at all (not even client auth). |
| 8752 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 8753 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8754 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8755 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8757 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
| 8758 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 8759 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
| 8760 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8761 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8762 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8763 | -C "x509_verify_cert.*4b00" \ |
| 8764 | -C "mbedtls_pk_verify.*4b00" \ |
| 8765 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8766 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8767 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8768 | # Tests of asynchronous private key support in SSL |
| 8769 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8770 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8772 | run_test "SSL async private: sign, delay=0" \ |
| 8773 | "$P_SRV \ |
| 8774 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8775 | "$P_CLI" \ |
| 8776 | 0 \ |
| 8777 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8778 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8779 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8780 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8782 | run_test "SSL async private: sign, delay=1" \ |
| 8783 | "$P_SRV \ |
| 8784 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8785 | "$P_CLI" \ |
| 8786 | 0 \ |
| 8787 | -s "Async sign callback: using key slot " \ |
| 8788 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8789 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8790 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8791 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8793 | run_test "SSL async private: sign, delay=2" \ |
| 8794 | "$P_SRV \ |
| 8795 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8796 | "$P_CLI" \ |
| 8797 | 0 \ |
| 8798 | -s "Async sign callback: using key slot " \ |
| 8799 | -U "Async sign callback: using key slot " \ |
| 8800 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8801 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8802 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8803 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8804 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8805 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8807 | run_test "SSL async private: sign, SNI" \ |
| 8808 | "$P_SRV debug_level=3 \ |
| 8809 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8810 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8811 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8812 | "$P_CLI server_name=polarssl.example" \ |
| 8813 | 0 \ |
| 8814 | -s "Async sign callback: using key slot " \ |
| 8815 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8816 | -s "parse ServerName extension" \ |
| 8817 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8818 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8819 | |
| 8820 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8822 | run_test "SSL async private: decrypt, delay=0" \ |
| 8823 | "$P_SRV \ |
| 8824 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8825 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8826 | 0 \ |
| 8827 | -s "Async decrypt callback: using key slot " \ |
| 8828 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8829 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8830 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8832 | run_test "SSL async private: decrypt, delay=1" \ |
| 8833 | "$P_SRV \ |
| 8834 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8835 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8836 | 0 \ |
| 8837 | -s "Async decrypt callback: using key slot " \ |
| 8838 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8839 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8840 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8841 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8843 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8844 | "$P_SRV psk=abc123 \ |
| 8845 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8846 | "$P_CLI psk=abc123 \ |
| 8847 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8848 | 0 \ |
| 8849 | -s "Async decrypt callback: using key slot " \ |
| 8850 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8851 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8852 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8854 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8855 | "$P_SRV psk=abc123 \ |
| 8856 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8857 | "$P_CLI psk=abc123 \ |
| 8858 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8859 | 0 \ |
| 8860 | -s "Async decrypt callback: using key slot " \ |
| 8861 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8862 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8863 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8864 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8866 | run_test "SSL async private: sign callback not present" \ |
| 8867 | "$P_SRV \ |
| 8868 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8869 | "$P_CLI; [ \$? -eq 1 ] && |
| 8870 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8871 | 0 \ |
| 8872 | -S "Async sign callback" \ |
| 8873 | -s "! mbedtls_ssl_handshake returned" \ |
| 8874 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8875 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8876 | -s "Successful connection" |
| 8877 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8878 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8880 | run_test "SSL async private: decrypt callback not present" \ |
| 8881 | "$P_SRV debug_level=1 \ |
| 8882 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8883 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 8884 | [ \$? -eq 1 ] && $P_CLI" \ |
| 8885 | 0 \ |
| 8886 | -S "Async decrypt callback" \ |
| 8887 | -s "! mbedtls_ssl_handshake returned" \ |
| 8888 | -s "got no RSA private key" \ |
| 8889 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8890 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8891 | |
| 8892 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8893 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8895 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8896 | "$P_SRV \ |
| 8897 | async_operations=s async_private_delay1=1 \ |
| 8898 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8899 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8900 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8901 | 0 \ |
| 8902 | -s "Async sign callback: using key slot 0," \ |
| 8903 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8904 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8905 | |
| 8906 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8907 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8909 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8910 | "$P_SRV \ |
| 8911 | async_operations=s async_private_delay2=1 \ |
| 8912 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8913 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8914 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8915 | 0 \ |
| 8916 | -s "Async sign callback: using key slot 0," \ |
| 8917 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8918 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8919 | |
| 8920 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8921 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8923 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8924 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8925 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8926 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8927 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8928 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8929 | 0 \ |
| 8930 | -s "Async sign callback: using key slot 1," \ |
| 8931 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8932 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8933 | |
| 8934 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8935 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8937 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8938 | "$P_SRV \ |
| 8939 | async_operations=s async_private_delay1=1 \ |
| 8940 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8941 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8942 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8943 | 0 \ |
| 8944 | -s "Async sign callback: no key matches this certificate." |
| 8945 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8946 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8948 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8949 | "$P_SRV \ |
| 8950 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8951 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8952 | "$P_CLI" \ |
| 8953 | 1 \ |
| 8954 | -s "Async sign callback: injected error" \ |
| 8955 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8956 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8957 | -s "! mbedtls_ssl_handshake returned" |
| 8958 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8959 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8961 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8962 | "$P_SRV \ |
| 8963 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8964 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8965 | "$P_CLI" \ |
| 8966 | 1 \ |
| 8967 | -s "Async sign callback: using key slot " \ |
| 8968 | -S "Async resume" \ |
| 8969 | -s "Async cancel" |
| 8970 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8971 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8973 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8974 | "$P_SRV \ |
| 8975 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8976 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8977 | "$P_CLI" \ |
| 8978 | 1 \ |
| 8979 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8980 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8981 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8982 | -s "! mbedtls_ssl_handshake returned" |
| 8983 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8984 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8986 | run_test "SSL async private: decrypt, error in start" \ |
| 8987 | "$P_SRV \ |
| 8988 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8989 | async_private_error=1" \ |
| 8990 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8991 | 1 \ |
| 8992 | -s "Async decrypt callback: injected error" \ |
| 8993 | -S "Async resume" \ |
| 8994 | -S "Async cancel" \ |
| 8995 | -s "! mbedtls_ssl_handshake returned" |
| 8996 | |
| 8997 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8999 | run_test "SSL async private: decrypt, cancel after start" \ |
| 9000 | "$P_SRV \ |
| 9001 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9002 | async_private_error=2" \ |
| 9003 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9004 | 1 \ |
| 9005 | -s "Async decrypt callback: using key slot " \ |
| 9006 | -S "Async resume" \ |
| 9007 | -s "Async cancel" |
| 9008 | |
| 9009 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9011 | run_test "SSL async private: decrypt, error in resume" \ |
| 9012 | "$P_SRV \ |
| 9013 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9014 | async_private_error=3" \ |
| 9015 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9016 | 1 \ |
| 9017 | -s "Async decrypt callback: using key slot " \ |
| 9018 | -s "Async resume callback: decrypt done but injected error" \ |
| 9019 | -S "Async cancel" \ |
| 9020 | -s "! mbedtls_ssl_handshake returned" |
| 9021 | |
| 9022 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9024 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9025 | "$P_SRV \ |
| 9026 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9027 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9028 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9029 | 0 \ |
| 9030 | -s "Async cancel" \ |
| 9031 | -s "! mbedtls_ssl_handshake returned" \ |
| 9032 | -s "Async resume" \ |
| 9033 | -s "Successful connection" |
| 9034 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9035 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9037 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9038 | "$P_SRV \ |
| 9039 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9040 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9041 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9042 | 0 \ |
| 9043 | -s "! mbedtls_ssl_handshake returned" \ |
| 9044 | -s "Async resume" \ |
| 9045 | -s "Successful connection" |
| 9046 | |
| 9047 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9048 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9050 | 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] | 9051 | "$P_SRV \ |
| 9052 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 9053 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9054 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9055 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9056 | [ \$? -eq 1 ] && |
| 9057 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9058 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 9059 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9060 | -S "Async resume" \ |
| 9061 | -s "Async cancel" \ |
| 9062 | -s "! mbedtls_ssl_handshake returned" \ |
| 9063 | -s "Async sign callback: no key matches this certificate." \ |
| 9064 | -s "Successful connection" |
| 9065 | |
| 9066 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9067 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9069 | 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] | 9070 | "$P_SRV \ |
| 9071 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 9072 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9073 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9074 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9075 | [ \$? -eq 1 ] && |
| 9076 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9077 | 0 \ |
| 9078 | -s "Async resume" \ |
| 9079 | -s "! mbedtls_ssl_handshake returned" \ |
| 9080 | -s "Async sign callback: no key matches this certificate." \ |
| 9081 | -s "Successful connection" |
| 9082 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9083 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9084 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9086 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9087 | "$P_SRV \ |
| 9088 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9089 | exchanges=2 renegotiation=1" \ |
| 9090 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9091 | 0 \ |
| 9092 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9093 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9094 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9095 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9096 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9098 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9099 | "$P_SRV \ |
| 9100 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9101 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9102 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 9103 | 0 \ |
| 9104 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9105 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9106 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9107 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9108 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9110 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9111 | "$P_SRV \ |
| 9112 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9113 | exchanges=2 renegotiation=1" \ |
| 9114 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 9115 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9116 | 0 \ |
| 9117 | -s "Async decrypt callback: using key slot " \ |
| 9118 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9119 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9120 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9121 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9123 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9124 | "$P_SRV \ |
| 9125 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9126 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9127 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 9128 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9129 | 0 \ |
| 9130 | -s "Async decrypt callback: using key slot " \ |
| 9131 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9132 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9133 | # Tests for ECC extensions (rfc 4492) |
| 9134 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9135 | requires_config_enabled MBEDTLS_AES_C |
| 9136 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9137 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9138 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9140 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 9141 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9142 | "$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] | 9143 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9144 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9145 | -C "client hello, adding supported_point_formats extension" \ |
| 9146 | -S "found supported elliptic curves extension" \ |
| 9147 | -S "found supported point formats extension" |
| 9148 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9149 | requires_config_enabled MBEDTLS_AES_C |
| 9150 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9151 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9152 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9154 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9155 | "$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] | 9156 | "$P_CLI debug_level=3" \ |
| 9157 | 0 \ |
| 9158 | -C "found supported_point_formats extension" \ |
| 9159 | -S "server hello, supported_point_formats extension" |
| 9160 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9161 | requires_config_enabled MBEDTLS_AES_C |
| 9162 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9163 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9164 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9166 | run_test "Force an ECC ciphersuite in the client side" \ |
| 9167 | "$P_SRV debug_level=3" \ |
| 9168 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9169 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9170 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9171 | -c "client hello, adding supported_point_formats extension" \ |
| 9172 | -s "found supported elliptic curves extension" \ |
| 9173 | -s "found supported point formats extension" |
| 9174 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9175 | requires_config_enabled MBEDTLS_AES_C |
| 9176 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9177 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9178 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9180 | run_test "Force an ECC ciphersuite in the server side" \ |
| 9181 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9182 | "$P_CLI debug_level=3" \ |
| 9183 | 0 \ |
| 9184 | -c "found supported_point_formats extension" \ |
| 9185 | -s "server hello, supported_point_formats extension" |
| 9186 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9187 | # Tests for DTLS HelloVerifyRequest |
| 9188 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9190 | run_test "DTLS cookie: enabled" \ |
| 9191 | "$P_SRV dtls=1 debug_level=2" \ |
| 9192 | "$P_CLI dtls=1 debug_level=2" \ |
| 9193 | 0 \ |
| 9194 | -s "cookie verification failed" \ |
| 9195 | -s "cookie verification passed" \ |
| 9196 | -S "cookie verification skipped" \ |
| 9197 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9198 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9199 | -S "SSL - The requested feature is not available" |
| 9200 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9202 | run_test "DTLS cookie: disabled" \ |
| 9203 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 9204 | "$P_CLI dtls=1 debug_level=2" \ |
| 9205 | 0 \ |
| 9206 | -S "cookie verification failed" \ |
| 9207 | -S "cookie verification passed" \ |
| 9208 | -s "cookie verification skipped" \ |
| 9209 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9210 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9211 | -S "SSL - The requested feature is not available" |
| 9212 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9214 | run_test "DTLS cookie: default (failing)" \ |
| 9215 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 9216 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 9217 | 1 \ |
| 9218 | -s "cookie verification failed" \ |
| 9219 | -S "cookie verification passed" \ |
| 9220 | -S "cookie verification skipped" \ |
| 9221 | -C "received hello verify request" \ |
| 9222 | -S "hello verification requested" \ |
| 9223 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9224 | |
| 9225 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9227 | run_test "DTLS cookie: enabled, IPv6" \ |
| 9228 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 9229 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 9230 | 0 \ |
| 9231 | -s "cookie verification failed" \ |
| 9232 | -s "cookie verification passed" \ |
| 9233 | -S "cookie verification skipped" \ |
| 9234 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9235 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9236 | -S "SSL - The requested feature is not available" |
| 9237 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9239 | run_test "DTLS cookie: enabled, nbio" \ |
| 9240 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 9241 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9242 | 0 \ |
| 9243 | -s "cookie verification failed" \ |
| 9244 | -s "cookie verification passed" \ |
| 9245 | -S "cookie verification skipped" \ |
| 9246 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9247 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9248 | -S "SSL - The requested feature is not available" |
| 9249 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9250 | # Tests for client reconnecting from the same port with DTLS |
| 9251 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9252 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9254 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9255 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9256 | "$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] | 9257 | 0 \ |
| 9258 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9259 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9260 | -S "Client initiated reconnection from same port" |
| 9261 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9262 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9264 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9265 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9266 | "$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] | 9267 | 0 \ |
| 9268 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9269 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9270 | -s "Client initiated reconnection from same port" |
| 9271 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9272 | 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] | 9273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9274 | 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] | 9275 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 9276 | "$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] | 9277 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9278 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9279 | -s "Client initiated reconnection from same port" |
| 9280 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9281 | 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] | 9282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9283 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 9284 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 9285 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 9286 | 0 \ |
| 9287 | -S "The operation timed out" \ |
| 9288 | -s "Client initiated reconnection from same port" |
| 9289 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9291 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 9292 | "$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] | 9293 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 9294 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9295 | -s "The operation timed out" \ |
| 9296 | -S "Client initiated reconnection from same port" |
| 9297 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9299 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 9300 | -p "$P_PXY inject_clihlo=1" \ |
| 9301 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 9302 | "$P_CLI dtls=1 exchanges=2" \ |
| 9303 | 0 \ |
| 9304 | -s "possible client reconnect from the same port" \ |
| 9305 | -S "Client initiated reconnection from same port" |
| 9306 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9307 | # Tests for various cases of client authentication with DTLS |
| 9308 | # (focused on handshake flows and message parsing) |
| 9309 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9311 | run_test "DTLS client auth: required" \ |
| 9312 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9313 | "$P_CLI dtls=1" \ |
| 9314 | 0 \ |
| 9315 | -s "Verifying peer X.509 certificate... ok" |
| 9316 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9318 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9319 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9320 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9321 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9322 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9323 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9325 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9326 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9327 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9328 | 0 \ |
| 9329 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9330 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9331 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9333 | run_test "DTLS wrong PSK: badmac alert" \ |
| 9334 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 9335 | "$P_CLI dtls=1 psk=abc124" \ |
| 9336 | 1 \ |
| 9337 | -s "SSL - Verification of the message MAC failed" \ |
| 9338 | -c "SSL - A fatal alert message was received from our peer" |
| 9339 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9340 | # Tests for receiving fragmented handshake messages with DTLS |
| 9341 | |
| 9342 | requires_gnutls |
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 | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9344 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9345 | "$G_SRV -u --mtu 2048 -a" \ |
| 9346 | "$P_CLI dtls=1 debug_level=2" \ |
| 9347 | 0 \ |
| 9348 | -C "found fragmented DTLS handshake message" \ |
| 9349 | -C "error" |
| 9350 | |
| 9351 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9353 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9354 | "$G_SRV -u --mtu 512" \ |
| 9355 | "$P_CLI dtls=1 debug_level=2" \ |
| 9356 | 0 \ |
| 9357 | -c "found fragmented DTLS handshake message" \ |
| 9358 | -C "error" |
| 9359 | |
| 9360 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9361 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9362 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9363 | "$G_SRV -u --mtu 128" \ |
| 9364 | "$P_CLI dtls=1 debug_level=2" \ |
| 9365 | 0 \ |
| 9366 | -c "found fragmented DTLS handshake message" \ |
| 9367 | -C "error" |
| 9368 | |
| 9369 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9371 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9372 | "$G_SRV -u --mtu 128" \ |
| 9373 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9374 | 0 \ |
| 9375 | -c "found fragmented DTLS handshake message" \ |
| 9376 | -C "error" |
| 9377 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9378 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9379 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9381 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9382 | "$G_SRV -u --mtu 256" \ |
| 9383 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9384 | 0 \ |
| 9385 | -c "found fragmented DTLS handshake message" \ |
| 9386 | -c "client hello, adding renegotiation extension" \ |
| 9387 | -c "found renegotiation extension" \ |
| 9388 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9389 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9390 | -C "error" \ |
| 9391 | -s "Extra-header:" |
| 9392 | |
| 9393 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9394 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9396 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9397 | "$G_SRV -u --mtu 256" \ |
| 9398 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9399 | 0 \ |
| 9400 | -c "found fragmented DTLS handshake message" \ |
| 9401 | -c "client hello, adding renegotiation extension" \ |
| 9402 | -c "found renegotiation extension" \ |
| 9403 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9404 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9405 | -C "error" \ |
| 9406 | -s "Extra-header:" |
| 9407 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9409 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9410 | "$O_SRV -dtls -mtu 2048" \ |
| 9411 | "$P_CLI dtls=1 debug_level=2" \ |
| 9412 | 0 \ |
| 9413 | -C "found fragmented DTLS handshake message" \ |
| 9414 | -C "error" |
| 9415 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9417 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 9418 | "$O_SRV -dtls -mtu 768" \ |
| 9419 | "$P_CLI dtls=1 debug_level=2" \ |
| 9420 | 0 \ |
| 9421 | -c "found fragmented DTLS handshake message" \ |
| 9422 | -C "error" |
| 9423 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9425 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9426 | "$O_SRV -dtls -mtu 256" \ |
| 9427 | "$P_CLI dtls=1 debug_level=2" \ |
| 9428 | 0 \ |
| 9429 | -c "found fragmented DTLS handshake message" \ |
| 9430 | -C "error" |
| 9431 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9433 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9434 | "$O_SRV -dtls -mtu 256" \ |
| 9435 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9436 | 0 \ |
| 9437 | -c "found fragmented DTLS handshake message" \ |
| 9438 | -C "error" |
| 9439 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9440 | # Tests for sending fragmented handshake messages with DTLS |
| 9441 | # |
| 9442 | # Use client auth when we need the client to send large messages, |
| 9443 | # and use large cert chains on both sides too (the long chains we have all use |
| 9444 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9445 | # Sizes reached (UDP payload): |
| 9446 | # - 2037B for server certificate |
| 9447 | # - 1542B for client certificate |
| 9448 | # - 1013B for newsessionticket |
| 9449 | # - all others below 512B |
| 9450 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9451 | |
| 9452 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9453 | requires_config_enabled MBEDTLS_RSA_C |
| 9454 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9455 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9456 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9458 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9459 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9460 | crt_file=data_files/server7_int-ca.crt \ |
| 9461 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9462 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9463 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9464 | "$P_CLI dtls=1 debug_level=2 \ |
| 9465 | crt_file=data_files/server8_int-ca2.crt \ |
| 9466 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9467 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9468 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9469 | 0 \ |
| 9470 | -S "found fragmented DTLS handshake message" \ |
| 9471 | -C "found fragmented DTLS handshake message" \ |
| 9472 | -C "error" |
| 9473 | |
| 9474 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9475 | requires_config_enabled MBEDTLS_RSA_C |
| 9476 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9477 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9478 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9480 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9481 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9482 | crt_file=data_files/server7_int-ca.crt \ |
| 9483 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9484 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9485 | max_frag_len=1024" \ |
| 9486 | "$P_CLI dtls=1 debug_level=2 \ |
| 9487 | crt_file=data_files/server8_int-ca2.crt \ |
| 9488 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9489 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9490 | max_frag_len=2048" \ |
| 9491 | 0 \ |
| 9492 | -S "found fragmented DTLS handshake message" \ |
| 9493 | -c "found fragmented DTLS handshake message" \ |
| 9494 | -C "error" |
| 9495 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9496 | # With the MFL extension, the server has no way of forcing |
| 9497 | # the client to not exceed a certain MTU; hence, the following |
| 9498 | # test can't be replicated with an MTU proxy such as the one |
| 9499 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9500 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9501 | requires_config_enabled MBEDTLS_RSA_C |
| 9502 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9503 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9504 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9506 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9507 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9508 | crt_file=data_files/server7_int-ca.crt \ |
| 9509 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9510 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9511 | max_frag_len=512" \ |
| 9512 | "$P_CLI dtls=1 debug_level=2 \ |
| 9513 | crt_file=data_files/server8_int-ca2.crt \ |
| 9514 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9515 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9516 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9517 | 0 \ |
| 9518 | -S "found fragmented DTLS handshake message" \ |
| 9519 | -c "found fragmented DTLS handshake message" \ |
| 9520 | -C "error" |
| 9521 | |
| 9522 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9523 | requires_config_enabled MBEDTLS_RSA_C |
| 9524 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9525 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9526 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9528 | 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] | 9529 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9530 | crt_file=data_files/server7_int-ca.crt \ |
| 9531 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9532 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9533 | max_frag_len=2048" \ |
| 9534 | "$P_CLI dtls=1 debug_level=2 \ |
| 9535 | crt_file=data_files/server8_int-ca2.crt \ |
| 9536 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9537 | hs_timeout=2500-60000 \ |
| 9538 | max_frag_len=1024" \ |
| 9539 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9540 | -S "found fragmented DTLS handshake message" \ |
| 9541 | -c "found fragmented DTLS handshake message" \ |
| 9542 | -C "error" |
| 9543 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9544 | # While not required by the standard defining the MFL extension |
| 9545 | # (according to which it only applies to records, not to datagrams), |
| 9546 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9547 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9548 | # to the peer. |
| 9549 | # The next test checks that no datagrams significantly larger than the |
| 9550 | # negotiated MFL are sent. |
| 9551 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9552 | requires_config_enabled MBEDTLS_RSA_C |
| 9553 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9554 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9555 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9557 | 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] | 9558 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9559 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9560 | crt_file=data_files/server7_int-ca.crt \ |
| 9561 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9562 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9563 | max_frag_len=2048" \ |
| 9564 | "$P_CLI dtls=1 debug_level=2 \ |
| 9565 | crt_file=data_files/server8_int-ca2.crt \ |
| 9566 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9567 | hs_timeout=2500-60000 \ |
| 9568 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9569 | 0 \ |
| 9570 | -S "found fragmented DTLS handshake message" \ |
| 9571 | -c "found fragmented DTLS handshake message" \ |
| 9572 | -C "error" |
| 9573 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9574 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9575 | requires_config_enabled MBEDTLS_RSA_C |
| 9576 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9577 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9578 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9580 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9581 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9582 | crt_file=data_files/server7_int-ca.crt \ |
| 9583 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9584 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9585 | max_frag_len=2048" \ |
| 9586 | "$P_CLI dtls=1 debug_level=2 \ |
| 9587 | crt_file=data_files/server8_int-ca2.crt \ |
| 9588 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9589 | hs_timeout=2500-60000 \ |
| 9590 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9591 | 0 \ |
| 9592 | -s "found fragmented DTLS handshake message" \ |
| 9593 | -c "found fragmented DTLS handshake message" \ |
| 9594 | -C "error" |
| 9595 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9596 | # While not required by the standard defining the MFL extension |
| 9597 | # (according to which it only applies to records, not to datagrams), |
| 9598 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9599 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9600 | # to the peer. |
| 9601 | # The next test checks that no datagrams significantly larger than the |
| 9602 | # negotiated MFL are sent. |
| 9603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9604 | requires_config_enabled MBEDTLS_RSA_C |
| 9605 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9606 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9607 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9609 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9610 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9611 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9612 | crt_file=data_files/server7_int-ca.crt \ |
| 9613 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9614 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9615 | max_frag_len=2048" \ |
| 9616 | "$P_CLI dtls=1 debug_level=2 \ |
| 9617 | crt_file=data_files/server8_int-ca2.crt \ |
| 9618 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9619 | hs_timeout=2500-60000 \ |
| 9620 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9621 | 0 \ |
| 9622 | -s "found fragmented DTLS handshake message" \ |
| 9623 | -c "found fragmented DTLS handshake message" \ |
| 9624 | -C "error" |
| 9625 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9626 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9627 | requires_config_enabled MBEDTLS_RSA_C |
| 9628 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9629 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9631 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9632 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9633 | crt_file=data_files/server7_int-ca.crt \ |
| 9634 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9635 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9636 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9637 | "$P_CLI dtls=1 debug_level=2 \ |
| 9638 | crt_file=data_files/server8_int-ca2.crt \ |
| 9639 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9640 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9641 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9642 | 0 \ |
| 9643 | -S "found fragmented DTLS handshake message" \ |
| 9644 | -C "found fragmented DTLS handshake message" \ |
| 9645 | -C "error" |
| 9646 | |
| 9647 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9648 | requires_config_enabled MBEDTLS_RSA_C |
| 9649 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9650 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9652 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9653 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9654 | crt_file=data_files/server7_int-ca.crt \ |
| 9655 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9656 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9657 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9658 | "$P_CLI dtls=1 debug_level=2 \ |
| 9659 | crt_file=data_files/server8_int-ca2.crt \ |
| 9660 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9661 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9662 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9663 | 0 \ |
| 9664 | -s "found fragmented DTLS handshake message" \ |
| 9665 | -C "found fragmented DTLS handshake message" \ |
| 9666 | -C "error" |
| 9667 | |
| 9668 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9669 | requires_config_enabled MBEDTLS_RSA_C |
| 9670 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9671 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9673 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9674 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9675 | crt_file=data_files/server7_int-ca.crt \ |
| 9676 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9677 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9678 | mtu=512" \ |
| 9679 | "$P_CLI dtls=1 debug_level=2 \ |
| 9680 | crt_file=data_files/server8_int-ca2.crt \ |
| 9681 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9682 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9683 | mtu=2048" \ |
| 9684 | 0 \ |
| 9685 | -S "found fragmented DTLS handshake message" \ |
| 9686 | -c "found fragmented DTLS handshake message" \ |
| 9687 | -C "error" |
| 9688 | |
| 9689 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9690 | requires_config_enabled MBEDTLS_RSA_C |
| 9691 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9692 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9694 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9695 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9696 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9697 | crt_file=data_files/server7_int-ca.crt \ |
| 9698 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9699 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9700 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9701 | "$P_CLI dtls=1 debug_level=2 \ |
| 9702 | crt_file=data_files/server8_int-ca2.crt \ |
| 9703 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9704 | hs_timeout=2500-60000 \ |
| 9705 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9706 | 0 \ |
| 9707 | -s "found fragmented DTLS handshake message" \ |
| 9708 | -c "found fragmented DTLS handshake message" \ |
| 9709 | -C "error" |
| 9710 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9711 | # 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] | 9712 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9713 | requires_config_enabled MBEDTLS_RSA_C |
| 9714 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9715 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9716 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9717 | requires_config_enabled MBEDTLS_AES_C |
| 9718 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9719 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9721 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9722 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9723 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9724 | crt_file=data_files/server7_int-ca.crt \ |
| 9725 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9726 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9727 | mtu=512" \ |
| 9728 | "$P_CLI dtls=1 debug_level=2 \ |
| 9729 | crt_file=data_files/server8_int-ca2.crt \ |
| 9730 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9731 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9732 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9733 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9734 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9735 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9736 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9737 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9738 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9739 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9740 | # 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] | 9741 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9742 | # retransmissions, but in some cases (like both the server and client using |
| 9743 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9744 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9745 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +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 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9749 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9750 | requires_config_enabled MBEDTLS_AES_C |
| 9751 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9752 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9754 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9755 | -p "$P_PXY mtu=508" \ |
| 9756 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9757 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9758 | key_file=data_files/server7.key \ |
| 9759 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9760 | "$P_CLI dtls=1 debug_level=2 \ |
| 9761 | crt_file=data_files/server8_int-ca2.crt \ |
| 9762 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9763 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9764 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9765 | 0 \ |
| 9766 | -s "found fragmented DTLS handshake message" \ |
| 9767 | -c "found fragmented DTLS handshake message" \ |
| 9768 | -C "error" |
| 9769 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9770 | # 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] | 9771 | only_with_valgrind |
| 9772 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9773 | requires_config_enabled MBEDTLS_RSA_C |
| 9774 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9775 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9776 | requires_config_enabled MBEDTLS_AES_C |
| 9777 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9778 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9780 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9781 | -p "$P_PXY mtu=508" \ |
| 9782 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9783 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9784 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9785 | hs_timeout=250-10000" \ |
| 9786 | "$P_CLI dtls=1 debug_level=2 \ |
| 9787 | crt_file=data_files/server8_int-ca2.crt \ |
| 9788 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9789 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9790 | hs_timeout=250-10000" \ |
| 9791 | 0 \ |
| 9792 | -s "found fragmented DTLS handshake message" \ |
| 9793 | -c "found fragmented DTLS handshake message" \ |
| 9794 | -C "error" |
| 9795 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9796 | # 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] | 9797 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9798 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9799 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9800 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9801 | requires_config_enabled MBEDTLS_RSA_C |
| 9802 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9803 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9805 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9806 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9807 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9808 | crt_file=data_files/server7_int-ca.crt \ |
| 9809 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9810 | hs_timeout=10000-60000 \ |
| 9811 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9812 | "$P_CLI dtls=1 debug_level=2 \ |
| 9813 | crt_file=data_files/server8_int-ca2.crt \ |
| 9814 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9815 | hs_timeout=10000-60000 \ |
| 9816 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9817 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9818 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9819 | -s "found fragmented DTLS handshake message" \ |
| 9820 | -c "found fragmented DTLS handshake message" \ |
| 9821 | -C "error" |
| 9822 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9823 | # 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] | 9824 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9825 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9826 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9827 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9828 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9829 | requires_config_enabled MBEDTLS_RSA_C |
| 9830 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9831 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9832 | requires_config_enabled MBEDTLS_AES_C |
| 9833 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9834 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9836 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9837 | -p "$P_PXY mtu=512" \ |
| 9838 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9839 | crt_file=data_files/server7_int-ca.crt \ |
| 9840 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9841 | hs_timeout=10000-60000 \ |
| 9842 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9843 | "$P_CLI dtls=1 debug_level=2 \ |
| 9844 | crt_file=data_files/server8_int-ca2.crt \ |
| 9845 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9846 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9847 | hs_timeout=10000-60000 \ |
| 9848 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9849 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9850 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9851 | -s "found fragmented DTLS handshake message" \ |
| 9852 | -c "found fragmented DTLS handshake message" \ |
| 9853 | -C "error" |
| 9854 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9855 | not_with_valgrind # spurious autoreduction due to timeout |
| 9856 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9857 | requires_config_enabled MBEDTLS_RSA_C |
| 9858 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9859 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9861 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9862 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9863 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9864 | crt_file=data_files/server7_int-ca.crt \ |
| 9865 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9866 | hs_timeout=10000-60000 \ |
| 9867 | mtu=1024 nbio=2" \ |
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 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9871 | hs_timeout=10000-60000 \ |
| 9872 | mtu=1024 nbio=2" \ |
| 9873 | 0 \ |
| 9874 | -S "autoreduction" \ |
| 9875 | -s "found fragmented DTLS handshake message" \ |
| 9876 | -c "found fragmented DTLS handshake message" \ |
| 9877 | -C "error" |
| 9878 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9879 | # 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] | 9880 | not_with_valgrind # spurious autoreduction due to timeout |
| 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 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9887 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9889 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9890 | -p "$P_PXY mtu=512" \ |
| 9891 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9892 | crt_file=data_files/server7_int-ca.crt \ |
| 9893 | key_file=data_files/server7.key \ |
| 9894 | hs_timeout=10000-60000 \ |
| 9895 | mtu=512 nbio=2" \ |
| 9896 | "$P_CLI dtls=1 debug_level=2 \ |
| 9897 | crt_file=data_files/server8_int-ca2.crt \ |
| 9898 | key_file=data_files/server8.key \ |
| 9899 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9900 | hs_timeout=10000-60000 \ |
| 9901 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9902 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9903 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9904 | -s "found fragmented DTLS handshake message" \ |
| 9905 | -c "found fragmented DTLS handshake message" \ |
| 9906 | -C "error" |
| 9907 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9908 | # 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] | 9909 | # This ensures things still work after session_reset(). |
| 9910 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9911 | # Since we don't support reading fragmented ClientHello yet, |
| 9912 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9913 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9914 | # An autoreduction on the client-side might happen if the server is |
| 9915 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9916 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9917 | # resumed listening, which would result in a spurious autoreduction. |
| 9918 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9919 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9920 | requires_config_enabled MBEDTLS_RSA_C |
| 9921 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9922 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9923 | requires_config_enabled MBEDTLS_AES_C |
| 9924 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9925 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9927 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9928 | -p "$P_PXY mtu=1450" \ |
| 9929 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9930 | crt_file=data_files/server7_int-ca.crt \ |
| 9931 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9932 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9933 | mtu=1450" \ |
| 9934 | "$P_CLI dtls=1 debug_level=2 \ |
| 9935 | crt_file=data_files/server8_int-ca2.crt \ |
| 9936 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9937 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9938 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 9939 | mtu=1450 reconnect=1 skip_close_notify=1 reco_delay=1000" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9940 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9941 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9942 | -s "found fragmented DTLS handshake message" \ |
| 9943 | -c "found fragmented DTLS handshake message" \ |
| 9944 | -C "error" |
| 9945 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9946 | # An autoreduction on the client-side might happen if the server is |
| 9947 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9948 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9949 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9950 | requires_config_enabled MBEDTLS_RSA_C |
| 9951 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9952 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9953 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9954 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9955 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9956 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9958 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9959 | -p "$P_PXY mtu=512" \ |
| 9960 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9961 | crt_file=data_files/server7_int-ca.crt \ |
| 9962 | key_file=data_files/server7.key \ |
| 9963 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9964 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9965 | mtu=512" \ |
| 9966 | "$P_CLI dtls=1 debug_level=2 \ |
| 9967 | crt_file=data_files/server8_int-ca2.crt \ |
| 9968 | key_file=data_files/server8.key \ |
| 9969 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9970 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9971 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9972 | mtu=512" \ |
| 9973 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9974 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9975 | -s "found fragmented DTLS handshake message" \ |
| 9976 | -c "found fragmented DTLS handshake message" \ |
| 9977 | -C "error" |
| 9978 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9979 | # An autoreduction on the client-side might happen if the server is |
| 9980 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9981 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9982 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9983 | requires_config_enabled MBEDTLS_RSA_C |
| 9984 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9985 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9986 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9987 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9988 | requires_config_enabled MBEDTLS_AES_C |
| 9989 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9990 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9992 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9993 | -p "$P_PXY mtu=512" \ |
| 9994 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9995 | crt_file=data_files/server7_int-ca.crt \ |
| 9996 | key_file=data_files/server7.key \ |
| 9997 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9998 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9999 | mtu=512" \ |
| 10000 | "$P_CLI dtls=1 debug_level=2 \ |
| 10001 | crt_file=data_files/server8_int-ca2.crt \ |
| 10002 | key_file=data_files/server8.key \ |
| 10003 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10004 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10005 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10006 | mtu=512" \ |
| 10007 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10008 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10009 | -s "found fragmented DTLS handshake message" \ |
| 10010 | -c "found fragmented DTLS handshake message" \ |
| 10011 | -C "error" |
| 10012 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10013 | # An autoreduction on the client-side might happen if the server is |
| 10014 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10015 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10016 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10017 | requires_config_enabled MBEDTLS_RSA_C |
| 10018 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10019 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10020 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10021 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 10022 | requires_config_enabled MBEDTLS_AES_C |
| 10023 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10024 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10026 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10027 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10028 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10029 | crt_file=data_files/server7_int-ca.crt \ |
| 10030 | key_file=data_files/server7.key \ |
| 10031 | exchanges=2 renegotiation=1 \ |
| 10032 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10033 | hs_timeout=10000-60000 \ |
| 10034 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10035 | "$P_CLI dtls=1 debug_level=2 \ |
| 10036 | crt_file=data_files/server8_int-ca2.crt \ |
| 10037 | key_file=data_files/server8.key \ |
| 10038 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10039 | hs_timeout=10000-60000 \ |
| 10040 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10041 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10042 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10043 | -s "found fragmented DTLS handshake message" \ |
| 10044 | -c "found fragmented DTLS handshake message" \ |
| 10045 | -C "error" |
| 10046 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10047 | # An autoreduction on the client-side might happen if the server is |
| 10048 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10049 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10050 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10051 | requires_config_enabled MBEDTLS_RSA_C |
| 10052 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10053 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10054 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10055 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 10056 | requires_config_enabled MBEDTLS_AES_C |
| 10057 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 10058 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10059 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10061 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10062 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10063 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10064 | crt_file=data_files/server7_int-ca.crt \ |
| 10065 | key_file=data_files/server7.key \ |
| 10066 | exchanges=2 renegotiation=1 \ |
| 10067 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10068 | hs_timeout=10000-60000 \ |
| 10069 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10070 | "$P_CLI dtls=1 debug_level=2 \ |
| 10071 | crt_file=data_files/server8_int-ca2.crt \ |
| 10072 | key_file=data_files/server8.key \ |
| 10073 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10074 | hs_timeout=10000-60000 \ |
| 10075 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10076 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10077 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10078 | -s "found fragmented DTLS handshake message" \ |
| 10079 | -c "found fragmented DTLS handshake message" \ |
| 10080 | -C "error" |
| 10081 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10082 | # An autoreduction on the client-side might happen if the server is |
| 10083 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10084 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10085 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10086 | requires_config_enabled MBEDTLS_RSA_C |
| 10087 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10088 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10089 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10090 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 10091 | requires_config_enabled MBEDTLS_AES_C |
| 10092 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10093 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10095 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10096 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10097 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10098 | crt_file=data_files/server7_int-ca.crt \ |
| 10099 | key_file=data_files/server7.key \ |
| 10100 | exchanges=2 renegotiation=1 \ |
| 10101 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10102 | hs_timeout=10000-60000 \ |
| 10103 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10104 | "$P_CLI dtls=1 debug_level=2 \ |
| 10105 | crt_file=data_files/server8_int-ca2.crt \ |
| 10106 | key_file=data_files/server8.key \ |
| 10107 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10108 | hs_timeout=10000-60000 \ |
| 10109 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10110 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10111 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10112 | -s "found fragmented DTLS handshake message" \ |
| 10113 | -c "found fragmented DTLS handshake message" \ |
| 10114 | -C "error" |
| 10115 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10116 | # 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] | 10117 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10118 | requires_config_enabled MBEDTLS_RSA_C |
| 10119 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10120 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10121 | requires_config_enabled MBEDTLS_AES_C |
| 10122 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10123 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10124 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10126 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 10127 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10128 | "$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] | 10129 | crt_file=data_files/server7_int-ca.crt \ |
| 10130 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10131 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10132 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10133 | crt_file=data_files/server8_int-ca2.crt \ |
| 10134 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10135 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10136 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10137 | 0 \ |
| 10138 | -s "found fragmented DTLS handshake message" \ |
| 10139 | -c "found fragmented DTLS handshake message" \ |
| 10140 | -C "error" |
| 10141 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10142 | # 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] | 10143 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10144 | requires_config_enabled MBEDTLS_RSA_C |
| 10145 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10146 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10147 | requires_config_enabled MBEDTLS_AES_C |
| 10148 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10149 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10150 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10152 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 10153 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 10154 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10155 | crt_file=data_files/server7_int-ca.crt \ |
| 10156 | key_file=data_files/server7.key \ |
| 10157 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10158 | "$P_CLI dtls=1 debug_level=2 \ |
| 10159 | crt_file=data_files/server8_int-ca2.crt \ |
| 10160 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10161 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10162 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10163 | 0 \ |
| 10164 | -s "found fragmented DTLS handshake message" \ |
| 10165 | -c "found fragmented DTLS handshake message" \ |
| 10166 | -C "error" |
| 10167 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10168 | # interop tests for DTLS fragmentating with reliable connection |
| 10169 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10170 | # here and below we just want to test that the we fragment in a way that |
| 10171 | # pleases other implementations, so we don't need the peer to fragment |
| 10172 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10173 | requires_config_enabled MBEDTLS_RSA_C |
| 10174 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10175 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10176 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10177 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 10178 | "$G_SRV -u" \ |
| 10179 | "$P_CLI dtls=1 debug_level=2 \ |
| 10180 | crt_file=data_files/server8_int-ca2.crt \ |
| 10181 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10182 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10183 | 0 \ |
| 10184 | -c "fragmenting handshake message" \ |
| 10185 | -C "error" |
| 10186 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10187 | # We use --insecure for the GnuTLS client because it expects |
| 10188 | # the hostname / IP it connects to to be the name used in the |
| 10189 | # certificate obtained from the server. Here, however, it |
| 10190 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 10191 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 10192 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10193 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10194 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10195 | requires_config_enabled MBEDTLS_RSA_C |
| 10196 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10197 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 10198 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10199 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10200 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10201 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10202 | crt_file=data_files/server7_int-ca.crt \ |
| 10203 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10204 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10205 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10206 | 0 \ |
| 10207 | -s "fragmenting handshake message" |
| 10208 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10209 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10210 | requires_config_enabled MBEDTLS_RSA_C |
| 10211 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10212 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10213 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 10214 | "$O_SRV -dtls1_2 -verify 10" \ |
| 10215 | "$P_CLI dtls=1 debug_level=2 \ |
| 10216 | crt_file=data_files/server8_int-ca2.crt \ |
| 10217 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10218 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10219 | 0 \ |
| 10220 | -c "fragmenting handshake message" \ |
| 10221 | -C "error" |
| 10222 | |
| 10223 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10224 | requires_config_enabled MBEDTLS_RSA_C |
| 10225 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10226 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10227 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 10228 | "$P_SRV dtls=1 debug_level=2 \ |
| 10229 | crt_file=data_files/server7_int-ca.crt \ |
| 10230 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10231 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10232 | "$O_CLI -dtls1_2" \ |
| 10233 | 0 \ |
| 10234 | -s "fragmenting handshake message" |
| 10235 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10236 | # interop tests for DTLS fragmentating with unreliable connection |
| 10237 | # |
| 10238 | # again we just want to test that the we fragment in a way that |
| 10239 | # pleases other implementations, so we don't need the peer to fragment |
| 10240 | requires_gnutls_next |
| 10241 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10242 | requires_config_enabled MBEDTLS_RSA_C |
| 10243 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10244 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10245 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10246 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 10247 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10248 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10249 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10250 | crt_file=data_files/server8_int-ca2.crt \ |
| 10251 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10252 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10253 | 0 \ |
| 10254 | -c "fragmenting handshake message" \ |
| 10255 | -C "error" |
| 10256 | |
| 10257 | requires_gnutls_next |
| 10258 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10259 | requires_config_enabled MBEDTLS_RSA_C |
| 10260 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10261 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10262 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10263 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 10264 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10265 | "$P_SRV dtls=1 debug_level=2 \ |
| 10266 | crt_file=data_files/server7_int-ca.crt \ |
| 10267 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10268 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10269 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10270 | 0 \ |
| 10271 | -s "fragmenting handshake message" |
| 10272 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 10273 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 10274 | ## 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] | 10275 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10276 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10277 | requires_config_enabled MBEDTLS_RSA_C |
| 10278 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10279 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10280 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10281 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 10282 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10283 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10284 | "$P_CLI dtls=1 debug_level=2 \ |
| 10285 | crt_file=data_files/server8_int-ca2.crt \ |
| 10286 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10287 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10288 | 0 \ |
| 10289 | -c "fragmenting handshake message" \ |
| 10290 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10291 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10292 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10293 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 10294 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10295 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10296 | requires_config_enabled MBEDTLS_RSA_C |
| 10297 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10298 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10299 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10300 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 10301 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10302 | "$P_SRV dtls=1 debug_level=2 \ |
| 10303 | crt_file=data_files/server7_int-ca.crt \ |
| 10304 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10305 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10306 | "$O_CLI -dtls1_2" \ |
| 10307 | 0 \ |
| 10308 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10309 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10310 | # Tests for DTLS-SRTP (RFC 5764) |
| 10311 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10313 | run_test "DTLS-SRTP all profiles supported" \ |
| 10314 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10315 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10316 | 0 \ |
| 10317 | -s "found use_srtp extension" \ |
| 10318 | -s "found srtp profile" \ |
| 10319 | -s "selected srtp profile" \ |
| 10320 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10321 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10322 | -c "client hello, adding use_srtp extension" \ |
| 10323 | -c "found use_srtp extension" \ |
| 10324 | -c "found srtp profile" \ |
| 10325 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10326 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10327 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10328 | -C "error" |
| 10329 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10330 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10331 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10333 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10334 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10335 | "$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] | 10336 | 0 \ |
| 10337 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10338 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10339 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10340 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10341 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10342 | -c "client hello, adding use_srtp extension" \ |
| 10343 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10344 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10345 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10346 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10347 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10348 | -C "error" |
| 10349 | |
| 10350 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10352 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10353 | "$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] | 10354 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10355 | 0 \ |
| 10356 | -s "found use_srtp extension" \ |
| 10357 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10358 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10359 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10360 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10361 | -c "client hello, adding use_srtp extension" \ |
| 10362 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10363 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10364 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10365 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10366 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10367 | -C "error" |
| 10368 | |
| 10369 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10371 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10372 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10373 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10374 | 0 \ |
| 10375 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10376 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10377 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10378 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10379 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10380 | -c "client hello, adding use_srtp extension" \ |
| 10381 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10382 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10383 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10384 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10385 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10386 | -C "error" |
| 10387 | |
| 10388 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10389 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10390 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10391 | "$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] | 10392 | "$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] | 10393 | 0 \ |
| 10394 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10395 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10396 | -S "selected srtp profile" \ |
| 10397 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10398 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10399 | -c "client hello, adding use_srtp extension" \ |
| 10400 | -C "found use_srtp extension" \ |
| 10401 | -C "found srtp profile" \ |
| 10402 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10403 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10404 | -C "error" |
| 10405 | |
| 10406 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10408 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10409 | "$P_SRV dtls=1 debug_level=3" \ |
| 10410 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10411 | 0 \ |
| 10412 | -s "found use_srtp extension" \ |
| 10413 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10414 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10415 | -c "client hello, adding use_srtp extension" \ |
| 10416 | -C "found use_srtp extension" \ |
| 10417 | -C "found srtp profile" \ |
| 10418 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10419 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10420 | -C "error" |
| 10421 | |
| 10422 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10424 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10425 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10426 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10427 | 0 \ |
| 10428 | -s "found use_srtp extension" \ |
| 10429 | -s "found srtp profile" \ |
| 10430 | -s "selected srtp profile" \ |
| 10431 | -s "server hello, adding use_srtp extension" \ |
| 10432 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10433 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10434 | -c "client hello, adding use_srtp extension" \ |
| 10435 | -c "found use_srtp extension" \ |
| 10436 | -c "found srtp profile" \ |
| 10437 | -c "selected srtp profile" \ |
| 10438 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10439 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10440 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10441 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10442 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10443 | -C "error" |
| 10444 | |
| 10445 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10447 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10448 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10449 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10450 | 0 \ |
| 10451 | -s "found use_srtp extension" \ |
| 10452 | -s "found srtp profile" \ |
| 10453 | -s "selected srtp profile" \ |
| 10454 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10455 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10456 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10457 | -S "dumping 'using mki' (8 bytes)" \ |
| 10458 | -c "client hello, adding use_srtp extension" \ |
| 10459 | -c "found use_srtp extension" \ |
| 10460 | -c "found srtp profile" \ |
| 10461 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10462 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10463 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10464 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10465 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10466 | -C "dumping 'received mki' (8 bytes)" \ |
| 10467 | -C "error" |
| 10468 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10469 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10471 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10472 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10473 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10474 | 0 \ |
| 10475 | -s "found use_srtp extension" \ |
| 10476 | -s "found srtp profile" \ |
| 10477 | -s "selected srtp profile" \ |
| 10478 | -s "server hello, adding use_srtp extension" \ |
| 10479 | -s "DTLS-SRTP key material is"\ |
| 10480 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10481 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10482 | |
| 10483 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10485 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10486 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10487 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10488 | 0 \ |
| 10489 | -s "found use_srtp extension" \ |
| 10490 | -s "found srtp profile" \ |
| 10491 | -s "selected srtp profile" \ |
| 10492 | -s "server hello, adding use_srtp extension" \ |
| 10493 | -s "DTLS-SRTP key material is"\ |
| 10494 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10495 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10496 | |
| 10497 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10499 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10500 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10501 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10502 | 0 \ |
| 10503 | -s "found use_srtp extension" \ |
| 10504 | -s "found srtp profile" \ |
| 10505 | -s "selected srtp profile" \ |
| 10506 | -s "server hello, adding use_srtp extension" \ |
| 10507 | -s "DTLS-SRTP key material is"\ |
| 10508 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10509 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10510 | |
| 10511 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10513 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10514 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10515 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10516 | 0 \ |
| 10517 | -s "found use_srtp extension" \ |
| 10518 | -s "found srtp profile" \ |
| 10519 | -s "selected srtp profile" \ |
| 10520 | -s "server hello, adding use_srtp extension" \ |
| 10521 | -s "DTLS-SRTP key material is"\ |
| 10522 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10523 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10524 | |
| 10525 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10527 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10528 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10529 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10530 | 0 \ |
| 10531 | -s "found use_srtp extension" \ |
| 10532 | -s "found srtp profile" \ |
| 10533 | -s "selected srtp profile" \ |
| 10534 | -s "server hello, adding use_srtp extension" \ |
| 10535 | -s "DTLS-SRTP key material is"\ |
| 10536 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10537 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10538 | |
| 10539 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10541 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10542 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10543 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10544 | 0 \ |
| 10545 | -s "found use_srtp extension" \ |
| 10546 | -s "found srtp profile" \ |
| 10547 | -S "selected srtp profile" \ |
| 10548 | -S "server hello, adding use_srtp extension" \ |
| 10549 | -S "DTLS-SRTP key material is"\ |
| 10550 | -C "SRTP Extension negotiated, profile" |
| 10551 | |
| 10552 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10554 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10555 | "$P_SRV dtls=1 debug_level=3" \ |
| 10556 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10557 | 0 \ |
| 10558 | -s "found use_srtp extension" \ |
| 10559 | -S "server hello, adding use_srtp extension" \ |
| 10560 | -S "DTLS-SRTP key material is"\ |
| 10561 | -C "SRTP Extension negotiated, profile" |
| 10562 | |
| 10563 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10565 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10566 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10567 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10568 | 0 \ |
| 10569 | -c "client hello, adding use_srtp extension" \ |
| 10570 | -c "found use_srtp extension" \ |
| 10571 | -c "found srtp profile" \ |
| 10572 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10573 | -c "DTLS-SRTP key material is"\ |
| 10574 | -C "error" |
| 10575 | |
| 10576 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10578 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10579 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10580 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10581 | 0 \ |
| 10582 | -c "client hello, adding use_srtp extension" \ |
| 10583 | -c "found use_srtp extension" \ |
| 10584 | -c "found srtp profile" \ |
| 10585 | -c "selected srtp profile" \ |
| 10586 | -c "DTLS-SRTP key material is"\ |
| 10587 | -C "error" |
| 10588 | |
| 10589 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10591 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10592 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10593 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10594 | 0 \ |
| 10595 | -c "client hello, adding use_srtp extension" \ |
| 10596 | -c "found use_srtp extension" \ |
| 10597 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10598 | -c "selected srtp profile" \ |
| 10599 | -c "DTLS-SRTP key material is"\ |
| 10600 | -C "error" |
| 10601 | |
| 10602 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10604 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 10605 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10606 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10607 | 0 \ |
| 10608 | -c "client hello, adding use_srtp extension" \ |
| 10609 | -c "found use_srtp extension" \ |
| 10610 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10611 | -c "selected srtp profile" \ |
| 10612 | -c "DTLS-SRTP key material is"\ |
| 10613 | -C "error" |
| 10614 | |
| 10615 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10617 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10618 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10619 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10620 | 0 \ |
| 10621 | -c "client hello, adding use_srtp extension" \ |
| 10622 | -c "found use_srtp extension" \ |
| 10623 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10624 | -c "selected srtp profile" \ |
| 10625 | -c "DTLS-SRTP key material is"\ |
| 10626 | -C "error" |
| 10627 | |
| 10628 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10630 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10631 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10632 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10633 | 0 \ |
| 10634 | -c "client hello, adding use_srtp extension" \ |
| 10635 | -C "found use_srtp extension" \ |
| 10636 | -C "found srtp profile" \ |
| 10637 | -C "selected srtp profile" \ |
| 10638 | -C "DTLS-SRTP key material is"\ |
| 10639 | -C "error" |
| 10640 | |
| 10641 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10643 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10644 | "$O_SRV -dtls" \ |
| 10645 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10646 | 0 \ |
| 10647 | -c "client hello, adding use_srtp extension" \ |
| 10648 | -C "found use_srtp extension" \ |
| 10649 | -C "found srtp profile" \ |
| 10650 | -C "selected srtp profile" \ |
| 10651 | -C "DTLS-SRTP key material is"\ |
| 10652 | -C "error" |
| 10653 | |
| 10654 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10656 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10657 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10658 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10659 | 0 \ |
| 10660 | -c "client hello, adding use_srtp extension" \ |
| 10661 | -c "found use_srtp extension" \ |
| 10662 | -c "found srtp profile" \ |
| 10663 | -c "selected srtp profile" \ |
| 10664 | -c "DTLS-SRTP key material is"\ |
| 10665 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10666 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10667 | -C "dumping 'received mki' (8 bytes)" \ |
| 10668 | -C "error" |
| 10669 | |
| 10670 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10671 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10673 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10674 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10675 | "$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] | 10676 | 0 \ |
| 10677 | -s "found use_srtp extension" \ |
| 10678 | -s "found srtp profile" \ |
| 10679 | -s "selected srtp profile" \ |
| 10680 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10681 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10682 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10683 | |
| 10684 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10685 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10687 | 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] | 10688 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10689 | "$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] | 10690 | 0 \ |
| 10691 | -s "found use_srtp extension" \ |
| 10692 | -s "found srtp profile" \ |
| 10693 | -s "selected srtp profile" \ |
| 10694 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10695 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10696 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10697 | |
| 10698 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10699 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10701 | 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] | 10702 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10703 | "$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] | 10704 | 0 \ |
| 10705 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10706 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10707 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10708 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10709 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10710 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10711 | |
| 10712 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10713 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10715 | 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] | 10716 | "$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] | 10717 | "$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] | 10718 | 0 \ |
| 10719 | -s "found use_srtp extension" \ |
| 10720 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10721 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10722 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10723 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10724 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10725 | |
| 10726 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10727 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10729 | 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] | 10730 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10731 | "$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] | 10732 | 0 \ |
| 10733 | -s "found use_srtp extension" \ |
| 10734 | -s "found srtp profile" \ |
| 10735 | -s "selected srtp profile" \ |
| 10736 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10737 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10738 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10739 | |
| 10740 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10741 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10743 | 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] | 10744 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10745 | "$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] | 10746 | 0 \ |
| 10747 | -s "found use_srtp extension" \ |
| 10748 | -s "found srtp profile" \ |
| 10749 | -S "selected srtp profile" \ |
| 10750 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10751 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10752 | -C "SRTP profile:" |
| 10753 | |
| 10754 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10755 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10757 | 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] | 10758 | "$P_SRV dtls=1 debug_level=3" \ |
| 10759 | "$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] | 10760 | 0 \ |
| 10761 | -s "found use_srtp extension" \ |
| 10762 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10763 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10764 | -C "SRTP profile:" |
| 10765 | |
| 10766 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10767 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10769 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10770 | "$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" \ |
| 10771 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10772 | 0 \ |
| 10773 | -c "client hello, adding use_srtp extension" \ |
| 10774 | -c "found use_srtp extension" \ |
| 10775 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10776 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10777 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10778 | -C "error" |
| 10779 | |
| 10780 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10781 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10783 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10784 | "$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" \ |
| 10785 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10786 | 0 \ |
| 10787 | -c "client hello, adding use_srtp extension" \ |
| 10788 | -c "found use_srtp extension" \ |
| 10789 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10790 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10791 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10792 | -C "error" |
| 10793 | |
| 10794 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10795 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10797 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10798 | "$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" \ |
| 10799 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10800 | 0 \ |
| 10801 | -c "client hello, adding use_srtp extension" \ |
| 10802 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10803 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10804 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10805 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10806 | -C "error" |
| 10807 | |
| 10808 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10809 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10811 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10812 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10813 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10814 | 0 \ |
| 10815 | -c "client hello, adding use_srtp extension" \ |
| 10816 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10817 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10818 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10819 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10820 | -C "error" |
| 10821 | |
| 10822 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10823 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10825 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10826 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10827 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10828 | 0 \ |
| 10829 | -c "client hello, adding use_srtp extension" \ |
| 10830 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10831 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10832 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10833 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10834 | -C "error" |
| 10835 | |
| 10836 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10837 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10839 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10840 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10841 | "$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] | 10842 | 0 \ |
| 10843 | -c "client hello, adding use_srtp extension" \ |
| 10844 | -C "found use_srtp extension" \ |
| 10845 | -C "found srtp profile" \ |
| 10846 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10847 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10848 | -C "error" |
| 10849 | |
| 10850 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10851 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10853 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10854 | "$G_SRV -u" \ |
| 10855 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10856 | 0 \ |
| 10857 | -c "client hello, adding use_srtp extension" \ |
| 10858 | -C "found use_srtp extension" \ |
| 10859 | -C "found srtp profile" \ |
| 10860 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10861 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10862 | -C "error" |
| 10863 | |
| 10864 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10865 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10867 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10868 | "$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" \ |
| 10869 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10870 | 0 \ |
| 10871 | -c "client hello, adding use_srtp extension" \ |
| 10872 | -c "found use_srtp extension" \ |
| 10873 | -c "found srtp profile" \ |
| 10874 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10875 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10876 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10877 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10878 | -c "dumping 'received mki' (8 bytes)" \ |
| 10879 | -C "error" |
| 10880 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10881 | # Tests for specific things with "unreliable" UDP connection |
| 10882 | |
| 10883 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10885 | run_test "DTLS proxy: reference" \ |
| 10886 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10887 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10888 | "$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] | 10889 | 0 \ |
| 10890 | -C "replayed record" \ |
| 10891 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10892 | -C "Buffer record from epoch" \ |
| 10893 | -S "Buffer record from epoch" \ |
| 10894 | -C "ssl_buffer_message" \ |
| 10895 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10896 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10897 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10898 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10899 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10900 | -c "HTTP/1.0 200 OK" |
| 10901 | |
| 10902 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10904 | run_test "DTLS proxy: duplicate every packet" \ |
| 10905 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10906 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10907 | "$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] | 10908 | 0 \ |
| 10909 | -c "replayed record" \ |
| 10910 | -s "replayed record" \ |
| 10911 | -c "record from another epoch" \ |
| 10912 | -s "record from another epoch" \ |
| 10913 | -S "resend" \ |
| 10914 | -s "Extra-header:" \ |
| 10915 | -c "HTTP/1.0 200 OK" |
| 10916 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10918 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10919 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10920 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10921 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10922 | 0 \ |
| 10923 | -c "replayed record" \ |
| 10924 | -S "replayed record" \ |
| 10925 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10926 | -s "record from another epoch" \ |
| 10927 | -c "resend" \ |
| 10928 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10929 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10930 | -c "HTTP/1.0 200 OK" |
| 10931 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10933 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10934 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10935 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10936 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10937 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10938 | -c "next record in same datagram" \ |
| 10939 | -s "next record in same datagram" |
| 10940 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10942 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10943 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10944 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10945 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10946 | 0 \ |
| 10947 | -c "next record in same datagram" \ |
| 10948 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10949 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10951 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10952 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10953 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10954 | "$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] | 10955 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10956 | -c "discarding invalid record (mac)" \ |
| 10957 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10958 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10959 | -c "HTTP/1.0 200 OK" \ |
| 10960 | -S "too many records with bad MAC" \ |
| 10961 | -S "Verification of the message MAC failed" |
| 10962 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10964 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10965 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10966 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10967 | "$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] | 10968 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10969 | -C "discarding invalid record (mac)" \ |
| 10970 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10971 | -S "Extra-header:" \ |
| 10972 | -C "HTTP/1.0 200 OK" \ |
| 10973 | -s "too many records with bad MAC" \ |
| 10974 | -s "Verification of the message MAC failed" |
| 10975 | |
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 | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10977 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10978 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10979 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10980 | "$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] | 10981 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10982 | -c "discarding invalid record (mac)" \ |
| 10983 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10984 | -s "Extra-header:" \ |
| 10985 | -c "HTTP/1.0 200 OK" \ |
| 10986 | -S "too many records with bad MAC" \ |
| 10987 | -S "Verification of the message MAC failed" |
| 10988 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10990 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10991 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10992 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10993 | "$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] | 10994 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10995 | -c "discarding invalid record (mac)" \ |
| 10996 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10997 | -s "Extra-header:" \ |
| 10998 | -c "HTTP/1.0 200 OK" \ |
| 10999 | -s "too many records with bad MAC" \ |
| 11000 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11003 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 11004 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 11005 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 11006 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11007 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11008 | -c "record from another epoch" \ |
| 11009 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11010 | -s "Extra-header:" \ |
| 11011 | -c "HTTP/1.0 200 OK" |
| 11012 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11013 | # Tests for reordering support with DTLS |
| 11014 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11015 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11017 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 11018 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11019 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11020 | hs_timeout=2500-60000" \ |
| 11021 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11022 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11023 | 0 \ |
| 11024 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11025 | -c "Next handshake message has been buffered - load"\ |
| 11026 | -S "Buffering HS message" \ |
| 11027 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11028 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11029 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11030 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11031 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11032 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11033 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11035 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 11036 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11037 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11038 | hs_timeout=2500-60000" \ |
| 11039 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11040 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11041 | 0 \ |
| 11042 | -c "Buffering HS message" \ |
| 11043 | -c "found fragmented DTLS handshake message"\ |
| 11044 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 11045 | -c "Next handshake message has been buffered - load"\ |
| 11046 | -S "Buffering HS message" \ |
| 11047 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11048 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11049 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11050 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11051 | -S "Remember CCS message" |
| 11052 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11053 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 11054 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 11055 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 11056 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11057 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11058 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11060 | 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] | 11061 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11062 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11063 | hs_timeout=2500-60000" \ |
| 11064 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11065 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11066 | 0 \ |
| 11067 | -c "Buffering HS message" \ |
| 11068 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11069 | -C "attempt to make space by freeing buffered messages" \ |
| 11070 | -S "Buffering HS message" \ |
| 11071 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11072 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11073 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11074 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11075 | -S "Remember CCS message" |
| 11076 | |
| 11077 | # The size constraints ensure that the delayed certificate message can't |
| 11078 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 11079 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11080 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11081 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 11082 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11084 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 11085 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11086 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11087 | hs_timeout=2500-60000" \ |
| 11088 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11089 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11090 | 0 \ |
| 11091 | -c "Buffering HS message" \ |
| 11092 | -c "attempt to make space by freeing buffered future messages" \ |
| 11093 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11094 | -S "Buffering HS message" \ |
| 11095 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11096 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11097 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11098 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11099 | -S "Remember CCS message" |
| 11100 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11101 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11103 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 11104 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11105 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 11106 | hs_timeout=2500-60000" \ |
| 11107 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11108 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11109 | 0 \ |
| 11110 | -C "Buffering HS message" \ |
| 11111 | -C "Next handshake message has been buffered - load"\ |
| 11112 | -s "Buffering HS message" \ |
| 11113 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11114 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11115 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11116 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11117 | -S "Remember CCS message" |
| 11118 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11119 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11121 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 11122 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11123 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11124 | hs_timeout=2500-60000" \ |
| 11125 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11126 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11127 | 0 \ |
| 11128 | -C "Buffering HS message" \ |
| 11129 | -C "Next handshake message has been buffered - load"\ |
| 11130 | -S "Buffering HS message" \ |
| 11131 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11132 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11133 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11134 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11135 | -S "Remember CCS message" |
| 11136 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11137 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11139 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 11140 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11141 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11142 | hs_timeout=2500-60000" \ |
| 11143 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11144 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11145 | 0 \ |
| 11146 | -C "Buffering HS message" \ |
| 11147 | -C "Next handshake message has been buffered - load"\ |
| 11148 | -S "Buffering HS message" \ |
| 11149 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11150 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11151 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11152 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11153 | -s "Remember CCS message" |
| 11154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11156 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11157 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11158 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11159 | hs_timeout=2500-60000" \ |
| 11160 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11161 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 11162 | 0 \ |
| 11163 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11164 | -s "Found buffered record from current epoch - load" \ |
| 11165 | -c "Buffer record from epoch 1" \ |
| 11166 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11167 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11168 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 11169 | # from the server are delayed, so that the encrypted Finished message |
| 11170 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 11171 | # in afterwards, the encrypted Finished message must be freed in order |
| 11172 | # to make space for the NewSessionTicket to be reassembled. |
| 11173 | # This works only in very particular circumstances: |
| 11174 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 11175 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 11176 | # the encrypted Finished message. |
| 11177 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 11178 | # needs to be fragmented. |
| 11179 | # - All messages sent by the server must be small enough to be either sent |
| 11180 | # without fragmentation or be reassembled within the bounds of |
| 11181 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 11182 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 11183 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 11184 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11186 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 11187 | -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] | 11188 | "$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] | 11189 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 11190 | 0 \ |
| 11191 | -s "Buffer record from epoch 1" \ |
| 11192 | -s "Found buffered record from current epoch - load" \ |
| 11193 | -c "Buffer record from epoch 1" \ |
| 11194 | -C "Found buffered record from current epoch - load" \ |
| 11195 | -c "Enough space available after freeing future epoch record" |
| 11196 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 11197 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 11198 | |
| 11199 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11201 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 11202 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11203 | "$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] | 11204 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11205 | "$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] | 11206 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11207 | 0 \ |
| 11208 | -s "Extra-header:" \ |
| 11209 | -c "HTTP/1.0 200 OK" |
| 11210 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11211 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11213 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 11214 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11215 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11216 | "$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] | 11217 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 11218 | 0 \ |
| 11219 | -s "Extra-header:" \ |
| 11220 | -c "HTTP/1.0 200 OK" |
| 11221 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11222 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11224 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 11225 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11226 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11227 | "$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] | 11228 | 0 \ |
| 11229 | -s "Extra-header:" \ |
| 11230 | -c "HTTP/1.0 200 OK" |
| 11231 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11232 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11234 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 11235 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11236 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 11237 | "$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] | 11238 | 0 \ |
| 11239 | -s "Extra-header:" \ |
| 11240 | -c "HTTP/1.0 200 OK" |
| 11241 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11242 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11244 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 11245 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11246 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 11247 | "$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] | 11248 | 0 \ |
| 11249 | -s "Extra-header:" \ |
| 11250 | -c "HTTP/1.0 200 OK" |
| 11251 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11252 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11254 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 11255 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11256 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 11257 | "$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] | 11258 | 0 \ |
| 11259 | -s "Extra-header:" \ |
| 11260 | -c "HTTP/1.0 200 OK" |
| 11261 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11262 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11264 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 11265 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11266 | "$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] | 11267 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11268 | "$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] | 11269 | 0 \ |
| 11270 | -s "Extra-header:" \ |
| 11271 | -c "HTTP/1.0 200 OK" |
| 11272 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11273 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11275 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11276 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 11277 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11278 | "$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] | 11279 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11280 | "$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] | 11281 | 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] | 11282 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11283 | 0 \ |
| 11284 | -s "a session has been resumed" \ |
| 11285 | -c "a session has been resumed" \ |
| 11286 | -s "Extra-header:" \ |
| 11287 | -c "HTTP/1.0 200 OK" |
| 11288 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11289 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11291 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11292 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 11293 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11294 | "$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] | 11295 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11296 | "$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] | 11297 | 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] | 11298 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 11299 | 0 \ |
| 11300 | -s "a session has been resumed" \ |
| 11301 | -c "a session has been resumed" \ |
| 11302 | -s "Extra-header:" \ |
| 11303 | -c "HTTP/1.0 200 OK" |
| 11304 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11305 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11306 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11307 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11308 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11309 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11310 | "$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] | 11311 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11312 | "$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] | 11313 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11314 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11315 | 0 \ |
| 11316 | -c "=> renegotiate" \ |
| 11317 | -s "=> renegotiate" \ |
| 11318 | -s "Extra-header:" \ |
| 11319 | -c "HTTP/1.0 200 OK" |
| 11320 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11321 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11322 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11324 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11325 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11326 | "$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] | 11327 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11328 | "$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] | 11329 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11330 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11331 | 0 \ |
| 11332 | -c "=> renegotiate" \ |
| 11333 | -s "=> renegotiate" \ |
| 11334 | -s "Extra-header:" \ |
| 11335 | -c "HTTP/1.0 200 OK" |
| 11336 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11337 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11338 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11340 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11341 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11342 | "$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] | 11343 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11344 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11345 | "$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] | 11346 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11347 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11348 | 0 \ |
| 11349 | -c "=> renegotiate" \ |
| 11350 | -s "=> renegotiate" \ |
| 11351 | -s "Extra-header:" \ |
| 11352 | -c "HTTP/1.0 200 OK" |
| 11353 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11354 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11355 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11357 | 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] | 11358 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11359 | "$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] | 11360 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11361 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11362 | "$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] | 11363 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11364 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11365 | 0 \ |
| 11366 | -c "=> renegotiate" \ |
| 11367 | -s "=> renegotiate" \ |
| 11368 | -s "Extra-header:" \ |
| 11369 | -c "HTTP/1.0 200 OK" |
| 11370 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11371 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11372 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11373 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11374 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11375 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11376 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11378 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11379 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11380 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11381 | "$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] | 11382 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11383 | -c "HTTP/1.0 200 OK" |
| 11384 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11385 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11386 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11387 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11389 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11390 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11391 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11392 | "$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] | 11393 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11394 | -c "HTTP/1.0 200 OK" |
| 11395 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11396 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11397 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11398 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11400 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11401 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11402 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11403 | "$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] | 11404 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11405 | -c "HTTP/1.0 200 OK" |
| 11406 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11407 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11408 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11409 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11411 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11412 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11413 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11414 | "$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] | 11415 | 0 \ |
| 11416 | -s "Extra-header:" \ |
| 11417 | -c "Extra-header:" |
| 11418 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11419 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11420 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11421 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11423 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11424 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11425 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11426 | "$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] | 11427 | 0 \ |
| 11428 | -s "Extra-header:" \ |
| 11429 | -c "Extra-header:" |
| 11430 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11431 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11432 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11433 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11435 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11436 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11437 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11438 | "$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] | 11439 | 0 \ |
| 11440 | -s "Extra-header:" \ |
| 11441 | -c "Extra-header:" |
| 11442 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11444 | run_test "export keys functionality" \ |
| 11445 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 11446 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 11447 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11448 | -c "EAP-TLS key material is:"\ |
| 11449 | -s "EAP-TLS key material is:"\ |
| 11450 | -c "EAP-TLS IV is:" \ |
| 11451 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11452 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11453 | # openssl feature tests: check if tls1.3 exists. |
| 11454 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11455 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11456 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11457 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11458 | 0 \ |
| 11459 | -c "TLS 1.3" \ |
| 11460 | -s "TLS 1.3" |
| 11461 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11462 | # 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] | 11463 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11464 | requires_gnutls_next_no_ticket |
| 11465 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11466 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11467 | "$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] | 11468 | "$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] | 11469 | 0 \ |
| 11470 | -s "Version: TLS1.3" \ |
| 11471 | -c "Version: TLS1.3" |
| 11472 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11473 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11474 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11475 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11476 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11477 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11478 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11479 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11480 | "$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] | 11481 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11482 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11483 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11484 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11485 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11486 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11487 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11488 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11489 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11490 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11491 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11492 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11493 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11494 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11495 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11496 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11497 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11498 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11499 | -c "=> parse certificate verify" \ |
| 11500 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11501 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11502 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11503 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11504 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11505 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11506 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11507 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11508 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11509 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11510 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11511 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11512 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11513 | "$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] | 11514 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11515 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11516 | -s "SERVER HELLO was queued" \ |
| 11517 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11518 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11519 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11520 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11521 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11522 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11523 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11524 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11525 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11526 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11527 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11528 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11529 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11530 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11531 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11532 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11533 | -c "=> parse certificate verify" \ |
| 11534 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11535 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11536 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11537 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11538 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11539 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11540 | requires_openssl_tls1_3 |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11541 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11542 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11543 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11544 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11545 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11546 | run_test "TLS 1.3: alpn - openssl" \ |
| 11547 | "$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] | 11548 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11549 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11550 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11551 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11552 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11553 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11554 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11555 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11556 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11557 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11558 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11559 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11560 | -c "<= ssl_tls13_process_server_hello" \ |
| 11561 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11562 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11563 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11564 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11565 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11566 | -c "=> parse certificate verify" \ |
| 11567 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11568 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11569 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11570 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11571 | -c "HTTP/1.0 200 ok" \ |
| 11572 | -c "Application Layer Protocol is h2" |
| 11573 | |
| 11574 | requires_gnutls_tls1_3 |
| 11575 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11576 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11577 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11578 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11579 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11580 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11581 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11582 | "$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] | 11583 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11584 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11585 | -s "SERVER HELLO was queued" \ |
| 11586 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11587 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11588 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11589 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11590 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11591 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11592 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11593 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11594 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11595 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11596 | -c "<= ssl_tls13_process_server_hello" \ |
| 11597 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11598 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11599 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11600 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11601 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11602 | -c "=> parse certificate verify" \ |
| 11603 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11604 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11605 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11606 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11607 | -c "HTTP/1.0 200 OK" \ |
| 11608 | -c "Application Layer Protocol is h2" |
| 11609 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11610 | requires_openssl_tls1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11611 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11612 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11613 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11614 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11615 | run_test "TLS 1.3: server alpn - openssl" \ |
| 11616 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11617 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11618 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11619 | -s "found alpn extension" \ |
| 11620 | -s "server side, adding alpn extension" \ |
| 11621 | -s "Protocol is TLSv1.3" \ |
| 11622 | -s "HTTP/1.0 200 OK" \ |
| 11623 | -s "Application Layer Protocol is h2" |
| 11624 | |
| 11625 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11626 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11627 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11628 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11629 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11630 | run_test "TLS 1.3: server alpn - gnutls" \ |
| 11631 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11632 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11633 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11634 | -s "found alpn extension" \ |
| 11635 | -s "server side, adding alpn extension" \ |
| 11636 | -s "Protocol is TLSv1.3" \ |
| 11637 | -s "HTTP/1.0 200 OK" \ |
| 11638 | -s "Application Layer Protocol is h2" |
| 11639 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11641 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11642 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11643 | skip_handshake_stage_check |
| 11644 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11645 | 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] | 11646 | "$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] | 11647 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11648 | 1 \ |
| 11649 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11650 | -S "Version: TLS1.0" \ |
| 11651 | -C "Protocol is TLSv1.0" |
| 11652 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11654 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11655 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11656 | skip_handshake_stage_check |
| 11657 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11658 | 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] | 11659 | "$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] | 11660 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11661 | 1 \ |
| 11662 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11663 | -S "Version: TLS1.1" \ |
| 11664 | -C "Protocol is TLSv1.1" |
| 11665 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11667 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11668 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11669 | skip_handshake_stage_check |
| 11670 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11671 | 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] | 11672 | "$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] | 11673 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11674 | 1 \ |
| 11675 | -s "Client's version: 3.3" \ |
| 11676 | -c "is a fatal alert message (msg 40)" \ |
| 11677 | -S "Version: TLS1.2" \ |
| 11678 | -C "Protocol is TLSv1.2" |
| 11679 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11681 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11682 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11683 | skip_handshake_stage_check |
| 11684 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11685 | 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] | 11686 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11687 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11688 | 1 \ |
| 11689 | -s "fatal protocol_version" \ |
| 11690 | -c "is a fatal alert message (msg 70)" \ |
| 11691 | -S "Version: TLS1.0" \ |
| 11692 | -C "Protocol : TLSv1.0" |
| 11693 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11695 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11696 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11697 | skip_handshake_stage_check |
| 11698 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11699 | 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] | 11700 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11701 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11702 | 1 \ |
| 11703 | -s "fatal protocol_version" \ |
| 11704 | -c "is a fatal alert message (msg 70)" \ |
| 11705 | -S "Version: TLS1.1" \ |
| 11706 | -C "Protocol : TLSv1.1" |
| 11707 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11709 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11710 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11711 | skip_handshake_stage_check |
| 11712 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11713 | 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] | 11714 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11715 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11716 | 1 \ |
| 11717 | -s "fatal protocol_version" \ |
| 11718 | -c "is a fatal alert message (msg 70)" \ |
| 11719 | -S "Version: TLS1.2" \ |
| 11720 | -C "Protocol : TLSv1.2" |
| 11721 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11722 | requires_openssl_tls1_3 |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11723 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11724 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11725 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11726 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11727 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11728 | "$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] | 11729 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11730 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11731 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11732 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11733 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11734 | -c "HTTP/1.0 200 ok" \ |
| 11735 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11736 | |
| 11737 | requires_gnutls_tls1_3 |
| 11738 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11739 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11740 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11741 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11742 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11743 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11744 | "$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] | 11745 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11746 | 0 \ |
| 11747 | -c "got a certificate request" \ |
| 11748 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11749 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11750 | -c "HTTP/1.0 200 OK" \ |
| 11751 | -c "Protocol is TLSv1.3" |
| 11752 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11753 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11754 | requires_openssl_tls1_3 |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11755 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11756 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11757 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11758 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11759 | "$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] | 11760 | "$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] | 11761 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11762 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11763 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11764 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11765 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11766 | |
| 11767 | requires_gnutls_tls1_3 |
| 11768 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11769 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11770 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11771 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11772 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11773 | "$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] | 11774 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11775 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11776 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11777 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11778 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11779 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11780 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11781 | |
| 11782 | requires_openssl_tls1_3 |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11783 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11784 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11785 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11786 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11787 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11788 | "$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] | 11789 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11790 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11791 | 0 \ |
| 11792 | -c "got a certificate request" \ |
| 11793 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11794 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11795 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11796 | |
| 11797 | requires_gnutls_tls1_3 |
| 11798 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11799 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11800 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11801 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11802 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11803 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11804 | "$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] | 11805 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11806 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11807 | 0 \ |
| 11808 | -c "got a certificate request" \ |
| 11809 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11810 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11811 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11812 | |
| 11813 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11814 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11815 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11816 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11817 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11818 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11819 | "$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] | 11820 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11821 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11822 | 0 \ |
| 11823 | -c "got a certificate request" \ |
| 11824 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11825 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11826 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11827 | |
| 11828 | requires_gnutls_tls1_3 |
| 11829 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11830 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11831 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11832 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11833 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11834 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11835 | "$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] | 11836 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11837 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11838 | 0 \ |
| 11839 | -c "got a certificate request" \ |
| 11840 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11841 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11842 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11843 | |
| 11844 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11845 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11846 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11847 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11848 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11849 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11850 | "$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] | 11851 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11852 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11853 | 0 \ |
| 11854 | -c "got a certificate request" \ |
| 11855 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11856 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11857 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11858 | |
| 11859 | requires_gnutls_tls1_3 |
| 11860 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11861 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11862 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11863 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11864 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11865 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11866 | "$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] | 11867 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11868 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11869 | 0 \ |
| 11870 | -c "got a certificate request" \ |
| 11871 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11872 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11873 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11874 | |
| 11875 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11876 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11877 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11878 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11879 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11880 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11881 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11882 | "$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] | 11883 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11884 | 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] | 11885 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11886 | -c "got a certificate request" \ |
| 11887 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11888 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11889 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11890 | |
| 11891 | requires_gnutls_tls1_3 |
| 11892 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11893 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11894 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11895 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11896 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11897 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11898 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11899 | "$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] | 11900 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11901 | 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] | 11902 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11903 | -c "got a certificate request" \ |
| 11904 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11905 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11906 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11907 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11908 | requires_openssl_tls1_3 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11909 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11910 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11911 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11912 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11913 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11914 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11915 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11916 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11917 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11918 | 0 \ |
| 11919 | -c "got a certificate request" \ |
| 11920 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11921 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11922 | -c "Protocol is TLSv1.3" |
| 11923 | |
| 11924 | requires_gnutls_tls1_3 |
| 11925 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11926 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11927 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11928 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11929 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11930 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11931 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11932 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11933 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11934 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11935 | 0 \ |
| 11936 | -c "got a certificate request" \ |
| 11937 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11938 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11939 | -c "Protocol is TLSv1.3" |
| 11940 | |
| 11941 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11942 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11943 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11944 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11945 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11946 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11947 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11948 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11949 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11950 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11951 | 0 \ |
| 11952 | -c "got a certificate request" \ |
| 11953 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11954 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11955 | -c "Protocol is TLSv1.3" |
| 11956 | |
| 11957 | requires_gnutls_tls1_3 |
| 11958 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11959 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11960 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11961 | requires_config_enabled MBEDTLS_RSA_C |
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 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11964 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - 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_sha512" \ |
| 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 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11975 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11976 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11977 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11978 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11979 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11980 | 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] | 11981 | "$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] | 11982 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11983 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11984 | 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] | 11985 | 1 \ |
| 11986 | -c "got a certificate request" \ |
| 11987 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11988 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11989 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11990 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11991 | |
| 11992 | requires_gnutls_tls1_3 |
| 11993 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11994 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11995 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11996 | requires_config_enabled MBEDTLS_RSA_C |
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 |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11999 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 12000 | "$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] | 12001 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 12002 | 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] | 12003 | 1 \ |
| 12004 | -c "got a certificate request" \ |
| 12005 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12006 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12007 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 12008 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12009 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12010 | # Test using an opaque private key for client authentication |
| 12011 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12012 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12013 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12014 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12015 | requires_config_enabled 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, no server middlebox compat - openssl" \ |
| 12017 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 12018 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 12019 | 0 \ |
| 12020 | -c "got a certificate request" \ |
| 12021 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12022 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12023 | -c "Protocol is TLSv1.3" |
| 12024 | |
| 12025 | requires_gnutls_tls1_3 |
| 12026 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12027 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12028 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12029 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12030 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12031 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 12032 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 12033 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 12034 | key_file=data_files/cli2.key key_opaque=1" \ |
| 12035 | 0 \ |
| 12036 | -c "got a certificate request" \ |
| 12037 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12038 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12039 | -c "Protocol is TLSv1.3" |
| 12040 | |
| 12041 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12042 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12043 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12044 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12045 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12046 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12047 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 12048 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12049 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 12050 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 12051 | 0 \ |
| 12052 | -c "got a certificate request" \ |
| 12053 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12054 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12055 | -c "Protocol is TLSv1.3" |
| 12056 | |
| 12057 | requires_gnutls_tls1_3 |
| 12058 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12059 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12060 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12061 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12062 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12063 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12064 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 12065 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12066 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 12067 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 12068 | 0 \ |
| 12069 | -c "got a certificate request" \ |
| 12070 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12071 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12072 | -c "Protocol is TLSv1.3" |
| 12073 | |
| 12074 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12075 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12076 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12077 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12078 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12079 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12080 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 12081 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12082 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 12083 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 12084 | 0 \ |
| 12085 | -c "got a certificate request" \ |
| 12086 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12087 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12088 | -c "Protocol is TLSv1.3" |
| 12089 | |
| 12090 | requires_gnutls_tls1_3 |
| 12091 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12092 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12093 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12094 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12095 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12096 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12097 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 12098 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12099 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 12100 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 12101 | 0 \ |
| 12102 | -c "got a certificate request" \ |
| 12103 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12104 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12105 | -c "Protocol is TLSv1.3" |
| 12106 | |
| 12107 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12108 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12109 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12110 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12111 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12112 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12113 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 12114 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12115 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12116 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 12117 | 0 \ |
| 12118 | -c "got a certificate request" \ |
| 12119 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12120 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12121 | -c "Protocol is TLSv1.3" |
| 12122 | |
| 12123 | requires_gnutls_tls1_3 |
| 12124 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12125 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12126 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12127 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12128 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12129 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12130 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 12131 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12132 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12133 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 12134 | 0 \ |
| 12135 | -c "got a certificate request" \ |
| 12136 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12137 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12138 | -c "Protocol is TLSv1.3" |
| 12139 | |
| 12140 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12141 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12142 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12143 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12144 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12145 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12146 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12147 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 12148 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12149 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 12150 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 12151 | 0 \ |
| 12152 | -c "got a certificate request" \ |
| 12153 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12154 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12155 | -c "Protocol is TLSv1.3" |
| 12156 | |
| 12157 | requires_gnutls_tls1_3 |
| 12158 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12159 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12160 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12161 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12162 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12163 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12164 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12165 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 12166 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12167 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 12168 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 12169 | 0 \ |
| 12170 | -c "got a certificate request" \ |
| 12171 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12172 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12173 | -c "Protocol is TLSv1.3" |
| 12174 | |
| 12175 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12176 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12177 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12178 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12179 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12180 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12181 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12182 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 12183 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12184 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 12185 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12186 | 0 \ |
| 12187 | -c "got a certificate request" \ |
| 12188 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12189 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12190 | -c "Protocol is TLSv1.3" |
| 12191 | |
| 12192 | requires_gnutls_tls1_3 |
| 12193 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12194 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12195 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12196 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12197 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12198 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12199 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12200 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 12201 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12202 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 12203 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12204 | 0 \ |
| 12205 | -c "got a certificate request" \ |
| 12206 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12207 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12208 | -c "Protocol is TLSv1.3" |
| 12209 | |
| 12210 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12211 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12212 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12213 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12214 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12215 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12216 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12217 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 12218 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12219 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 12220 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12221 | 0 \ |
| 12222 | -c "got a certificate request" \ |
| 12223 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12224 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12225 | -c "Protocol is TLSv1.3" |
| 12226 | |
| 12227 | requires_gnutls_tls1_3 |
| 12228 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12229 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12230 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12231 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12232 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12233 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12234 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12235 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 12236 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12237 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 12238 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12239 | 0 \ |
| 12240 | -c "got a certificate request" \ |
| 12241 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12242 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12243 | -c "Protocol is TLSv1.3" |
| 12244 | |
| 12245 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12246 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12247 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12248 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12249 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12250 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12251 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12252 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12253 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12254 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 12255 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12256 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12257 | 1 \ |
| 12258 | -c "got a certificate request" \ |
| 12259 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12260 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12261 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12262 | -C "unkown pk type" |
| 12263 | |
| 12264 | requires_gnutls_tls1_3 |
| 12265 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12266 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12267 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12268 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12269 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12270 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12271 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12272 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 12273 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 12274 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12275 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12276 | 1 \ |
| 12277 | -c "got a certificate request" \ |
| 12278 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12279 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12280 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12281 | -C "unkown pk type" |
| 12282 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12283 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12284 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12285 | requires_config_enabled MBEDTLS_SSL_CLI_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 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12288 | 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] | 12289 | "$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] | 12290 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12291 | 0 \ |
| 12292 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12293 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12294 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12295 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12296 | -c "HTTP/1.0 200 ok" |
| 12297 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12298 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12299 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12300 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12301 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12302 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12303 | 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] | 12304 | "$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] | 12305 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12306 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12307 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12308 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12309 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12310 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12311 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12312 | |
| 12313 | requires_gnutls_tls1_3 |
| 12314 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12315 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12316 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12317 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12318 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12319 | 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] | 12320 | "$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] | 12321 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12322 | 0 \ |
| 12323 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12324 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12325 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12326 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12327 | -c "HTTP/1.0 200 OK" |
| 12328 | |
| 12329 | requires_gnutls_tls1_3 |
| 12330 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12331 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12332 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12333 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12334 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12335 | 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] | 12336 | "$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] | 12337 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12338 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12339 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12340 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12341 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12342 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12343 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12344 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12345 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12346 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12347 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12348 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12349 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12350 | "$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] | 12351 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12352 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12353 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12354 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12355 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12356 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12357 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12358 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12359 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12360 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12361 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12362 | requires_openssl_tls1_3 |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12363 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12364 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12365 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12366 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12367 | "$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] | 12368 | "$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] | 12369 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12370 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12371 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12372 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12373 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12374 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12375 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12376 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12377 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12378 | -s "=> parse client hello" \ |
| 12379 | -s "<= parse client hello" |
| 12380 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12381 | requires_gnutls_tls1_3 |
| 12382 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12383 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12384 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12385 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12386 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12387 | "$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] | 12388 | "$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] | 12389 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12390 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12391 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12392 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12393 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12394 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12395 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12396 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12397 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12398 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12399 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12400 | requires_gnutls_tls1_3 |
| 12401 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12402 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12403 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12404 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12405 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12406 | "$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" \ |
| 12407 | "$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] | 12408 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12409 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12410 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12411 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12412 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12413 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12414 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12415 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12416 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12417 | -s "=> parse client hello" \ |
| 12418 | -s "<= parse client hello" |
| 12419 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12420 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12421 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12422 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12423 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12424 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 12425 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12426 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12427 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12428 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12429 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12430 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12431 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12432 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12433 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12434 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12435 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12436 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12437 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12438 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12439 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12440 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12441 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12442 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12443 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12444 | "$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" \ |
| 12445 | "$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] | 12446 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12447 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12448 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12449 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12450 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12451 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12452 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12453 | -s "=> parse client hello" \ |
| 12454 | -s "<= parse client hello" |
| 12455 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12456 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12457 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12458 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12459 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12460 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 12461 | "$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" \ |
| 12462 | "$P_CLI debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12463 | 1 \ |
| 12464 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12465 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12466 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12467 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12468 | -s "=> write certificate request" \ |
| 12469 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12470 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12471 | -s "=> parse client hello" \ |
| 12472 | -s "<= parse client hello" |
| 12473 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12474 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12475 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12476 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12477 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12478 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 12479 | "$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" \ |
| 12480 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none key_file=none" \ |
| 12481 | 0 \ |
| 12482 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12483 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12484 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12485 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12486 | -s "=> write certificate request" \ |
| 12487 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12488 | -s "=> parse client hello" \ |
| 12489 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12490 | |
| 12491 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12492 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12493 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12494 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12495 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 12496 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 12497 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12498 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12499 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12500 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12501 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12502 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12503 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12504 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12505 | -s "=> write hello retry request" \ |
| 12506 | -s "<= write hello retry request" |
| 12507 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12508 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12509 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12510 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12511 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12512 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 12513 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12514 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 12515 | 1 \ |
| 12516 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12517 | -s "No certificate available." |
| 12518 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12519 | requires_openssl_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12520 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12521 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12522 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12523 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12524 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12525 | "$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] | 12526 | 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] | 12527 | "$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" \ |
| 12528 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12529 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12530 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12531 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12532 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12533 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12534 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12535 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12536 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12537 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12538 | "$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] | 12539 | 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] | 12540 | "$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" \ |
| 12541 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12542 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12543 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12544 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12545 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12546 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12547 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12548 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12549 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12550 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12551 | "$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 \ |
| 12552 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12553 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 12554 | force_version=tls13" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12555 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12556 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12557 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12558 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12559 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12560 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12561 | TEST_SUITE_NAME=${i##*/} |
| 12562 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12563 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12564 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12565 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12566 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12567 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12568 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12569 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12570 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12571 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12572 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12573 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
| 12574 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12575 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12576 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12577 | -s "Protocol is TLSv1.3" \ |
| 12578 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12579 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12580 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12581 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12582 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12583 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12584 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12585 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12586 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12587 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
| 12588 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12589 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12590 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12591 | -s "Protocol is TLSv1.3" \ |
| 12592 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12593 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12594 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12595 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12596 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12597 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12598 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12599 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12600 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12601 | 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] | 12602 | "$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] | 12603 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12604 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12605 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12606 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12607 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12608 | |
| 12609 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12610 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12611 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12612 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12613 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12614 | 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] | 12615 | "$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] | 12616 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12617 | 1 \ |
| 12618 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12619 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12620 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12621 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12622 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12623 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12624 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12625 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12626 | "$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] | 12627 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12628 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12629 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12630 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12631 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12632 | requires_gnutls_tls1_3 |
| 12633 | requires_gnutls_next_no_ticket |
| 12634 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12635 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12636 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12637 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12638 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12639 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12640 | "$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] | 12641 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12642 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12643 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12644 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12645 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12646 | |
| 12647 | requires_gnutls_tls1_3 |
| 12648 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12649 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12650 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12651 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12652 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12653 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12654 | "$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] | 12655 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12656 | 1 \ |
| 12657 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12658 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12659 | requires_gnutls_tls1_3 |
| 12660 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12661 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12662 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12663 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12664 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12665 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12666 | "$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] | 12667 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12668 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12669 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12670 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12671 | |
| 12672 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12673 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12674 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12675 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12676 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12677 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
| 12678 | "$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] | 12679 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12680 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12681 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12682 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12683 | -C "14 03 03 00 01" |
| 12684 | |
| 12685 | requires_openssl_tls1_3 |
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 O->m 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 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12692 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
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 | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12695 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12696 | |
| 12697 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12698 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12699 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12700 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12701 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12702 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
| 12703 | "$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] | 12704 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12705 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12706 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12707 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12708 | -c "14 03 03 00 01" |
| 12709 | |
| 12710 | requires_gnutls_tls1_3 |
| 12711 | requires_gnutls_next_no_ticket |
| 12712 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12713 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12714 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12715 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12716 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12717 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
| 12718 | "$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] | 12719 | "$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] | 12720 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12721 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12722 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12723 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12724 | |
| 12725 | requires_gnutls_tls1_3 |
| 12726 | requires_gnutls_next_no_ticket |
| 12727 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12728 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12729 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12730 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12731 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12732 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
| 12733 | "$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] | 12734 | "$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] | 12735 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12736 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12737 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12738 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12739 | -c "discarding change cipher spec in TLS1.3" |
| 12740 | |
| 12741 | requires_gnutls_tls1_3 |
| 12742 | requires_gnutls_next_no_ticket |
| 12743 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12744 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12745 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12746 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12747 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12748 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
| 12749 | "$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] | 12750 | "$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] | 12751 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12752 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12753 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12754 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12755 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12756 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12757 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12758 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12759 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12760 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12761 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
| 12762 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12763 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12764 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12765 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12766 | -c "Protocol is TLSv1.3" \ |
| 12767 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12768 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12769 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12770 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12771 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12772 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12773 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12774 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12775 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12776 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
| 12777 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12778 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12779 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12780 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12781 | -c "Protocol is TLSv1.3" \ |
| 12782 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12783 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12784 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12785 | |
| 12786 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12787 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12788 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12789 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12790 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12791 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12792 | "$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] | 12793 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12794 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12795 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12796 | -c "received HelloRetryRequest message" \ |
| 12797 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12798 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12799 | |
| 12800 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12801 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12802 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12803 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12804 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12805 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12806 | "$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] | 12807 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12808 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12809 | -c "received HelloRetryRequest message" \ |
| 12810 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12811 | |
| 12812 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12813 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12814 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12815 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12816 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12817 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12818 | "$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] | 12819 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12820 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12821 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12822 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12823 | |
| 12824 | requires_gnutls_tls1_3 |
| 12825 | requires_gnutls_next_no_ticket |
| 12826 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12827 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12828 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12829 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12830 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12831 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12832 | "$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] | 12833 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12834 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12835 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12836 | -c "received HelloRetryRequest message" \ |
| 12837 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12838 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12839 | |
| 12840 | requires_gnutls_tls1_3 |
| 12841 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12842 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12843 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12844 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12845 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12846 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12847 | "$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] | 12848 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12849 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12850 | -c "received HelloRetryRequest message" \ |
| 12851 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12852 | |
| 12853 | requires_gnutls_tls1_3 |
| 12854 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12855 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12856 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12857 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12858 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12859 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12860 | "$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] | 12861 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12862 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12863 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12864 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12865 | |
| 12866 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12867 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12868 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12869 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12870 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12871 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
| 12872 | "$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] | 12873 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12874 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12875 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12876 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12877 | -C "14 03 03 00 01" |
| 12878 | |
| 12879 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12880 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12881 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12882 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12883 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12884 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
| 12885 | "$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] | 12886 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12887 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12888 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12889 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12890 | |
| 12891 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12892 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12893 | requires_config_enabled MBEDTLS_SSL_SRV_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 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12896 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
| 12897 | "$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] | 12898 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12899 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12900 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12901 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12902 | -c "14 03 03 00 01" |
| 12903 | |
| 12904 | requires_gnutls_tls1_3 |
| 12905 | requires_gnutls_next_no_ticket |
| 12906 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12907 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12908 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12909 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12910 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12911 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
| 12912 | "$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] | 12913 | "$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] | 12914 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12915 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12916 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12917 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12918 | |
| 12919 | requires_gnutls_tls1_3 |
| 12920 | requires_gnutls_next_no_ticket |
| 12921 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12922 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12923 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12924 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12925 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12926 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
| 12927 | "$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] | 12928 | "$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] | 12929 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12930 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12931 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12932 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12933 | -c "discarding change cipher spec in TLS1.3" |
| 12934 | |
| 12935 | requires_gnutls_tls1_3 |
| 12936 | requires_gnutls_next_no_ticket |
| 12937 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12938 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12939 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12940 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12941 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12942 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
| 12943 | "$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] | 12944 | "$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] | 12945 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12946 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12947 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12948 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12949 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12950 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [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 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12955 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12956 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12957 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12958 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12959 | "$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] | 12960 | 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] | 12961 | 0 \ |
| 12962 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12963 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12964 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12965 | |
| 12966 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12967 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12968 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12969 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12970 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12971 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12972 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12973 | -d 4 |
| 12974 | --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 " \ |
| 12975 | "$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] | 12976 | 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] | 12977 | 0 \ |
| 12978 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12979 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12980 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12981 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12982 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12983 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12984 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12985 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12986 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12987 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
| 12988 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12989 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12990 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12991 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12992 | "$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] | 12993 | 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] | 12994 | 0 \ |
| 12995 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12996 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 12997 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12998 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12999 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13000 | |
| 13001 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13002 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13003 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13004 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13005 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13006 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
| 13007 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13008 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13009 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13010 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13011 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13012 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 13013 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 13014 | 0 \ |
| 13015 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13016 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13017 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13018 | |
| 13019 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13020 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13021 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13022 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13023 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13024 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
| 13025 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13026 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13027 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13028 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13029 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13030 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 13031 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 13032 | 0 \ |
| 13033 | -c "Negotiated version: 3.4" \ |
| 13034 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13035 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13036 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13037 | |
| 13038 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13039 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13040 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13041 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13042 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13043 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
| 13044 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13045 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13046 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13047 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 13048 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13049 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 13050 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 13051 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13052 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13053 | |
| 13054 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13055 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13056 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13057 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13058 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13059 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
| 13060 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13061 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13062 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13063 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 13064 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13065 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 13066 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 13067 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13068 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13069 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13070 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13071 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13072 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13073 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13074 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13075 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
| 13076 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13077 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13078 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13079 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 13080 | "$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] | 13081 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13082 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13083 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13084 | |
| 13085 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13086 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13087 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13088 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13089 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13090 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
| 13091 | "$P_SRV debug_level=4 force_version=tls13 |
| 13092 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13093 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13094 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13095 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 13096 | 1 \ |
| 13097 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13098 | |
| 13099 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13100 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13101 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13102 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13103 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13104 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
| 13105 | "$P_SRV debug_level=4 force_version=tls13 |
| 13106 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13107 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13108 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13109 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 13110 | 1 \ |
| 13111 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13112 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13113 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13114 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13115 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13116 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13117 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13118 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
| 13119 | "$P_SRV debug_level=4 force_version=tls13 |
| 13120 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13121 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13122 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13123 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13124 | 1 \ |
| 13125 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13126 | |
| 13127 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13128 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13129 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13130 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13131 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13132 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 13133 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13134 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13135 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 13136 | "$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] | 13137 | 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] | 13138 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13139 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13140 | |
| 13141 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13142 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13143 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13144 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13145 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13146 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 13147 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13148 | -d 4 |
| 13149 | --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 " \ |
| 13150 | "$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] | 13151 | 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] | 13152 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13153 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13154 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13155 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13156 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13157 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13158 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13159 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13160 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
| 13161 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13162 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13163 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13164 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 13165 | "$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] | 13166 | 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] | 13167 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13168 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13169 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13170 | requires_openssl_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13171 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13172 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13173 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13174 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13175 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13176 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13177 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 13178 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13179 | 0 \ |
| 13180 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13181 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13182 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13183 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13184 | -c "HTTP/1.0 200 ok" |
| 13185 | |
| 13186 | requires_gnutls_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13187 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13188 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13189 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13190 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13191 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13192 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Ronald Cron | a709a0f | 2022-09-27 16:46:11 +0200 | [diff] [blame] | 13193 | "$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] | 13194 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13195 | 0 \ |
| 13196 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13197 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13198 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13199 | -c "Reconnecting with saved session" \ |
| 13200 | -c "HTTP/1.0 200 OK" \ |
| 13201 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13202 | |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13203 | requires_openssl_tls1_3 |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13204 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13205 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13206 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13207 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13208 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13209 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13210 | # https://github.com/openssl/openssl/issues/10714 |
| 13211 | # Until now, OpenSSL client does not support reconnect. |
| 13212 | skip_next_test |
| 13213 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
| 13214 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 13215 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 13216 | 0 \ |
| 13217 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13218 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13219 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13220 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13221 | requires_gnutls_tls1_3 |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13222 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13223 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13224 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13225 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13226 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13227 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13228 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13229 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 13230 | "$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] | 13231 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13232 | -c "Connecting again- trying to resume previous session" \ |
| 13233 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13234 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13235 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13236 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13237 | -s "key exchange mode: ephemeral" \ |
| 13238 | -s "key exchange mode: psk_ephemeral" \ |
| 13239 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13240 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13241 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13242 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13243 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13244 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13245 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13246 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13247 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13248 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13249 | "$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] | 13250 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13251 | 0 \ |
| 13252 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13253 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13254 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13255 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13256 | -c "HTTP/1.0 200 OK" \ |
| 13257 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13258 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13259 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13260 | -s "key exchange mode: ephemeral" \ |
| 13261 | -s "key exchange mode: psk_ephemeral" \ |
| 13262 | -s "found pre_shared_key extension" |
| 13263 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13264 | requires_openssl_tls1_3 |
| 13265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13266 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13267 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13268 | 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] | 13269 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13270 | -msg -tls1_2 |
| 13271 | -Verify 10 " \ |
| 13272 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13273 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13274 | min_version=tls12 max_version=tls13 " \ |
| 13275 | 0 \ |
| 13276 | -c "Protocol is TLSv1.2" \ |
| 13277 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13278 | |
| 13279 | |
| 13280 | requires_gnutls_tls1_3 |
| 13281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13282 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13283 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13284 | 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] | 13285 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13286 | -d 4 |
| 13287 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 13288 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13289 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13290 | min_version=tls12 max_version=tls13 " \ |
| 13291 | 0 \ |
| 13292 | -c "Protocol is TLSv1.2" \ |
| 13293 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13294 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13295 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13296 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13297 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13298 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13299 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13300 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13301 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13302 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13303 | "$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] | 13304 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 13305 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 13306 | 0 \ |
| 13307 | -c "Protocol is TLSv1.3" \ |
| 13308 | -c "got new session ticket." \ |
| 13309 | -c "Saving session for reuse... ok" \ |
| 13310 | -c "Reconnecting with saved session" \ |
| 13311 | -c "HTTP/1.0 200 OK" \ |
| 13312 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13313 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13314 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13315 | -s "key exchange mode: ephemeral" \ |
| 13316 | -s "key exchange mode: psk_ephemeral" \ |
| 13317 | -s "found pre_shared_key extension" |
| 13318 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13319 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13320 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13321 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13322 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13323 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13324 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13325 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13326 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13327 | "$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] | 13328 | 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] | 13329 | "$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] | 13330 | 1 \ |
| 13331 | -c "Protocol is TLSv1.3" \ |
| 13332 | -c "got new session ticket." \ |
| 13333 | -c "Saving session for reuse... ok" \ |
| 13334 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13335 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13336 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13337 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13338 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13339 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13340 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13341 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13342 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13343 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13344 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13345 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13346 | run_tests_memory_after_hanshake |
| 13347 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13348 | # Final report |
| 13349 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13350 | echo "------------------------------------------------------------------------" |
| 13351 | |
| 13352 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13353 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13354 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13355 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13356 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 13357 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 13358 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13359 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 13360 | if [ $FAILS -gt 255 ]; then |
| 13361 | # Clamp at 255 as caller gets exit code & 0xFF |
| 13362 | # (so 256 would be 0, or success, etc) |
| 13363 | FAILS=255 |
| 13364 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13365 | exit $FAILS |