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 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 180 | --port) |
| 181 | shift; SRV_PORT=$1 |
| 182 | ;; |
| 183 | --proxy-port) |
| 184 | shift; PXY_PORT=$1 |
| 185 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 186 | --seed) |
| 187 | shift; SEED="$1" |
| 188 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 189 | -h|--help) |
| 190 | print_usage |
| 191 | exit 0 |
| 192 | ;; |
| 193 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 194 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 195 | print_usage |
| 196 | exit 1 |
| 197 | ;; |
| 198 | esac |
| 199 | shift |
| 200 | done |
| 201 | } |
| 202 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 203 | # Make the outcome file path relative to the original directory, not |
| 204 | # to .../tests |
| 205 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 206 | [!/]*) |
| 207 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 208 | ;; |
| 209 | esac |
| 210 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 211 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 212 | # testing. Skip non-boolean options (with something other than spaces |
| 213 | # and a comment after "#define SYMBOL"). The variable contains a |
| 214 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 215 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 216 | # Skip next test; use this macro to skip tests which are legitimate |
| 217 | # in theory and expected to be re-introduced at some point, but |
| 218 | # aren't expected to succeed at the moment due to problems outside |
| 219 | # our control (such as bugs in other TLS implementations). |
| 220 | skip_next_test() { |
| 221 | SKIP_NEXT="YES" |
| 222 | } |
| 223 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 224 | # Check if the required configuration ($1) is enabled |
| 225 | is_config_enabled() |
| 226 | { |
| 227 | case $CONFIGS_ENABLED in |
| 228 | *" $1"[\ =]*) return 0;; |
| 229 | *) return 1;; |
| 230 | esac |
| 231 | } |
| 232 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 233 | # 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] | 234 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 235 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 236 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 237 | *) SKIP_NEXT="YES";; |
| 238 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 239 | } |
| 240 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 241 | # 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] | 242 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 243 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 244 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 245 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 246 | } |
| 247 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 248 | requires_all_configs_enabled() { |
| 249 | if ! $P_QUERY -all $* |
| 250 | then |
| 251 | SKIP_NEXT="YES" |
| 252 | fi |
| 253 | } |
| 254 | |
| 255 | requires_all_configs_disabled() { |
| 256 | if $P_QUERY -any $* |
| 257 | then |
| 258 | SKIP_NEXT="YES" |
| 259 | fi |
| 260 | } |
| 261 | |
| 262 | requires_any_configs_enabled() { |
| 263 | if ! $P_QUERY -any $* |
| 264 | then |
| 265 | SKIP_NEXT="YES" |
| 266 | fi |
| 267 | } |
| 268 | |
| 269 | requires_any_configs_disabled() { |
| 270 | if $P_QUERY -all $* |
| 271 | then |
| 272 | SKIP_NEXT="YES" |
| 273 | fi |
| 274 | } |
| 275 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 276 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 277 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 278 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 279 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 280 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 281 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 282 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 283 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 284 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 285 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 286 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 287 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 288 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 289 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 290 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 291 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 292 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 293 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 294 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 295 | then |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 296 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 297 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 298 | then |
| 299 | SKIP_NEXT="YES" |
| 300 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 301 | } |
| 302 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 303 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 304 | # This function uses the query_config command line option to query the |
| 305 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 306 | # program. The command will always return a success value if the |
| 307 | # configuration is defined and the value will be printed to stdout. |
| 308 | # |
| 309 | # Note that if the configuration is not defined or is defined to nothing, |
| 310 | # the output of this function will be an empty string. |
| 311 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 315 | VAL="$( get_config_value_or_default "$1" )" |
| 316 | if [ -z "$VAL" ]; then |
| 317 | # Should never happen |
| 318 | echo "Mbed TLS configuration $1 is not defined" |
| 319 | exit 1 |
| 320 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 321 | SKIP_NEXT="YES" |
| 322 | fi |
| 323 | } |
| 324 | |
| 325 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 326 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 327 | if [ -z "$VAL" ]; then |
| 328 | # Should never happen |
| 329 | echo "Mbed TLS configuration $1 is not defined" |
| 330 | exit 1 |
| 331 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 332 | SKIP_NEXT="YES" |
| 333 | fi |
| 334 | } |
| 335 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 336 | requires_config_value_equals() { |
| 337 | VAL=$( get_config_value_or_default "$1" ) |
| 338 | if [ -z "$VAL" ]; then |
| 339 | # Should never happen |
| 340 | echo "Mbed TLS configuration $1 is not defined" |
| 341 | exit 1 |
| 342 | elif [ "$VAL" -ne "$2" ]; then |
| 343 | SKIP_NEXT="YES" |
| 344 | fi |
| 345 | } |
| 346 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 347 | # Require Mbed TLS to support the given protocol version. |
| 348 | # |
| 349 | # Inputs: |
| 350 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 351 | requires_protocol_version() { |
| 352 | # Support for DTLS is detected separately in detect_dtls(). |
| 353 | case "$1" in |
| 354 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 355 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 356 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 357 | esac |
| 358 | } |
| 359 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 360 | # Space-separated list of ciphersuites supported by this build of |
| 361 | # Mbed TLS. |
| 362 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 363 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 364 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 365 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 366 | case $P_CIPHERSUITES in |
| 367 | *" $1 "*) :;; |
| 368 | *) SKIP_NEXT="YES";; |
| 369 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 370 | } |
| 371 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 372 | # Automatically detect required features based on command line parameters. |
| 373 | # Parameters are: |
| 374 | # - $1 = command line (call to a TLS client or server program) |
| 375 | # - $2 = client/server |
| 376 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 377 | # - $4 = Use an external tool without ECDH support |
| 378 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 379 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 380 | CMD_LINE=$1 |
| 381 | ROLE=$2 |
| 382 | TLS_VERSION=$3 |
| 383 | EXT_WO_ECDH=$4 |
| 384 | TEST_OPTIONS=${5:-} |
| 385 | |
| 386 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 387 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 388 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 389 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 390 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 391 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 392 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 393 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 394 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 395 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 396 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 397 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 398 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 399 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 400 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 401 | *[-_\ =]tickets=[^0]*) |
| 402 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 403 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 404 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 405 | *[-_\ =]alpn=*) |
| 406 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 407 | esac |
| 408 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 409 | case "$CMD_LINE" in |
Valerio Setti | ccfad9a | 2023-03-08 10:25:05 +0100 | [diff] [blame] | 410 | *server5*|\ |
Valerio Setti | 80318d2 | 2023-03-13 12:26:42 +0100 | [diff] [blame] | 411 | *server7*|\ |
| 412 | *dir-maxpath*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 413 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 414 | # In case of TLS13 the support for ECDSA is enough |
| 415 | requires_pk_alg "ECDSA" |
| 416 | else |
| 417 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 418 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 419 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 420 | # key exchange is required. However gnutls also does not |
| 421 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 422 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 423 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 424 | else |
| 425 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 426 | fi |
| 427 | elif [ "$ROLE" = "client" ]; then |
| 428 | # On the client side it is enough to have any certificate |
| 429 | # based authentication together with support for ECDSA. |
| 430 | # Of course the GnuTLS limitation mentioned above applies |
| 431 | # also here. |
| 432 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 433 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 434 | else |
| 435 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 436 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 437 | requires_pk_alg "ECDSA" |
| 438 | fi |
| 439 | fi |
| 440 | ;; |
| 441 | esac |
| 442 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 443 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 444 | } |
| 445 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 446 | requires_certificate_authentication () { |
| 447 | if [ "$PSK_ONLY" = "YES" ]; then |
| 448 | SKIP_NEXT="YES" |
| 449 | fi |
| 450 | } |
| 451 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 452 | adapt_cmd_for_psk () { |
| 453 | case "$2" in |
| 454 | *openssl*) s='-psk abc123 -nocert';; |
| 455 | *gnutls-*) s='--pskkey=abc123';; |
| 456 | *) s='psk=abc123';; |
| 457 | esac |
| 458 | eval $1='"$2 $s"' |
| 459 | unset s |
| 460 | } |
| 461 | |
| 462 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 463 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 464 | # |
| 465 | # If not running in a PSK-only build, do nothing. |
| 466 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 467 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 468 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 469 | # a pre-shared key, do nothing. |
| 470 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 471 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 472 | # |
| 473 | # Inputs: |
| 474 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 475 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 476 | # * "$@": options passed to run_test. |
| 477 | # |
| 478 | # Outputs: |
| 479 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 480 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 481 | maybe_adapt_for_psk() { |
| 482 | if [ "$PSK_ONLY" != "YES" ]; then |
| 483 | return |
| 484 | fi |
| 485 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 486 | return |
| 487 | fi |
| 488 | case "$CLI_CMD $SRV_CMD" in |
| 489 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 490 | return;; |
| 491 | *force_ciphersuite*) |
| 492 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 493 | # PSK cipher suite could be substituted, but we're not ready for |
| 494 | # that yet. |
| 495 | SKIP_NEXT="YES" |
| 496 | return;; |
| 497 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 498 | # The test case involves certificates. PSK won't do. |
| 499 | SKIP_NEXT="YES" |
| 500 | return;; |
| 501 | esac |
| 502 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 503 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 504 | } |
| 505 | |
| 506 | case " $CONFIGS_ENABLED " in |
| 507 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 508 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 509 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 510 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 511 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 512 | *) PSK_ONLY="NO";; |
| 513 | esac |
| 514 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 515 | HAS_ALG_SHA_1="NO" |
| 516 | HAS_ALG_SHA_224="NO" |
| 517 | HAS_ALG_SHA_256="NO" |
| 518 | HAS_ALG_SHA_384="NO" |
| 519 | HAS_ALG_SHA_512="NO" |
| 520 | |
| 521 | check_for_hash_alg() |
| 522 | { |
| 523 | CURR_ALG="INVALID"; |
| 524 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 525 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 526 | USE_PSA="YES"; |
| 527 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 528 | if [ $USE_PSA = "YES" ]; then |
| 529 | CURR_ALG=PSA_WANT_ALG_${1} |
| 530 | else |
| 531 | CURR_ALG=MBEDTLS_${1}_C |
| 532 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 533 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 534 | fi |
| 535 | |
| 536 | case $CONFIGS_ENABLED in |
| 537 | *" $CURR_ALG"[\ =]*) |
| 538 | return 0 |
| 539 | ;; |
| 540 | *) :;; |
| 541 | esac |
| 542 | return 1 |
| 543 | } |
| 544 | |
| 545 | populate_enabled_hash_algs() |
| 546 | { |
| 547 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 548 | if check_for_hash_alg "$hash_alg"; then |
| 549 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 550 | eval ${hash_alg_variable}=YES |
| 551 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 552 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 553 | } |
| 554 | |
| 555 | # skip next test if the given hash alg is not supported |
| 556 | requires_hash_alg() { |
| 557 | HASH_DEFINE="Invalid" |
| 558 | HAS_HASH_ALG="NO" |
| 559 | case $1 in |
| 560 | SHA_1):;; |
| 561 | SHA_224):;; |
| 562 | SHA_256):;; |
| 563 | SHA_384):;; |
| 564 | SHA_512):;; |
| 565 | *) |
| 566 | echo "Unsupported hash alg - $1" |
| 567 | exit 1 |
| 568 | ;; |
| 569 | esac |
| 570 | |
| 571 | HASH_DEFINE=HAS_ALG_${1} |
| 572 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 573 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 574 | then |
| 575 | SKIP_NEXT="YES" |
| 576 | fi |
| 577 | } |
| 578 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 579 | # Skip next test if the given pk alg is not enabled |
| 580 | requires_pk_alg() { |
| 581 | case $1 in |
| 582 | ECDSA) |
| 583 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 584 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 585 | else |
| 586 | requires_config_enabled MBEDTLS_ECDSA_C |
| 587 | fi |
| 588 | ;; |
| 589 | *) |
| 590 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 591 | exit 1 |
| 592 | ;; |
| 593 | esac |
| 594 | } |
| 595 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 596 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 597 | requires_openssl_with_fallback_scsv() { |
| 598 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 599 | 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] | 600 | then |
| 601 | OPENSSL_HAS_FBSCSV="YES" |
| 602 | else |
| 603 | OPENSSL_HAS_FBSCSV="NO" |
| 604 | fi |
| 605 | fi |
| 606 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 607 | SKIP_NEXT="YES" |
| 608 | fi |
| 609 | } |
| 610 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 611 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 612 | requires_max_content_len() { |
| 613 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 614 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 615 | } |
| 616 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 617 | # skip next test if GnuTLS isn't available |
| 618 | requires_gnutls() { |
| 619 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 620 | 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] | 621 | GNUTLS_AVAILABLE="YES" |
| 622 | else |
| 623 | GNUTLS_AVAILABLE="NO" |
| 624 | fi |
| 625 | fi |
| 626 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 627 | SKIP_NEXT="YES" |
| 628 | fi |
| 629 | } |
| 630 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 631 | # skip next test if GnuTLS-next isn't available |
| 632 | requires_gnutls_next() { |
| 633 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 634 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 635 | GNUTLS_NEXT_AVAILABLE="YES" |
| 636 | else |
| 637 | GNUTLS_NEXT_AVAILABLE="NO" |
| 638 | fi |
| 639 | fi |
| 640 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 641 | SKIP_NEXT="YES" |
| 642 | fi |
| 643 | } |
| 644 | |
| 645 | # skip next test if OpenSSL-legacy isn't available |
| 646 | requires_openssl_legacy() { |
| 647 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 648 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 649 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 650 | else |
| 651 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 652 | fi |
| 653 | fi |
| 654 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 655 | SKIP_NEXT="YES" |
| 656 | fi |
| 657 | } |
| 658 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 659 | requires_openssl_next() { |
| 660 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 661 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 662 | OPENSSL_NEXT_AVAILABLE="YES" |
| 663 | else |
| 664 | OPENSSL_NEXT_AVAILABLE="NO" |
| 665 | fi |
| 666 | fi |
| 667 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 668 | SKIP_NEXT="YES" |
| 669 | fi |
| 670 | } |
| 671 | |
| 672 | # skip next test if tls1_3 is not available |
| 673 | requires_openssl_tls1_3() { |
| 674 | requires_openssl_next |
| 675 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 676 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 677 | fi |
| 678 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 679 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 680 | then |
| 681 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 682 | else |
| 683 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 684 | fi |
| 685 | fi |
| 686 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 687 | SKIP_NEXT="YES" |
| 688 | fi |
| 689 | } |
| 690 | |
| 691 | # skip next test if tls1_3 is not available |
| 692 | requires_gnutls_tls1_3() { |
| 693 | requires_gnutls_next |
| 694 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 695 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 696 | fi |
| 697 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 698 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 699 | then |
| 700 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 701 | else |
| 702 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 703 | fi |
| 704 | fi |
| 705 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 706 | SKIP_NEXT="YES" |
| 707 | fi |
| 708 | } |
| 709 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 710 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 711 | requires_gnutls_next_no_ticket() { |
| 712 | requires_gnutls_next |
| 713 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 714 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 715 | fi |
| 716 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 717 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 718 | then |
| 719 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 720 | else |
| 721 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 722 | fi |
| 723 | fi |
| 724 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 725 | SKIP_NEXT="YES" |
| 726 | fi |
| 727 | } |
| 728 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 729 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 730 | requires_gnutls_next_disable_tls13_compat() { |
| 731 | requires_gnutls_next |
| 732 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 733 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 734 | fi |
| 735 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 736 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 737 | then |
| 738 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 739 | else |
| 740 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 741 | fi |
| 742 | fi |
| 743 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 744 | SKIP_NEXT="YES" |
| 745 | fi |
| 746 | } |
| 747 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 748 | # skip next test if GnuTLS does not support the record size limit extension |
| 749 | requires_gnutls_record_size_limit() { |
| 750 | requires_gnutls_next |
| 751 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 752 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 753 | else |
| 754 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 755 | fi |
| 756 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 757 | SKIP_NEXT="YES" |
| 758 | fi |
| 759 | } |
| 760 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 761 | # skip next test if IPv6 isn't available on this host |
| 762 | requires_ipv6() { |
| 763 | if [ -z "${HAS_IPV6:-}" ]; then |
| 764 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 765 | SRV_PID=$! |
| 766 | sleep 1 |
| 767 | kill $SRV_PID >/dev/null 2>&1 |
| 768 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 769 | HAS_IPV6="NO" |
| 770 | else |
| 771 | HAS_IPV6="YES" |
| 772 | fi |
| 773 | rm -r $SRV_OUT |
| 774 | fi |
| 775 | |
| 776 | if [ "$HAS_IPV6" = "NO" ]; then |
| 777 | SKIP_NEXT="YES" |
| 778 | fi |
| 779 | } |
| 780 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 781 | # skip next test if it's i686 or uname is not available |
| 782 | requires_not_i686() { |
| 783 | if [ -z "${IS_I686:-}" ]; then |
| 784 | IS_I686="YES" |
| 785 | if which "uname" >/dev/null 2>&1; then |
| 786 | if [ -z "$(uname -a | grep i686)" ]; then |
| 787 | IS_I686="NO" |
| 788 | fi |
| 789 | fi |
| 790 | fi |
| 791 | if [ "$IS_I686" = "YES" ]; then |
| 792 | SKIP_NEXT="YES" |
| 793 | fi |
| 794 | } |
| 795 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 796 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 797 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 798 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 799 | 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] | 800 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 801 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 802 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 803 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 804 | fi |
| 805 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 806 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 807 | fi |
| 808 | |
| 809 | # skip the next test if the SSL output buffer is less than 16KB |
| 810 | requires_full_size_output_buffer() { |
| 811 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 812 | SKIP_NEXT="YES" |
| 813 | fi |
| 814 | } |
| 815 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 816 | # skip the next test if valgrind is in use |
| 817 | not_with_valgrind() { |
| 818 | if [ "$MEMCHECK" -gt 0 ]; then |
| 819 | SKIP_NEXT="YES" |
| 820 | fi |
| 821 | } |
| 822 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 823 | # skip the next test if valgrind is NOT in use |
| 824 | only_with_valgrind() { |
| 825 | if [ "$MEMCHECK" -eq 0 ]; then |
| 826 | SKIP_NEXT="YES" |
| 827 | fi |
| 828 | } |
| 829 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 830 | # 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] | 831 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 832 | CLI_DELAY_FACTOR=$1 |
| 833 | } |
| 834 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 835 | # wait for the given seconds after the client finished in the next test |
| 836 | server_needs_more_time() { |
| 837 | SRV_DELAY_SECONDS=$1 |
| 838 | } |
| 839 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 840 | # print_name <name> |
| 841 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 842 | TESTS=$(( $TESTS + 1 )) |
| 843 | LINE="" |
| 844 | |
| 845 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 846 | LINE="$TESTS " |
| 847 | fi |
| 848 | |
| 849 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 850 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 851 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 852 | for i in `seq 1 $LEN`; do printf '.'; done |
| 853 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 854 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 855 | } |
| 856 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 857 | # record_outcome <outcome> [<failure-reason>] |
| 858 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 859 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 860 | record_outcome() { |
| 861 | echo "$1" |
| 862 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 863 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 864 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 865 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 866 | "$1" "${2-}" \ |
| 867 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 868 | fi |
| 869 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 870 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 871 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 872 | # True if the presence of the given pattern in a log definitely indicates |
| 873 | # that the test has failed. False if the presence is inconclusive. |
| 874 | # |
| 875 | # Inputs: |
| 876 | # * $1: pattern found in the logs |
| 877 | # * $TIMES_LEFT: >0 if retrying is an option |
| 878 | # |
| 879 | # Outputs: |
| 880 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 881 | # unchanged otherwise. |
| 882 | # * Return value: 1 if the pattern is inconclusive, |
| 883 | # 0 if the failure is definitive. |
| 884 | log_pattern_presence_is_conclusive() { |
| 885 | # If we've run out of attempts, then don't retry no matter what. |
| 886 | if [ $TIMES_LEFT -eq 0 ]; then |
| 887 | return 0 |
| 888 | fi |
| 889 | case $1 in |
| 890 | "resend") |
| 891 | # An undesired resend may have been caused by the OS dropping or |
| 892 | # delaying a packet at an inopportune time. |
| 893 | outcome="RETRY(resend)" |
| 894 | return 1;; |
| 895 | esac |
| 896 | } |
| 897 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 898 | # fail <message> |
| 899 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 900 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 901 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 902 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 903 | mv $SRV_OUT o-srv-${TESTS}.log |
| 904 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 905 | if [ -n "$PXY_CMD" ]; then |
| 906 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 907 | fi |
| 908 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 909 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 910 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 911 | echo " ! server output:" |
| 912 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 913 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 914 | echo " ! client output:" |
| 915 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 916 | if [ -n "$PXY_CMD" ]; then |
| 917 | echo " ! ========================================================" |
| 918 | echo " ! proxy output:" |
| 919 | cat o-pxy-${TESTS}.log |
| 920 | fi |
| 921 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 922 | fi |
| 923 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 924 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 925 | } |
| 926 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 927 | # is_polar <cmd_line> |
| 928 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 929 | case "$1" in |
| 930 | *ssl_client2*) true;; |
| 931 | *ssl_server2*) true;; |
| 932 | *) false;; |
| 933 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 934 | } |
| 935 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 936 | # openssl s_server doesn't have -www with DTLS |
| 937 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 938 | case "$SRV_CMD" in |
| 939 | *s_server*-dtls*) |
| 940 | NEEDS_INPUT=1 |
| 941 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 942 | *) NEEDS_INPUT=0;; |
| 943 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 944 | } |
| 945 | |
| 946 | # provide input to commands that need it |
| 947 | provide_input() { |
| 948 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 949 | return |
| 950 | fi |
| 951 | |
| 952 | while true; do |
| 953 | echo "HTTP/1.0 200 OK" |
| 954 | sleep 1 |
| 955 | done |
| 956 | } |
| 957 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 958 | # has_mem_err <log_file_name> |
| 959 | has_mem_err() { |
| 960 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 961 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 962 | then |
| 963 | return 1 # false: does not have errors |
| 964 | else |
| 965 | return 0 # true: has errors |
| 966 | fi |
| 967 | } |
| 968 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 969 | # 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] | 970 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 971 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 972 | newline=' |
| 973 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 974 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 975 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 976 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 977 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 978 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 979 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 980 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 981 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 982 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 983 | # When we use a proxy, it will be listening on the same port we |
| 984 | # 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] | 985 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 986 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 987 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 988 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 989 | echo "$3 START TIMEOUT" |
| 990 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 991 | break |
| 992 | fi |
| 993 | # Linux and *BSD support decimal arguments to sleep. On other |
| 994 | # OSes this may be a tight loop. |
| 995 | sleep 0.1 2>/dev/null || true |
| 996 | done |
| 997 | } |
| 998 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 999 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1000 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1001 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1002 | } |
| 1003 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1004 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1005 | # Wait for server process $2 to be listening on port $1. |
| 1006 | wait_server_start() { |
| 1007 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1008 | } |
| 1009 | |
| 1010 | # Wait for proxy process $2 to be listening on port $1. |
| 1011 | wait_proxy_start() { |
| 1012 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1013 | } |
| 1014 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1015 | # 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] | 1016 | # 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] | 1017 | # acceptable bounds |
| 1018 | check_server_hello_time() { |
| 1019 | # 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] | 1020 | 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] | 1021 | # Get the Unix timestamp for now |
| 1022 | CUR_TIME=$(date +'%s') |
| 1023 | THRESHOLD_IN_SECS=300 |
| 1024 | |
| 1025 | # Check if the ServerHello time was printed |
| 1026 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1027 | return 1 |
| 1028 | fi |
| 1029 | |
| 1030 | # Check the time in ServerHello is within acceptable bounds |
| 1031 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1032 | # The time in ServerHello is at least 5 minutes before now |
| 1033 | return 1 |
| 1034 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1035 | # 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] | 1036 | return 1 |
| 1037 | else |
| 1038 | return 0 |
| 1039 | fi |
| 1040 | } |
| 1041 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1042 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1043 | handshake_memory_get() { |
| 1044 | OUTPUT_VARIABLE="$1" |
| 1045 | OUTPUT_FILE="$2" |
| 1046 | |
| 1047 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1048 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1049 | |
| 1050 | # Check if memory usage was read |
| 1051 | if [ -z "$MEM_USAGE" ]; then |
| 1052 | echo "Error: Can not read the value of handshake memory usage" |
| 1053 | return 1 |
| 1054 | else |
| 1055 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1056 | return 0 |
| 1057 | fi |
| 1058 | } |
| 1059 | |
| 1060 | # Get handshake memory usage from server or client output and check if this value |
| 1061 | # is not higher than the maximum given by the first argument |
| 1062 | handshake_memory_check() { |
| 1063 | MAX_MEMORY="$1" |
| 1064 | OUTPUT_FILE="$2" |
| 1065 | |
| 1066 | # Get memory usage |
| 1067 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1068 | return 1 |
| 1069 | fi |
| 1070 | |
| 1071 | # Check if memory usage is below max value |
| 1072 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1073 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1074 | "but should be below $MAX_MEMORY bytes" |
| 1075 | return 1 |
| 1076 | else |
| 1077 | return 0 |
| 1078 | fi |
| 1079 | } |
| 1080 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1081 | # wait for client to terminate and set CLI_EXIT |
| 1082 | # must be called right after starting the client |
| 1083 | wait_client_done() { |
| 1084 | CLI_PID=$! |
| 1085 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1086 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1087 | CLI_DELAY_FACTOR=1 |
| 1088 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1089 | ( 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] | 1090 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1091 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1092 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1093 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1094 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1095 | CLI_EXIT=$? |
| 1096 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1097 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1098 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1099 | |
| 1100 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1101 | |
| 1102 | sleep $SRV_DELAY_SECONDS |
| 1103 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1104 | } |
| 1105 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1106 | # check if the given command uses dtls and sets global variable DTLS |
| 1107 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1108 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1109 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1110 | *) DTLS=0;; |
| 1111 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1112 | } |
| 1113 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1114 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1115 | is_gnutls() { |
| 1116 | case "$1" in |
| 1117 | *gnutls-cli*) |
| 1118 | CMD_IS_GNUTLS=1 |
| 1119 | ;; |
| 1120 | *gnutls-serv*) |
| 1121 | CMD_IS_GNUTLS=1 |
| 1122 | ;; |
| 1123 | *) |
| 1124 | CMD_IS_GNUTLS=0 |
| 1125 | ;; |
| 1126 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1127 | } |
| 1128 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1129 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1130 | # and this limit the tests that can be run with them. This function checks server |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1131 | # and client command lines, given as input, to verify if the current test |
| 1132 | # is using one of these tools. |
| 1133 | use_ext_tool_without_ecdh_support() { |
| 1134 | case "$1" in |
| 1135 | *$GNUTLS_SERV*|\ |
| 1136 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1137 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1138 | echo "yes" |
| 1139 | return;; |
| 1140 | esac |
| 1141 | case "$2" in |
| 1142 | *$GNUTLS_CLI*|\ |
| 1143 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1144 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1145 | echo "yes" |
| 1146 | return;; |
| 1147 | esac |
| 1148 | echo "no" |
| 1149 | } |
| 1150 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1151 | # Generate random psk_list argument for ssl_server2 |
| 1152 | get_srv_psk_list () |
| 1153 | { |
| 1154 | case $(( TESTS % 3 )) in |
| 1155 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1156 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1157 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1158 | esac |
| 1159 | } |
| 1160 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1161 | # Determine what calc_verify trace is to be expected, if any. |
| 1162 | # |
| 1163 | # calc_verify is only called for two things: to calculate the |
| 1164 | # extended master secret, and to process client authentication. |
| 1165 | # |
| 1166 | # Warning: the current implementation assumes that extended_ms is not |
| 1167 | # disabled on the client or on the server. |
| 1168 | # |
| 1169 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1170 | # * $1: the value of the server auth_mode parameter. |
| 1171 | # 'required' if client authentication is expected, |
| 1172 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1173 | # * $CONFIGS_ENABLED |
| 1174 | # |
| 1175 | # Outputs: |
| 1176 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1177 | set_maybe_calc_verify() { |
| 1178 | maybe_calc_verify= |
| 1179 | case $CONFIGS_ENABLED in |
| 1180 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1181 | *) |
| 1182 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1183 | ''|none) return;; |
| 1184 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1185 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1186 | esac |
| 1187 | esac |
| 1188 | case $CONFIGS_ENABLED in |
| 1189 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1190 | *) maybe_calc_verify="<= calc verify";; |
| 1191 | esac |
| 1192 | } |
| 1193 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1194 | # Compare file content |
| 1195 | # Usage: find_in_both pattern file1 file2 |
| 1196 | # extract from file1 the first line matching the pattern |
| 1197 | # check in file2 that the same line can be found |
| 1198 | find_in_both() { |
| 1199 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1200 | if [ -z "$srv_pattern" ]; then |
| 1201 | return 1; |
| 1202 | fi |
| 1203 | |
| 1204 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1205 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1206 | else |
| 1207 | return 1; |
| 1208 | fi |
| 1209 | } |
| 1210 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1211 | SKIP_HANDSHAKE_CHECK="NO" |
| 1212 | skip_handshake_stage_check() { |
| 1213 | SKIP_HANDSHAKE_CHECK="YES" |
| 1214 | } |
| 1215 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1216 | # Analyze the commands that will be used in a test. |
| 1217 | # |
| 1218 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1219 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1220 | # |
| 1221 | # Inputs: |
| 1222 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1223 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1224 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1225 | # |
| 1226 | # Outputs: |
| 1227 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1228 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1229 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1230 | # 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] | 1231 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1232 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1233 | case " $SRV_CMD " in |
| 1234 | *' server_addr=::1 '*) |
| 1235 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1236 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1237 | fi |
| 1238 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1239 | # update CMD_IS_GNUTLS variable |
| 1240 | is_gnutls "$SRV_CMD" |
| 1241 | |
| 1242 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1243 | # set the default priority |
| 1244 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1245 | case "$SRV_CMD" in |
| 1246 | *--priority*) :;; |
| 1247 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1248 | esac |
| 1249 | fi |
| 1250 | |
| 1251 | # update CMD_IS_GNUTLS variable |
| 1252 | is_gnutls "$CLI_CMD" |
| 1253 | |
| 1254 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1255 | # set the default priority |
| 1256 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1257 | case "$CLI_CMD" in |
| 1258 | *--priority*) :;; |
| 1259 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1260 | esac |
| 1261 | fi |
| 1262 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1263 | # fix client port |
| 1264 | if [ -n "$PXY_CMD" ]; then |
| 1265 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1266 | else |
| 1267 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1268 | fi |
| 1269 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1270 | # prepend valgrind to our commands if active |
| 1271 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1272 | if is_polar "$SRV_CMD"; then |
| 1273 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1274 | fi |
| 1275 | if is_polar "$CLI_CMD"; then |
| 1276 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1277 | fi |
| 1278 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1279 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1280 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1281 | # Check for failure conditions after a test case. |
| 1282 | # |
| 1283 | # Inputs from run_test: |
| 1284 | # * positional parameters: test options (see run_test documentation) |
| 1285 | # * $CLI_EXIT: client return code |
| 1286 | # * $CLI_EXPECT: expected client return code |
| 1287 | # * $SRV_RET: server return code |
| 1288 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1289 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1290 | # |
| 1291 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1292 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1293 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1294 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1295 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1296 | if [ $TIMES_LEFT -gt 0 ] && |
| 1297 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1298 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1299 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1300 | return |
| 1301 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1302 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1303 | # 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] | 1304 | # (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] | 1305 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1306 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1307 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1308 | then |
| 1309 | if is_polar "$SRV_CMD"; then |
| 1310 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1311 | else |
| 1312 | fail "server or client failed to reach handshake stage" |
| 1313 | return |
| 1314 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1315 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1316 | if is_polar "$CLI_CMD"; then |
| 1317 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1318 | else |
| 1319 | fail "server or client failed to reach handshake stage" |
| 1320 | return |
| 1321 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1322 | fi |
| 1323 | fi |
| 1324 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1325 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1326 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1327 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1328 | # care anyway), in case e.g. the server reports a memory leak. |
| 1329 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1330 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1331 | return |
| 1332 | fi |
| 1333 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1334 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1335 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1336 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1337 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1338 | 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] | 1339 | return |
| 1340 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1341 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1342 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1343 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1344 | # 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] | 1345 | while [ $# -gt 0 ] |
| 1346 | do |
| 1347 | case $1 in |
| 1348 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1349 | 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] | 1350 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1351 | return |
| 1352 | fi |
| 1353 | ;; |
| 1354 | |
| 1355 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1356 | 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] | 1357 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1358 | return |
| 1359 | fi |
| 1360 | ;; |
| 1361 | |
| 1362 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1363 | 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] | 1364 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1365 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1366 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1367 | return |
| 1368 | fi |
| 1369 | ;; |
| 1370 | |
| 1371 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1372 | 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] | 1373 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1374 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1375 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1376 | return |
| 1377 | fi |
| 1378 | ;; |
| 1379 | |
| 1380 | # The filtering in the following two options (-u and -U) do the following |
| 1381 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1382 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1383 | # - keep one of each non-unique line |
| 1384 | # - count how many lines remain |
| 1385 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1386 | # if there were no duplicates. |
| 1387 | "-U") |
| 1388 | 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 |
| 1389 | fail "lines following pattern '$2' must be unique in Server output" |
| 1390 | return |
| 1391 | fi |
| 1392 | ;; |
| 1393 | |
| 1394 | "-u") |
| 1395 | 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 |
| 1396 | 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] | 1397 | return |
| 1398 | fi |
| 1399 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1400 | "-F") |
| 1401 | if ! $2 "$SRV_OUT"; then |
| 1402 | fail "function call to '$2' failed on Server output" |
| 1403 | return |
| 1404 | fi |
| 1405 | ;; |
| 1406 | "-f") |
| 1407 | if ! $2 "$CLI_OUT"; then |
| 1408 | fail "function call to '$2' failed on Client output" |
| 1409 | return |
| 1410 | fi |
| 1411 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1412 | "-g") |
| 1413 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1414 | fail "function call to '$2' failed on Server and Client output" |
| 1415 | return |
| 1416 | fi |
| 1417 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1418 | |
| 1419 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1420 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1421 | exit 1 |
| 1422 | esac |
| 1423 | shift 2 |
| 1424 | done |
| 1425 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1426 | # check valgrind's results |
| 1427 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1428 | 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] | 1429 | fail "Server has memory errors" |
| 1430 | return |
| 1431 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1432 | 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] | 1433 | fail "Client has memory errors" |
| 1434 | return |
| 1435 | fi |
| 1436 | fi |
| 1437 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1438 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1439 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1440 | } |
| 1441 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1442 | # Run the current test case: start the server and if applicable the proxy, run |
| 1443 | # the client, wait for all processes to finish or time out. |
| 1444 | # |
| 1445 | # Inputs: |
| 1446 | # * $NAME: test case name |
| 1447 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1448 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1449 | # |
| 1450 | # Outputs: |
| 1451 | # * $CLI_EXIT: client return code |
| 1452 | # * $SRV_RET: server return code |
| 1453 | do_run_test_once() { |
| 1454 | # run the commands |
| 1455 | if [ -n "$PXY_CMD" ]; then |
| 1456 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1457 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1458 | PXY_PID=$! |
| 1459 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1460 | fi |
| 1461 | |
| 1462 | check_osrv_dtls |
| 1463 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1464 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1465 | SRV_PID=$! |
| 1466 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1467 | |
| 1468 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1469 | # The client must be a subprocess of the script in order for killing it to |
| 1470 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1471 | # not at the end of the line: the latter approach will spawn eval as a |
| 1472 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1473 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1474 | wait_client_done |
| 1475 | |
| 1476 | sleep 0.05 |
| 1477 | |
| 1478 | # terminate the server (and the proxy) |
| 1479 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1480 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1481 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1482 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1483 | SRV_RET=$? |
| 1484 | |
| 1485 | if [ -n "$PXY_CMD" ]; then |
| 1486 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1487 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1488 | fi |
| 1489 | } |
| 1490 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1491 | # Detect if the current test is going to use TLS 1.3. |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 1492 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1493 | # |
| 1494 | # Note: this function only provides some guess about TLS version by simply |
| 1495 | # looking at the server/client command lines. Even thought this works |
| 1496 | # for the sake of tests' filtering (especially in conjunction with the |
| 1497 | # detect_required_features() function), it does NOT guarantee that the |
| 1498 | # result is accurate. It does not check other conditions, such as: |
| 1499 | # - MBEDTLS_SSL_PROTO_TLS1_x can be disabled to selectively remove |
Valerio Setti | 1470ce3 | 2023-03-08 16:50:12 +0100 | [diff] [blame] | 1500 | # TLS 1.2/1.3 support |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1501 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1502 | # that we are going to use TLS 1.2 |
| 1503 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1504 | get_tls_version() { |
| 1505 | case $1 in |
| 1506 | *tls1_3*|*tls13*) |
| 1507 | echo "TLS13" |
| 1508 | return;; |
| 1509 | esac |
| 1510 | case $2 in |
| 1511 | *tls1_3*|*tls13*) |
| 1512 | echo "TLS13" |
| 1513 | return;; |
| 1514 | esac |
| 1515 | echo "TLS12" |
| 1516 | } |
| 1517 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1518 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1519 | # Options: -s pattern pattern that must be present in server output |
| 1520 | # -c pattern pattern that must be present in client output |
| 1521 | # -u pattern lines after pattern must be unique in client output |
| 1522 | # -f call shell function on client output |
| 1523 | # -S pattern pattern that must be absent in server output |
| 1524 | # -C pattern pattern that must be absent in client output |
| 1525 | # -U pattern lines after pattern must be unique in server output |
| 1526 | # -F call shell function on server output |
| 1527 | # -g call shell function on server and client output |
| 1528 | run_test() { |
| 1529 | NAME="$1" |
| 1530 | shift 1 |
| 1531 | |
| 1532 | if is_excluded "$NAME"; then |
| 1533 | SKIP_NEXT="NO" |
| 1534 | # There was no request to run the test, so don't record its outcome. |
| 1535 | return |
| 1536 | fi |
| 1537 | |
| 1538 | print_name "$NAME" |
| 1539 | |
| 1540 | # Do we only run numbered tests? |
| 1541 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1542 | case ",$RUN_TEST_NUMBER," in |
| 1543 | *",$TESTS,"*) :;; |
| 1544 | *) SKIP_NEXT="YES";; |
| 1545 | esac |
| 1546 | fi |
| 1547 | |
| 1548 | # does this test use a proxy? |
| 1549 | if [ "X$1" = "X-p" ]; then |
| 1550 | PXY_CMD="$2" |
| 1551 | shift 2 |
| 1552 | else |
| 1553 | PXY_CMD="" |
| 1554 | fi |
| 1555 | |
| 1556 | # get commands and client output |
| 1557 | SRV_CMD="$1" |
| 1558 | CLI_CMD="$2" |
| 1559 | CLI_EXPECT="$3" |
| 1560 | shift 3 |
| 1561 | |
| 1562 | # Check if test uses files |
| 1563 | case "$SRV_CMD $CLI_CMD" in |
| 1564 | *data_files/*) |
| 1565 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1566 | esac |
| 1567 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1568 | # Check if the test uses DTLS. |
| 1569 | detect_dtls "$SRV_CMD" |
| 1570 | if [ "$DTLS" -eq 1 ]; then |
| 1571 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1572 | fi |
| 1573 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1574 | # If the client or server requires certain features that can be detected |
| 1575 | # from their command-line arguments, check that they're enabled. |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1576 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1577 | |
| 1578 | # Check if we are trying to use an external tool wich does not support ECDH |
| 1579 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1580 | |
| 1581 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1582 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1583 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1584 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1585 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1586 | |
| 1587 | # should we skip? |
| 1588 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1589 | SKIP_NEXT="NO" |
| 1590 | record_outcome "SKIP" |
| 1591 | SKIPS=$(( $SKIPS + 1 )) |
| 1592 | return |
| 1593 | fi |
| 1594 | |
| 1595 | analyze_test_commands "$@" |
| 1596 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1597 | # One regular run and two retries |
| 1598 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1599 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1600 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1601 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1602 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1603 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1604 | check_test_failure "$@" |
| 1605 | case $outcome in |
| 1606 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1607 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1608 | FAIL) return;; |
| 1609 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1610 | done |
| 1611 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1612 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1613 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1614 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1615 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1616 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1617 | if [ -n "$PXY_CMD" ]; then |
| 1618 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1619 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1620 | fi |
| 1621 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1622 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1623 | } |
| 1624 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1625 | run_test_psa() { |
| 1626 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1627 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1628 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1629 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1630 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1631 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1632 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1633 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1634 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1635 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1636 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1637 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1638 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1639 | -S "error" \ |
| 1640 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1641 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1642 | } |
| 1643 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1644 | run_test_psa_force_curve() { |
| 1645 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1646 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1647 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1648 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1649 | "$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] | 1650 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1651 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1652 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1653 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1654 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1655 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1656 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1657 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1658 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1659 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1660 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1661 | } |
| 1662 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1663 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1664 | # a maximum fragment length. |
| 1665 | # first argument ($1) is MFL for SSL client |
| 1666 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1667 | run_test_memory_after_hanshake_with_mfl() |
| 1668 | { |
| 1669 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1670 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1671 | |
| 1672 | # Leave some margin for robustness |
| 1673 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1674 | |
| 1675 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1676 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1677 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1678 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1679 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1680 | 0 \ |
| 1681 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1682 | } |
| 1683 | |
| 1684 | |
| 1685 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1686 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1687 | run_tests_memory_after_hanshake() |
| 1688 | { |
| 1689 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1690 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1691 | |
| 1692 | # first test with default MFU is to get reference memory usage |
| 1693 | MEMORY_USAGE_MFL_16K=0 |
| 1694 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1695 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1696 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1697 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1698 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1699 | 0 \ |
| 1700 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1701 | |
| 1702 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1703 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1704 | |
| 1705 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1706 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1707 | |
| 1708 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1709 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1710 | |
| 1711 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1712 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1713 | } |
| 1714 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1715 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1716 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1717 | rm -f context_srv.txt |
| 1718 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1719 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1720 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1721 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1722 | 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] | 1723 | exit 1 |
| 1724 | } |
| 1725 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1726 | # |
| 1727 | # MAIN |
| 1728 | # |
| 1729 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1730 | get_options "$@" |
| 1731 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1732 | populate_enabled_hash_algs |
| 1733 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1734 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1735 | # patterns rather than regular expressions, use a case statement instead |
| 1736 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1737 | # detects simple cases: plain substring, everything, nothing. |
| 1738 | # |
| 1739 | # As an exception, the character '.' is treated as an ordinary character |
| 1740 | # if it is the only special character in the string. This is because it's |
| 1741 | # rare to need "any one character", but needing a literal '.' is common |
| 1742 | # (e.g. '-f "DTLS 1.2"'). |
| 1743 | need_grep= |
| 1744 | case "$FILTER" in |
| 1745 | '^$') simple_filter=;; |
| 1746 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1747 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1748 | need_grep=1;; |
| 1749 | *) # No regexp or shell-pattern special character |
| 1750 | simple_filter="*$FILTER*";; |
| 1751 | esac |
| 1752 | case "$EXCLUDE" in |
| 1753 | '^$') simple_exclude=;; |
| 1754 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1755 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1756 | need_grep=1;; |
| 1757 | *) # No regexp or shell-pattern special character |
| 1758 | simple_exclude="*$EXCLUDE*";; |
| 1759 | esac |
| 1760 | if [ -n "$need_grep" ]; then |
| 1761 | is_excluded () { |
| 1762 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1763 | } |
| 1764 | else |
| 1765 | is_excluded () { |
| 1766 | case "$1" in |
| 1767 | $simple_exclude) true;; |
| 1768 | $simple_filter) false;; |
| 1769 | *) true;; |
| 1770 | esac |
| 1771 | } |
| 1772 | fi |
| 1773 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1774 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1775 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1776 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1777 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1778 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1779 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1780 | exit 1 |
| 1781 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1782 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1783 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1784 | exit 1 |
| 1785 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1786 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1787 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1788 | exit 1 |
| 1789 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1790 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1791 | if which valgrind >/dev/null 2>&1; then :; else |
| 1792 | echo "Memcheck not possible. Valgrind not found" |
| 1793 | exit 1 |
| 1794 | fi |
| 1795 | fi |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 1796 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1797 | echo "Command '$OPENSSL' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1798 | exit 1 |
| 1799 | fi |
| 1800 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1801 | # used by watchdog |
| 1802 | MAIN_PID="$$" |
| 1803 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1804 | # We use somewhat arbitrary delays for tests: |
| 1805 | # - how long do we wait for the server to start (when lsof not available)? |
| 1806 | # - how long do we allow for the client to finish? |
| 1807 | # (not to check performance, just to avoid waiting indefinitely) |
| 1808 | # Things are slower with valgrind, so give extra time here. |
| 1809 | # |
| 1810 | # Note: without lsof, there is a trade-off between the running time of this |
| 1811 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1812 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1813 | # 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] | 1814 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1815 | START_DELAY=6 |
| 1816 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1817 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1818 | START_DELAY=2 |
| 1819 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1820 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1821 | |
| 1822 | # some particular tests need more time: |
| 1823 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1824 | # - for the server, we sleep for a number of seconds after the client exits |
| 1825 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1826 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1827 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1828 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1829 | # 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] | 1830 | # +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] | 1831 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1832 | # 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] | 1833 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1834 | 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] | 1835 | 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] | 1836 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1837 | 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] | 1838 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1839 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1840 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1841 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1842 | 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] | 1843 | 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] | 1844 | fi |
| 1845 | |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1846 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 1847 | # low-security ones. This covers not just cipher suites but also protocol |
| 1848 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 1849 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 1850 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 1851 | # 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] | 1852 | case $($OPENSSL version) in |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1853 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 1854 | *) |
| 1855 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 1856 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 1857 | ;; |
| 1858 | esac |
| 1859 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1860 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1861 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1862 | 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] | 1863 | 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] | 1864 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1865 | 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] | 1866 | fi |
| 1867 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1868 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1869 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1870 | 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] | 1871 | fi |
| 1872 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1873 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1874 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1875 | 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] | 1876 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1877 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1878 | # Allow SHA-1, because many of our test certificates use it |
| 1879 | P_SRV="$P_SRV allow_sha1=1" |
| 1880 | P_CLI="$P_CLI allow_sha1=1" |
| 1881 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1882 | # Also pick a unique name for intermediate files |
| 1883 | SRV_OUT="srv_out.$$" |
| 1884 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1885 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1886 | SESSION="session.$$" |
| 1887 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1888 | SKIP_NEXT="NO" |
| 1889 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1890 | trap cleanup INT TERM HUP |
| 1891 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1892 | # Basic test |
| 1893 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1894 | # Checks that: |
| 1895 | # - 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] | 1896 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1897 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1898 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1899 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1900 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1901 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1902 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1903 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1904 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1905 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1906 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1907 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1908 | -S "error" \ |
| 1909 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1910 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1912 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1913 | run_test "Default, DTLS" \ |
| 1914 | "$P_SRV dtls=1" \ |
| 1915 | "$P_CLI dtls=1" \ |
| 1916 | 0 \ |
| 1917 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1918 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1919 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 1920 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1921 | run_test "TLS client auth: required" \ |
| 1922 | "$P_SRV auth_mode=required" \ |
| 1923 | "$P_CLI" \ |
| 1924 | 0 \ |
| 1925 | -s "Verifying peer X.509 certificate... ok" |
| 1926 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1927 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1928 | "$P_SRV" \ |
| 1929 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1930 | 0 \ |
| 1931 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1932 | -c "Key size is 256" |
| 1933 | |
| 1934 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1935 | "$P_SRV" \ |
| 1936 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1937 | 0 \ |
| 1938 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1939 | -c "Key size is 128" |
| 1940 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1941 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1942 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1943 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1944 | "$P_SRV force_version=tls12 auth_mode=required" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1945 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1946 | 0 |
| 1947 | |
| 1948 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1949 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1950 | run_test "TLS: password protected server key" \ |
| 1951 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1952 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1953 | 0 |
| 1954 | |
| 1955 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1956 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1957 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1958 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1959 | "$P_SRV force_version=tls12\ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1960 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1961 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1962 | "$P_CLI" \ |
| 1963 | 0 |
| 1964 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1965 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1966 | run_test "CA callback on client" \ |
| 1967 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 1968 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1969 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1970 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1971 | -S "error" \ |
| 1972 | -C "error" |
| 1973 | |
| 1974 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1975 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1976 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1977 | run_test "CA callback on server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 1978 | "$P_SRV force_version=tls12 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1979 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1980 | key_file=data_files/server5.key" \ |
| 1981 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1982 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1983 | -s "Verifying peer X.509 certificate... ok" \ |
| 1984 | -S "error" \ |
| 1985 | -C "error" |
| 1986 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1987 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1988 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1989 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 1990 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1991 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1992 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1993 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server5.crt \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1994 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1995 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1996 | 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] | 1997 | 0 \ |
| 1998 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1999 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2000 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2001 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2002 | -S "error" \ |
| 2003 | -C "error" |
| 2004 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2005 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2006 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2007 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2008 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2009 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2010 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2011 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2012 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2013 | key_file=data_files/server2.key" \ |
| 2014 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2015 | 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] | 2016 | 0 \ |
| 2017 | -c "key type: Opaque" \ |
| 2018 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2019 | -s "Verifying peer X.509 certificate... ok" \ |
| 2020 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2021 | -S "error" \ |
| 2022 | -C "error" |
| 2023 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2024 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2025 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2026 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2027 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2028 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2029 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2030 | key_file=data_files/server2.key" \ |
| 2031 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2032 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2033 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2034 | 0 \ |
| 2035 | -c "key type: Opaque" \ |
| 2036 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2037 | -s "Verifying peer X.509 certificate... ok" \ |
| 2038 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2039 | -S "error" \ |
| 2040 | -C "error" |
| 2041 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2042 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2043 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2044 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2045 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2046 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2047 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2048 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2049 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2050 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2051 | 0 \ |
| 2052 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2053 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2054 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2055 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2056 | -S "error" \ |
| 2057 | -C "error" |
| 2058 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2059 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2060 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2061 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2062 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2063 | "$P_SRV auth_mode=required key_opaque=1\ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 2064 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2065 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2066 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2067 | 0 \ |
| 2068 | -c "Verifying peer X.509 certificate... ok" \ |
| 2069 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2070 | -s "key types: Opaque, none" \ |
| 2071 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2072 | -S "error" \ |
| 2073 | -C "error" |
| 2074 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2076 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2077 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2078 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2079 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 2080 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 2081 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2082 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2083 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2084 | 1 \ |
| 2085 | -s "key types: Opaque, none" \ |
| 2086 | -s "error" \ |
| 2087 | -c "error" \ |
| 2088 | -c "Public key type mismatch" |
| 2089 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2090 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2091 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2092 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2093 | requires_config_enabled MBEDTLS_RSA_C |
| 2094 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2095 | requires_hash_alg SHA_256 |
| 2096 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 2097 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2098 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2099 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2100 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2101 | 1 \ |
| 2102 | -s "key types: Opaque, none" \ |
| 2103 | -s "error" \ |
| 2104 | -c "error" \ |
| 2105 | -c "Public key type mismatch" |
| 2106 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2107 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2108 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2109 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2110 | requires_hash_alg SHA_256 |
| 2111 | 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] | 2112 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2113 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2114 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2115 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2116 | 1 \ |
| 2117 | -s "key types: Opaque, none" \ |
| 2118 | -s "got ciphersuites in common, but none of them usable" \ |
| 2119 | -s "error" \ |
| 2120 | -c "error" |
| 2121 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2122 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2123 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2124 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2125 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2126 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2127 | 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] | 2128 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2129 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2130 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2131 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2132 | 1 \ |
| 2133 | -s "key types: Opaque, none" \ |
| 2134 | -s "got ciphersuites in common, but none of them usable" \ |
| 2135 | -s "error" \ |
| 2136 | -c "error" |
| 2137 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2138 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2139 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2140 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2141 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2142 | 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] | 2143 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2144 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 2145 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2146 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2147 | 1 \ |
| 2148 | -s "key types: Opaque, none" \ |
| 2149 | -s "got ciphersuites in common, but none of them usable" \ |
| 2150 | -s "error" \ |
| 2151 | -c "error" |
| 2152 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2153 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2154 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2155 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2156 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2157 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2158 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2159 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2160 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2161 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2162 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2163 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2164 | 0 \ |
| 2165 | -c "Verifying peer X.509 certificate... ok" \ |
| 2166 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2167 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2168 | -s "key types: Opaque, Opaque" \ |
| 2169 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2170 | -S "error" \ |
| 2171 | -C "error" |
| 2172 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2173 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2174 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2175 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2176 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2177 | 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] | 2178 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2179 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2180 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2181 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2182 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2183 | 0 \ |
| 2184 | -c "Verifying peer X.509 certificate... ok" \ |
| 2185 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2186 | -c "CN=Polarssl Test EC CA" \ |
| 2187 | -s "key types: Opaque, Opaque" \ |
| 2188 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2189 | -S "error" \ |
| 2190 | -C "error" |
| 2191 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2192 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2193 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2194 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2195 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2196 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2197 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2198 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2199 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2200 | crt_file2=data_files/server2-sha256.crt \ |
| 2201 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2202 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2203 | 0 \ |
| 2204 | -c "Verifying peer X.509 certificate... ok" \ |
| 2205 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2206 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2207 | -s "key types: Opaque, Opaque" \ |
| 2208 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2209 | -S "error" \ |
| 2210 | -C "error" |
| 2211 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2213 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2214 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2216 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2217 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2218 | "$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] | 2219 | "$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] | 2220 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2221 | -s "The SSL configuration is tls13 only" \ |
| 2222 | -c "key type: Opaque" \ |
| 2223 | -s "key types: Opaque, Opaque" \ |
| 2224 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2225 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2226 | |
| 2227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2228 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2229 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2230 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2231 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2232 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2233 | "$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] | 2234 | "$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] | 2235 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2236 | -s "The SSL configuration is tls13 only" \ |
| 2237 | -c "key type: Opaque" \ |
| 2238 | -s "key types: Opaque, Opaque" \ |
| 2239 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2240 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2241 | |
| 2242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2243 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2244 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2245 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2246 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2247 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
| 2248 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
| 2249 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2250 | 0 \ |
| 2251 | -s "The SSL configuration is tls13 only" \ |
| 2252 | -s "key types: Opaque, Opaque" \ |
| 2253 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2254 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2255 | -C "error" \ |
| 2256 | -S "error" \ |
| 2257 | |
| 2258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2259 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2260 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2261 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2262 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2263 | 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] | 2264 | "$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] | 2265 | "$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] | 2266 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2267 | -s "The SSL configuration is tls13 only" \ |
| 2268 | -c "key type: Opaque" \ |
| 2269 | -s "key types: Opaque, Opaque" \ |
| 2270 | -C "error" \ |
| 2271 | -S "error" \ |
| 2272 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2273 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2274 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2275 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2276 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2277 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2278 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2279 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2280 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2281 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2282 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2283 | 0 \ |
| 2284 | -c "Verifying peer X.509 certificate... ok" \ |
| 2285 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2286 | -s "key types: Opaque, none" \ |
| 2287 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2288 | -S "error" \ |
| 2289 | -C "error" |
| 2290 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2291 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2292 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2293 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2294 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2295 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2296 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2297 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2298 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2299 | 0 \ |
| 2300 | -c "Verifying peer X.509 certificate... ok" \ |
| 2301 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2302 | -s "key types: Opaque, none" \ |
| 2303 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2304 | -S "error" \ |
| 2305 | -C "error" |
| 2306 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2307 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2308 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2310 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2311 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2312 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2313 | psk=abc123 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2314 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2315 | psk=abc123 psk_identity=foo" \ |
| 2316 | 0 \ |
| 2317 | -c "Verifying peer X.509 certificate... ok" \ |
| 2318 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2319 | -s "key types: Opaque, Opaque" \ |
| 2320 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2321 | -S "error" \ |
| 2322 | -C "error" |
| 2323 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2324 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2325 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2326 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2327 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2328 | run_test "Opaque key for server authentication: RSA-" \ |
| 2329 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2330 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2331 | 0 \ |
| 2332 | -c "Verifying peer X.509 certificate... ok" \ |
| 2333 | -c "Ciphersuite is TLS-RSA-" \ |
| 2334 | -s "key types: Opaque, Opaque" \ |
| 2335 | -s "Ciphersuite is TLS-RSA-" \ |
| 2336 | -S "error" \ |
| 2337 | -C "error" |
| 2338 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2340 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2341 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2342 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2343 | 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] | 2344 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2345 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2346 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2347 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2348 | 1 \ |
| 2349 | -s "key types: Opaque, none" \ |
| 2350 | -s "got ciphersuites in common, but none of them usable" \ |
| 2351 | -s "error" \ |
| 2352 | -c "error" |
| 2353 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2354 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2355 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2356 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2357 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2358 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2359 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2360 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2361 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2362 | 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] | 2363 | crt_file2=data_files/server4.crt \ |
| 2364 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2365 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2366 | 0 \ |
| 2367 | -c "Verifying peer X.509 certificate... ok" \ |
| 2368 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2369 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2370 | -s "key types: Opaque, Opaque" \ |
| 2371 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2372 | -S "error" \ |
| 2373 | -C "error" |
| 2374 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2376 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2377 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2378 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2379 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2380 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2381 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2382 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2383 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2384 | crt_file2=data_files/server4.crt \ |
| 2385 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2386 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2387 | 0 \ |
| 2388 | -c "Verifying peer X.509 certificate... ok" \ |
| 2389 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2390 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2391 | -s "key types: Opaque, Opaque" \ |
| 2392 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2393 | -S "error" \ |
| 2394 | -C "error" |
| 2395 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2396 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2397 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2398 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2399 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2400 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2401 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2402 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2403 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2404 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2405 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2406 | 0 \ |
| 2407 | -c "key type: Opaque" \ |
| 2408 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2409 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2410 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2411 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2412 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2413 | -S "error" \ |
| 2414 | -C "error" |
| 2415 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2416 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2417 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2418 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2419 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2420 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2421 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2422 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2423 | "$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] | 2424 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2425 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2426 | 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] | 2427 | 0 \ |
| 2428 | -c "key type: Opaque" \ |
| 2429 | -c "Verifying peer X.509 certificate... ok" \ |
| 2430 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2431 | -s "key types: Opaque, none" \ |
| 2432 | -s "Verifying peer X.509 certificate... ok" \ |
| 2433 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2434 | -S "error" \ |
| 2435 | -C "error" |
| 2436 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2437 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2438 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2440 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2441 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2442 | "$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] | 2443 | 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] | 2444 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2445 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2446 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2447 | 0 \ |
| 2448 | -c "key type: Opaque" \ |
| 2449 | -c "Verifying peer X.509 certificate... ok" \ |
| 2450 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2451 | -s "key types: Opaque, none" \ |
| 2452 | -s "Verifying peer X.509 certificate... ok" \ |
| 2453 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2454 | -S "error" \ |
| 2455 | -C "error" |
| 2456 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2457 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2458 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2459 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2460 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2461 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2462 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2463 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2464 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2465 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2466 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2467 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2468 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2469 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2470 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2471 | run_test_psa_force_curve "secp521r1" |
| 2472 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2473 | run_test_psa_force_curve "brainpoolP512r1" |
| 2474 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2475 | run_test_psa_force_curve "secp384r1" |
| 2476 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2477 | run_test_psa_force_curve "brainpoolP384r1" |
| 2478 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2479 | run_test_psa_force_curve "secp256r1" |
| 2480 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2481 | run_test_psa_force_curve "secp256k1" |
| 2482 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2483 | run_test_psa_force_curve "brainpoolP256r1" |
| 2484 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2485 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2486 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2487 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2488 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2489 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2490 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2491 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2492 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2493 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2494 | run_test_psa_force_curve "secp192r1" |
| 2495 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2496 | run_test_psa_force_curve "secp192k1" |
| 2497 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2498 | # Test current time in ServerHello |
| 2499 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2500 | run_test "ServerHello contains gmt_unix_time" \ |
| 2501 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2502 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2503 | 0 \ |
| 2504 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2505 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2506 | |
| 2507 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2508 | run_test "Unique IV in GCM" \ |
| 2509 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2510 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2511 | 0 \ |
| 2512 | -u "IV used" \ |
| 2513 | -U "IV used" |
| 2514 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2515 | # Test for correctness of sent single supported algorithm |
| 2516 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2517 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2518 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2519 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2520 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2521 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2522 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2523 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2524 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2525 | "$P_CLI force_version=tls12 sig_algs=ecdsa_secp256r1_sha256 debug_level=3" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2526 | 0 \ |
| 2527 | -c "Supported Signature Algorithm found: 04 03" |
| 2528 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2530 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2531 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2532 | requires_hash_alg SHA_256 |
| 2533 | run_test "Single supported algorithm sending: openssl client" \ |
| 2534 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2535 | "$O_CLI -cert data_files/server6.crt \ |
| 2536 | -key data_files/server6.key" \ |
| 2537 | 0 |
| 2538 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2539 | # Tests for certificate verification callback |
| 2540 | run_test "Configuration-specific CRT verification callback" \ |
| 2541 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2542 | "$P_CLI force_version=tls12 context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2543 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2544 | -S "error" \ |
| 2545 | -c "Verify requested for " \ |
| 2546 | -c "Use configuration-specific verification callback" \ |
| 2547 | -C "Use context-specific verification callback" \ |
| 2548 | -C "error" |
| 2549 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2550 | run_test "Context-specific CRT verification callback" \ |
| 2551 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2552 | "$P_CLI force_version=tls12 context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2553 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2554 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2555 | -c "Verify requested for " \ |
| 2556 | -c "Use context-specific verification callback" \ |
| 2557 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2558 | -C "error" |
| 2559 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2560 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2561 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2562 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2563 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2564 | 1 \ |
| 2565 | -c "The certificate is signed with an unacceptable hash" |
| 2566 | |
| 2567 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2568 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2569 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2570 | 0 |
| 2571 | |
| 2572 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2573 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2574 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2575 | 0 |
| 2576 | |
| 2577 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2578 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2579 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2580 | 1 \ |
| 2581 | -s "The certificate is signed with an unacceptable hash" |
| 2582 | |
| 2583 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2584 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2585 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2586 | 0 |
| 2587 | |
| 2588 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2589 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2590 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2591 | 0 |
| 2592 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2593 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2595 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2596 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2597 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2598 | 0 \ |
| 2599 | -c "next record in same datagram" \ |
| 2600 | -s "next record in same datagram" |
| 2601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2603 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2604 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2605 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2606 | 0 \ |
| 2607 | -s "next record in same datagram" \ |
| 2608 | -C "next record in same datagram" |
| 2609 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2611 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2612 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2613 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2614 | 0 \ |
| 2615 | -S "next record in same datagram" \ |
| 2616 | -c "next record in same datagram" |
| 2617 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2619 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2620 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2621 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2622 | 0 \ |
| 2623 | -S "next record in same datagram" \ |
| 2624 | -C "next record in same datagram" |
| 2625 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2626 | # Tests for Context serialization |
| 2627 | |
| 2628 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2629 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2630 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2631 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2632 | 0 \ |
| 2633 | -c "Deserializing connection..." \ |
| 2634 | -S "Deserializing connection..." |
| 2635 | |
| 2636 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2637 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2638 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2639 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2640 | 0 \ |
| 2641 | -c "Deserializing connection..." \ |
| 2642 | -S "Deserializing connection..." |
| 2643 | |
| 2644 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2645 | run_test "Context serialization, client serializes, GCM" \ |
| 2646 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2647 | "$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] | 2648 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2649 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2650 | -S "Deserializing connection..." |
| 2651 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2653 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2654 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2655 | run_test "Context serialization, client serializes, with CID" \ |
| 2656 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2657 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2658 | 0 \ |
| 2659 | -c "Deserializing connection..." \ |
| 2660 | -S "Deserializing connection..." |
| 2661 | |
| 2662 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2663 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2664 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2665 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2666 | 0 \ |
| 2667 | -C "Deserializing connection..." \ |
| 2668 | -s "Deserializing connection..." |
| 2669 | |
| 2670 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2671 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2672 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2673 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2674 | 0 \ |
| 2675 | -C "Deserializing connection..." \ |
| 2676 | -s "Deserializing connection..." |
| 2677 | |
| 2678 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2679 | run_test "Context serialization, server serializes, GCM" \ |
| 2680 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2681 | "$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] | 2682 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2683 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2684 | -s "Deserializing connection..." |
| 2685 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2687 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2688 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2689 | run_test "Context serialization, server serializes, with CID" \ |
| 2690 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2691 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2692 | 0 \ |
| 2693 | -C "Deserializing connection..." \ |
| 2694 | -s "Deserializing connection..." |
| 2695 | |
| 2696 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2697 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2698 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2699 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2700 | 0 \ |
| 2701 | -c "Deserializing connection..." \ |
| 2702 | -s "Deserializing connection..." |
| 2703 | |
| 2704 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2705 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2706 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2707 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2708 | 0 \ |
| 2709 | -c "Deserializing connection..." \ |
| 2710 | -s "Deserializing connection..." |
| 2711 | |
| 2712 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2713 | run_test "Context serialization, both serialize, GCM" \ |
| 2714 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2715 | "$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] | 2716 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2717 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2718 | -s "Deserializing connection..." |
| 2719 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2721 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2722 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2723 | run_test "Context serialization, both serialize, with CID" \ |
| 2724 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2725 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2726 | 0 \ |
| 2727 | -c "Deserializing connection..." \ |
| 2728 | -s "Deserializing connection..." |
| 2729 | |
| 2730 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2731 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2732 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2733 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2734 | 0 \ |
| 2735 | -c "Deserializing connection..." \ |
| 2736 | -S "Deserializing connection..." |
| 2737 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2739 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2740 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2741 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2742 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2743 | 0 \ |
| 2744 | -c "Deserializing connection..." \ |
| 2745 | -S "Deserializing connection..." |
| 2746 | |
| 2747 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2748 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2749 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2750 | "$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] | 2751 | 0 \ |
| 2752 | -c "Deserializing connection..." \ |
| 2753 | -S "Deserializing connection..." |
| 2754 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2756 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2757 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2758 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2759 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2760 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2761 | 0 \ |
| 2762 | -c "Deserializing connection..." \ |
| 2763 | -S "Deserializing connection..." |
| 2764 | |
| 2765 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2766 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2767 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2768 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2769 | 0 \ |
| 2770 | -C "Deserializing connection..." \ |
| 2771 | -s "Deserializing connection..." |
| 2772 | |
| 2773 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2774 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2775 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2776 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2777 | 0 \ |
| 2778 | -C "Deserializing connection..." \ |
| 2779 | -s "Deserializing connection..." |
| 2780 | |
| 2781 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2782 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2783 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2784 | "$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] | 2785 | 0 \ |
| 2786 | -C "Deserializing connection..." \ |
| 2787 | -s "Deserializing connection..." |
| 2788 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2790 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2791 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2792 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2793 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2794 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2795 | 0 \ |
| 2796 | -C "Deserializing connection..." \ |
| 2797 | -s "Deserializing connection..." |
| 2798 | |
| 2799 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2800 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2801 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2802 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2803 | 0 \ |
| 2804 | -c "Deserializing connection..." \ |
| 2805 | -s "Deserializing connection..." |
| 2806 | |
| 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 | |
| 2815 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2816 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2817 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2818 | "$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] | 2819 | 0 \ |
| 2820 | -c "Deserializing connection..." \ |
| 2821 | -s "Deserializing connection..." |
| 2822 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2824 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2825 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2826 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2827 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2828 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2829 | 0 \ |
| 2830 | -c "Deserializing connection..." \ |
| 2831 | -s "Deserializing connection..." |
| 2832 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2834 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2835 | run_test "Saving the serialized context to a file" \ |
| 2836 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2837 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2838 | 0 \ |
| 2839 | -s "Save serialized context to a file... ok" \ |
| 2840 | -c "Save serialized context to a file... ok" |
| 2841 | rm -f context_srv.txt |
| 2842 | rm -f context_cli.txt |
| 2843 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2844 | # Tests for DTLS Connection ID extension |
| 2845 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2846 | # So far, the CID API isn't implemented, so we can't |
| 2847 | # grep for output witnessing its use. This needs to be |
| 2848 | # changed once the CID extension is implemented. |
| 2849 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2851 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2852 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2853 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2854 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2855 | 0 \ |
| 2856 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2857 | -s "found CID extension" \ |
| 2858 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2859 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2860 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2861 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2862 | -C "found CID extension" \ |
| 2863 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2864 | -C "Copy CIDs into SSL transform" \ |
| 2865 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2866 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2868 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2869 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2870 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2871 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2872 | 0 \ |
| 2873 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2874 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2875 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2876 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2877 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2878 | -C "found CID extension" \ |
| 2879 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2880 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2881 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2882 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2884 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2885 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2886 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2887 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2888 | 0 \ |
| 2889 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2890 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2891 | -c "client hello, adding CID extension" \ |
| 2892 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2893 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2894 | -s "server hello, adding CID extension" \ |
| 2895 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2896 | -c "Use of CID extension negotiated" \ |
| 2897 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2898 | -c "Copy CIDs into SSL transform" \ |
| 2899 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2900 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2901 | -s "Use of Connection ID has been negotiated" \ |
| 2902 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2905 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2906 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2907 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2908 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2909 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2910 | 0 \ |
| 2911 | -c "Enable use of CID extension." \ |
| 2912 | -s "Enable use of CID extension." \ |
| 2913 | -c "client hello, adding CID extension" \ |
| 2914 | -s "found CID extension" \ |
| 2915 | -s "Use of CID extension negotiated" \ |
| 2916 | -s "server hello, adding CID extension" \ |
| 2917 | -c "found CID extension" \ |
| 2918 | -c "Use of CID extension negotiated" \ |
| 2919 | -s "Copy CIDs into SSL transform" \ |
| 2920 | -c "Copy CIDs into SSL transform" \ |
| 2921 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2922 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2923 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2924 | -c "Use of Connection ID has been negotiated" \ |
| 2925 | -c "ignoring unexpected CID" \ |
| 2926 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2927 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2929 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2930 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2931 | -p "$P_PXY mtu=800" \ |
| 2932 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2933 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2934 | 0 \ |
| 2935 | -c "Enable use of CID extension." \ |
| 2936 | -s "Enable use of CID extension." \ |
| 2937 | -c "client hello, adding CID extension" \ |
| 2938 | -s "found CID extension" \ |
| 2939 | -s "Use of CID extension negotiated" \ |
| 2940 | -s "server hello, adding CID extension" \ |
| 2941 | -c "found CID extension" \ |
| 2942 | -c "Use of CID extension negotiated" \ |
| 2943 | -s "Copy CIDs into SSL transform" \ |
| 2944 | -c "Copy CIDs into SSL transform" \ |
| 2945 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2946 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2947 | -s "Use of Connection ID has been negotiated" \ |
| 2948 | -c "Use of Connection ID has been negotiated" |
| 2949 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2952 | 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] | 2953 | -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] | 2954 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2955 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2956 | 0 \ |
| 2957 | -c "Enable use of CID extension." \ |
| 2958 | -s "Enable use of CID extension." \ |
| 2959 | -c "client hello, adding CID extension" \ |
| 2960 | -s "found CID extension" \ |
| 2961 | -s "Use of CID extension negotiated" \ |
| 2962 | -s "server hello, adding CID extension" \ |
| 2963 | -c "found CID extension" \ |
| 2964 | -c "Use of CID extension negotiated" \ |
| 2965 | -s "Copy CIDs into SSL transform" \ |
| 2966 | -c "Copy CIDs into SSL transform" \ |
| 2967 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2968 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2969 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2970 | -c "Use of Connection ID has been negotiated" \ |
| 2971 | -c "ignoring unexpected CID" \ |
| 2972 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2973 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2975 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2976 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2977 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2978 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2979 | 0 \ |
| 2980 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2981 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2982 | -c "client hello, adding CID extension" \ |
| 2983 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2984 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2985 | -s "server hello, adding CID extension" \ |
| 2986 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2987 | -c "Use of CID extension negotiated" \ |
| 2988 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2989 | -c "Copy CIDs into SSL transform" \ |
| 2990 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2991 | -s "Peer CID (length 0 Bytes):" \ |
| 2992 | -s "Use of Connection ID has been negotiated" \ |
| 2993 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2994 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2996 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2997 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2998 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2999 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3000 | 0 \ |
| 3001 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3002 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3003 | -c "client hello, adding CID extension" \ |
| 3004 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3005 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3006 | -s "server hello, adding CID extension" \ |
| 3007 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3008 | -c "Use of CID extension negotiated" \ |
| 3009 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3010 | -c "Copy CIDs into SSL transform" \ |
| 3011 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3012 | -c "Peer CID (length 0 Bytes):" \ |
| 3013 | -s "Use of Connection ID has been negotiated" \ |
| 3014 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3018 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3019 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3020 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3021 | 0 \ |
| 3022 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3023 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3024 | -c "client hello, adding CID extension" \ |
| 3025 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3026 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3027 | -s "server hello, adding CID extension" \ |
| 3028 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3029 | -c "Use of CID extension negotiated" \ |
| 3030 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3031 | -c "Copy CIDs into SSL transform" \ |
| 3032 | -S "Use of Connection ID has been negotiated" \ |
| 3033 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3034 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3035 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3036 | 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] | 3037 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3038 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3039 | 0 \ |
| 3040 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3041 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3042 | -c "client hello, adding CID extension" \ |
| 3043 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3044 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3045 | -s "server hello, adding CID extension" \ |
| 3046 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3047 | -c "Use of CID extension negotiated" \ |
| 3048 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3049 | -c "Copy CIDs into SSL transform" \ |
| 3050 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3051 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3052 | -s "Use of Connection ID has been negotiated" \ |
| 3053 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3054 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3055 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3056 | 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] | 3057 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3058 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3059 | 0 \ |
| 3060 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3061 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3062 | -c "client hello, adding CID extension" \ |
| 3063 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3064 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3065 | -s "server hello, adding CID extension" \ |
| 3066 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3067 | -c "Use of CID extension negotiated" \ |
| 3068 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3069 | -c "Copy CIDs into SSL transform" \ |
| 3070 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3071 | -s "Peer CID (length 0 Bytes):" \ |
| 3072 | -s "Use of Connection ID has been negotiated" \ |
| 3073 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3074 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3075 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3076 | 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] | 3077 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3078 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3079 | 0 \ |
| 3080 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3081 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3082 | -c "client hello, adding CID extension" \ |
| 3083 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3084 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3085 | -s "server hello, adding CID extension" \ |
| 3086 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3087 | -c "Use of CID extension negotiated" \ |
| 3088 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3089 | -c "Copy CIDs into SSL transform" \ |
| 3090 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3091 | -c "Peer CID (length 0 Bytes):" \ |
| 3092 | -s "Use of Connection ID has been negotiated" \ |
| 3093 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3094 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3095 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3096 | 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] | 3097 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3098 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3099 | 0 \ |
| 3100 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3101 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3102 | -c "client hello, adding CID extension" \ |
| 3103 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3104 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3105 | -s "server hello, adding CID extension" \ |
| 3106 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3107 | -c "Use of CID extension negotiated" \ |
| 3108 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3109 | -c "Copy CIDs into SSL transform" \ |
| 3110 | -S "Use of Connection ID has been negotiated" \ |
| 3111 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3112 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3113 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3114 | 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] | 3115 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3116 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3117 | 0 \ |
| 3118 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3119 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3120 | -c "client hello, adding CID extension" \ |
| 3121 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3122 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3123 | -s "server hello, adding CID extension" \ |
| 3124 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3125 | -c "Use of CID extension negotiated" \ |
| 3126 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3127 | -c "Copy CIDs into SSL transform" \ |
| 3128 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3129 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3130 | -s "Use of Connection ID has been negotiated" \ |
| 3131 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3132 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3133 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3134 | 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] | 3135 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3136 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3137 | 0 \ |
| 3138 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3139 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3140 | -c "client hello, adding CID extension" \ |
| 3141 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3142 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3143 | -s "server hello, adding CID extension" \ |
| 3144 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3145 | -c "Use of CID extension negotiated" \ |
| 3146 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3147 | -c "Copy CIDs into SSL transform" \ |
| 3148 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3149 | -s "Peer CID (length 0 Bytes):" \ |
| 3150 | -s "Use of Connection ID has been negotiated" \ |
| 3151 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3152 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3153 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3154 | 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] | 3155 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3156 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3157 | 0 \ |
| 3158 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3159 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3160 | -c "client hello, adding CID extension" \ |
| 3161 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3162 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3163 | -s "server hello, adding CID extension" \ |
| 3164 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3165 | -c "Use of CID extension negotiated" \ |
| 3166 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3167 | -c "Copy CIDs into SSL transform" \ |
| 3168 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3169 | -c "Peer CID (length 0 Bytes):" \ |
| 3170 | -s "Use of Connection ID has been negotiated" \ |
| 3171 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3172 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3173 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3174 | 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] | 3175 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3176 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3177 | 0 \ |
| 3178 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3179 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3180 | -c "client hello, adding CID extension" \ |
| 3181 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3182 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3183 | -s "server hello, adding CID extension" \ |
| 3184 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3185 | -c "Use of CID extension negotiated" \ |
| 3186 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3187 | -c "Copy CIDs into SSL transform" \ |
| 3188 | -S "Use of Connection ID has been negotiated" \ |
| 3189 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3190 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3192 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3193 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3194 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3195 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3196 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3197 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3198 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3199 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3200 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3201 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3202 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3203 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3204 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3205 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3206 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3208 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3209 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3210 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3211 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3212 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3213 | 0 \ |
| 3214 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3215 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3216 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3217 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3218 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3219 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3220 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3221 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3222 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3224 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3225 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3226 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3227 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3228 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3229 | 0 \ |
| 3230 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3231 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3232 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3233 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3234 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3235 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3236 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3237 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3238 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3240 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3241 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3242 | 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] | 3243 | -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] | 3244 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3245 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3246 | 0 \ |
| 3247 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3248 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3249 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3250 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3251 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3252 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3253 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3254 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3255 | -c "ignoring unexpected CID" \ |
| 3256 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3257 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3259 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3260 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3261 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3262 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3263 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3264 | 0 \ |
| 3265 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3266 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3267 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3268 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3269 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3270 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3271 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3272 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3273 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3275 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3276 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3277 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3278 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3279 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3280 | 0 \ |
| 3281 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3282 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3283 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3284 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3285 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3286 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3287 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3288 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3289 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3291 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3292 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3293 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3294 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3295 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3296 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3297 | 0 \ |
| 3298 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3299 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3300 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3301 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3302 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3303 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3304 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3305 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3306 | -c "ignoring unexpected CID" \ |
| 3307 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3308 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3312 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3313 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3314 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3315 | 0 \ |
| 3316 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3317 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3318 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3319 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3320 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3321 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3322 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3324 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3325 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3326 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3327 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3328 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3329 | 0 \ |
| 3330 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3331 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3332 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3333 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3334 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3335 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3336 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3338 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3339 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3340 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3341 | -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] | 3342 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3343 | "$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" \ |
| 3344 | 0 \ |
| 3345 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3346 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3347 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3348 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3349 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3350 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3351 | -c "ignoring unexpected CID" \ |
| 3352 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3353 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3355 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3356 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3357 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3358 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3359 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3360 | 0 \ |
| 3361 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3362 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3363 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3364 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3365 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3366 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3367 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3368 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3369 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3370 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3373 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3374 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3375 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3376 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3377 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3378 | 0 \ |
| 3379 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3380 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3381 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3382 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3383 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3384 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3385 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3386 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3387 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3388 | -c "ignoring unexpected CID" \ |
| 3389 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3390 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3393 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3394 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3395 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3396 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3397 | 0 \ |
| 3398 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3399 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3400 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3401 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3402 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3403 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3404 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3405 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3406 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3407 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3410 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3411 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3412 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3413 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3414 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3415 | 0 \ |
| 3416 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3417 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3418 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3419 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3420 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3421 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3422 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3423 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3424 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3425 | -c "ignoring unexpected CID" \ |
| 3426 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3427 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3428 | # 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] | 3429 | # tests check that the buffer contents are reallocated when the message is |
| 3430 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3431 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3432 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3433 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3434 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3435 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3436 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3437 | 0 \ |
| 3438 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3439 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3440 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3441 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3442 | -s "Reallocating in_buf" \ |
| 3443 | -s "Reallocating out_buf" |
| 3444 | |
| 3445 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3446 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3447 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3448 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3449 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3450 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3451 | 0 \ |
| 3452 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3453 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3454 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3455 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3456 | -s "Reallocating in_buf" \ |
| 3457 | -s "Reallocating out_buf" |
| 3458 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3459 | # Tests for Encrypt-then-MAC extension |
| 3460 | |
| 3461 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3462 | "$P_SRV debug_level=3 \ |
| 3463 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3464 | "$P_CLI debug_level=3" \ |
| 3465 | 0 \ |
| 3466 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3467 | -s "found encrypt then mac extension" \ |
| 3468 | -s "server hello, adding encrypt then mac extension" \ |
| 3469 | -c "found encrypt_then_mac extension" \ |
| 3470 | -c "using encrypt then mac" \ |
| 3471 | -s "using encrypt then mac" |
| 3472 | |
| 3473 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3474 | "$P_SRV debug_level=3 etm=0 \ |
| 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 etm=1" \ |
| 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 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3485 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3486 | "$P_SRV debug_level=3 etm=1 \ |
| 3487 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3488 | "$P_CLI debug_level=3 etm=1" \ |
| 3489 | 0 \ |
| 3490 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3491 | -s "found encrypt then mac extension" \ |
| 3492 | -S "server hello, adding encrypt then mac extension" \ |
| 3493 | -C "found encrypt_then_mac extension" \ |
| 3494 | -C "using encrypt then mac" \ |
| 3495 | -S "using encrypt then mac" |
| 3496 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3497 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3498 | "$P_SRV debug_level=3 etm=1 \ |
| 3499 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3500 | "$P_CLI debug_level=3 etm=0" \ |
| 3501 | 0 \ |
| 3502 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3503 | -S "found encrypt then mac extension" \ |
| 3504 | -S "server hello, adding encrypt then mac extension" \ |
| 3505 | -C "found encrypt_then_mac extension" \ |
| 3506 | -C "using encrypt then mac" \ |
| 3507 | -S "using encrypt then mac" |
| 3508 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3509 | # Tests for Extended Master Secret extension |
| 3510 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3511 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3512 | run_test "Extended Master Secret: default" \ |
| 3513 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3514 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3515 | 0 \ |
| 3516 | -c "client hello, adding extended_master_secret extension" \ |
| 3517 | -s "found extended master secret extension" \ |
| 3518 | -s "server hello, adding extended master secret extension" \ |
| 3519 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3520 | -c "session hash for extended master secret" \ |
| 3521 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3522 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3523 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3524 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3525 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3526 | "$P_CLI force_version=tls12 debug_level=3 extended_ms=1" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3527 | 0 \ |
| 3528 | -c "client hello, adding extended_master_secret extension" \ |
| 3529 | -s "found extended master secret extension" \ |
| 3530 | -S "server hello, adding extended master secret extension" \ |
| 3531 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3532 | -C "session hash for extended master secret" \ |
| 3533 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3534 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3535 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3536 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3537 | "$P_SRV force_version=tls12 debug_level=3 extended_ms=1" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3538 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3539 | 0 \ |
| 3540 | -C "client hello, adding extended_master_secret extension" \ |
| 3541 | -S "found extended master secret extension" \ |
| 3542 | -S "server hello, adding extended master secret extension" \ |
| 3543 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3544 | -C "session hash for extended master secret" \ |
| 3545 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3546 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3547 | # Test sending and receiving empty application data records |
| 3548 | |
| 3549 | run_test "Encrypt then MAC: empty application data record" \ |
| 3550 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3551 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3552 | 0 \ |
| 3553 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3554 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3555 | -c "0 bytes written in 1 fragments" |
| 3556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3558 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3559 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3560 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3561 | 0 \ |
| 3562 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3563 | -c "0 bytes written in 1 fragments" |
| 3564 | |
| 3565 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3566 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3567 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3568 | 0 \ |
| 3569 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3570 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3571 | -c "0 bytes written in 1 fragments" |
| 3572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3574 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3575 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3576 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3577 | 0 \ |
| 3578 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3579 | -c "0 bytes written in 1 fragments" |
| 3580 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3581 | # Tests for CBC 1/n-1 record splitting |
| 3582 | |
| 3583 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3584 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3585 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3586 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3587 | 0 \ |
| 3588 | -s "Read from client: 123 bytes read" \ |
| 3589 | -S "Read from client: 1 bytes read" \ |
| 3590 | -S "122 bytes read" |
| 3591 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3592 | # Tests for Session Tickets |
| 3593 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3594 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3595 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3596 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3597 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3598 | -c "client hello, adding session ticket extension" \ |
| 3599 | -s "found session ticket extension" \ |
| 3600 | -s "server hello, adding session ticket extension" \ |
| 3601 | -c "found session_ticket extension" \ |
| 3602 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3603 | -S "session successfully restored from cache" \ |
| 3604 | -s "session successfully restored from ticket" \ |
| 3605 | -s "a session has been resumed" \ |
| 3606 | -c "a session has been resumed" |
| 3607 | |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3608 | run_test "Session resume using tickets: manual rotation" \ |
| 3609 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3610 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3611 | 0 \ |
| 3612 | -c "client hello, adding session ticket extension" \ |
| 3613 | -s "found session ticket extension" \ |
| 3614 | -s "server hello, adding session ticket extension" \ |
| 3615 | -c "found session_ticket extension" \ |
| 3616 | -c "parse new session ticket" \ |
| 3617 | -S "session successfully restored from cache" \ |
| 3618 | -s "session successfully restored from ticket" \ |
| 3619 | -s "a session has been resumed" \ |
| 3620 | -c "a session has been resumed" |
| 3621 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3622 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3623 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3624 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3625 | 0 \ |
| 3626 | -c "client hello, adding session ticket extension" \ |
| 3627 | -s "found session ticket extension" \ |
| 3628 | -s "server hello, adding session ticket extension" \ |
| 3629 | -c "found session_ticket extension" \ |
| 3630 | -c "parse new session ticket" \ |
| 3631 | -S "session successfully restored from cache" \ |
| 3632 | -s "session successfully restored from ticket" \ |
| 3633 | -s "a session has been resumed" \ |
| 3634 | -c "a session has been resumed" |
| 3635 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3636 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3637 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3638 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3639 | 0 \ |
| 3640 | -c "client hello, adding session ticket extension" \ |
| 3641 | -s "found session ticket extension" \ |
| 3642 | -s "server hello, adding session ticket extension" \ |
| 3643 | -c "found session_ticket extension" \ |
| 3644 | -c "parse new session ticket" \ |
| 3645 | -S "session successfully restored from cache" \ |
| 3646 | -S "session successfully restored from ticket" \ |
| 3647 | -S "a session has been resumed" \ |
| 3648 | -C "a session has been resumed" |
| 3649 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3650 | run_test "Session resume using tickets: session copy" \ |
| 3651 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3652 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3653 | 0 \ |
| 3654 | -c "client hello, adding session ticket extension" \ |
| 3655 | -s "found session ticket extension" \ |
| 3656 | -s "server hello, adding session ticket extension" \ |
| 3657 | -c "found session_ticket extension" \ |
| 3658 | -c "parse new session ticket" \ |
| 3659 | -S "session successfully restored from cache" \ |
| 3660 | -s "session successfully restored from ticket" \ |
| 3661 | -s "a session has been resumed" \ |
| 3662 | -c "a session has been resumed" |
| 3663 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3665 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3666 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3667 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3668 | 0 \ |
| 3669 | -c "client hello, adding session ticket extension" \ |
| 3670 | -c "found session_ticket extension" \ |
| 3671 | -c "parse new session ticket" \ |
| 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3675 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3676 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3677 | "( $O_CLI -sess_out $SESSION; \ |
| 3678 | $O_CLI -sess_in $SESSION; \ |
| 3679 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3680 | 0 \ |
| 3681 | -s "found session ticket extension" \ |
| 3682 | -s "server hello, adding session ticket extension" \ |
| 3683 | -S "session successfully restored from cache" \ |
| 3684 | -s "session successfully restored from ticket" \ |
| 3685 | -s "a session has been resumed" |
| 3686 | |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3687 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3688 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3689 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3690 | 0 \ |
| 3691 | -c "client hello, adding session ticket extension" \ |
| 3692 | -s "found session ticket extension" \ |
| 3693 | -s "server hello, adding session ticket extension" \ |
| 3694 | -c "found session_ticket extension" \ |
| 3695 | -c "parse new session ticket" \ |
| 3696 | -S "session successfully restored from cache" \ |
| 3697 | -s "session successfully restored from ticket" \ |
| 3698 | -s "a session has been resumed" \ |
| 3699 | -c "a session has been resumed" |
| 3700 | |
| 3701 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3702 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3703 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3704 | 0 \ |
| 3705 | -c "client hello, adding session ticket extension" \ |
| 3706 | -s "found session ticket extension" \ |
| 3707 | -s "server hello, adding session ticket extension" \ |
| 3708 | -c "found session_ticket extension" \ |
| 3709 | -c "parse new session ticket" \ |
| 3710 | -S "session successfully restored from cache" \ |
| 3711 | -s "session successfully restored from ticket" \ |
| 3712 | -s "a session has been resumed" \ |
| 3713 | -c "a session has been resumed" |
| 3714 | |
| 3715 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3716 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3717 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3718 | 0 \ |
| 3719 | -c "client hello, adding session ticket extension" \ |
| 3720 | -s "found session ticket extension" \ |
| 3721 | -s "server hello, adding session ticket extension" \ |
| 3722 | -c "found session_ticket extension" \ |
| 3723 | -c "parse new session ticket" \ |
| 3724 | -S "session successfully restored from cache" \ |
| 3725 | -s "session successfully restored from ticket" \ |
| 3726 | -s "a session has been resumed" \ |
| 3727 | -c "a session has been resumed" |
| 3728 | |
| 3729 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3730 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3731 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3732 | 0 \ |
| 3733 | -c "client hello, adding session ticket extension" \ |
| 3734 | -s "found session ticket extension" \ |
| 3735 | -s "server hello, adding session ticket extension" \ |
| 3736 | -c "found session_ticket extension" \ |
| 3737 | -c "parse new session ticket" \ |
| 3738 | -S "session successfully restored from cache" \ |
| 3739 | -s "session successfully restored from ticket" \ |
| 3740 | -s "a session has been resumed" \ |
| 3741 | -c "a session has been resumed" |
| 3742 | |
| 3743 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3744 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3745 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 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 | |
| 3757 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3758 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3759 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3760 | 0 \ |
| 3761 | -c "client hello, adding session ticket extension" \ |
| 3762 | -s "found session ticket extension" \ |
| 3763 | -s "server hello, adding session ticket extension" \ |
| 3764 | -c "found session_ticket extension" \ |
| 3765 | -c "parse new session ticket" \ |
| 3766 | -S "session successfully restored from cache" \ |
| 3767 | -s "session successfully restored from ticket" \ |
| 3768 | -s "a session has been resumed" \ |
| 3769 | -c "a session has been resumed" |
| 3770 | |
| 3771 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3772 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3773 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3774 | 0 \ |
| 3775 | -c "client hello, adding session ticket extension" \ |
| 3776 | -s "found session ticket extension" \ |
| 3777 | -s "server hello, adding session ticket extension" \ |
| 3778 | -c "found session_ticket extension" \ |
| 3779 | -c "parse new session ticket" \ |
| 3780 | -S "session successfully restored from cache" \ |
| 3781 | -s "session successfully restored from ticket" \ |
| 3782 | -s "a session has been resumed" \ |
| 3783 | -c "a session has been resumed" |
| 3784 | |
| 3785 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3786 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3787 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3788 | 0 \ |
| 3789 | -c "client hello, adding session ticket extension" \ |
| 3790 | -s "found session ticket extension" \ |
| 3791 | -s "server hello, adding session ticket extension" \ |
| 3792 | -c "found session_ticket extension" \ |
| 3793 | -c "parse new session ticket" \ |
| 3794 | -S "session successfully restored from cache" \ |
| 3795 | -s "session successfully restored from ticket" \ |
| 3796 | -s "a session has been resumed" \ |
| 3797 | -c "a session has been resumed" |
| 3798 | |
| 3799 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3800 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3801 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3802 | 0 \ |
| 3803 | -c "client hello, adding session ticket extension" \ |
| 3804 | -s "found session ticket extension" \ |
| 3805 | -s "server hello, adding session ticket extension" \ |
| 3806 | -c "found session_ticket extension" \ |
| 3807 | -c "parse new session ticket" \ |
| 3808 | -S "session successfully restored from cache" \ |
| 3809 | -s "session successfully restored from ticket" \ |
| 3810 | -s "a session has been resumed" \ |
| 3811 | -c "a session has been resumed" |
| 3812 | |
| 3813 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3814 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3815 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3816 | 0 \ |
| 3817 | -c "client hello, adding session ticket extension" \ |
| 3818 | -s "found session ticket extension" \ |
| 3819 | -s "server hello, adding session ticket extension" \ |
| 3820 | -c "found session_ticket extension" \ |
| 3821 | -c "parse new session ticket" \ |
| 3822 | -S "session successfully restored from cache" \ |
| 3823 | -s "session successfully restored from ticket" \ |
| 3824 | -s "a session has been resumed" \ |
| 3825 | -c "a session has been resumed" |
| 3826 | |
| 3827 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3828 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3829 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3830 | 0 \ |
| 3831 | -c "client hello, adding session ticket extension" \ |
| 3832 | -s "found session ticket extension" \ |
| 3833 | -s "server hello, adding session ticket extension" \ |
| 3834 | -c "found session_ticket extension" \ |
| 3835 | -c "parse new session ticket" \ |
| 3836 | -S "session successfully restored from cache" \ |
| 3837 | -s "session successfully restored from ticket" \ |
| 3838 | -s "a session has been resumed" \ |
| 3839 | -c "a session has been resumed" |
| 3840 | |
| 3841 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3842 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3843 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3844 | 0 \ |
| 3845 | -c "client hello, adding session ticket extension" \ |
| 3846 | -s "found session ticket extension" \ |
| 3847 | -s "server hello, adding session ticket extension" \ |
| 3848 | -c "found session_ticket extension" \ |
| 3849 | -c "parse new session ticket" \ |
| 3850 | -S "session successfully restored from cache" \ |
| 3851 | -s "session successfully restored from ticket" \ |
| 3852 | -s "a session has been resumed" \ |
| 3853 | -c "a session has been resumed" |
| 3854 | |
| 3855 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3856 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3857 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3858 | 0 \ |
| 3859 | -c "client hello, adding session ticket extension" \ |
| 3860 | -s "found session ticket extension" \ |
| 3861 | -s "server hello, adding session ticket extension" \ |
| 3862 | -c "found session_ticket extension" \ |
| 3863 | -c "parse new session ticket" \ |
| 3864 | -S "session successfully restored from cache" \ |
| 3865 | -s "session successfully restored from ticket" \ |
| 3866 | -s "a session has been resumed" \ |
| 3867 | -c "a session has been resumed" |
| 3868 | |
| 3869 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3870 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3871 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3872 | 0 \ |
| 3873 | -c "client hello, adding session ticket extension" \ |
| 3874 | -s "found session ticket extension" \ |
| 3875 | -s "server hello, adding session ticket extension" \ |
| 3876 | -c "found session_ticket extension" \ |
| 3877 | -c "parse new session ticket" \ |
| 3878 | -S "session successfully restored from cache" \ |
| 3879 | -s "session successfully restored from ticket" \ |
| 3880 | -s "a session has been resumed" \ |
| 3881 | -c "a session has been resumed" |
| 3882 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3883 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3884 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3885 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3886 | 0 \ |
| 3887 | -c "client hello, adding session ticket extension" \ |
| 3888 | -s "found session ticket extension" \ |
| 3889 | -s "server hello, adding session ticket extension" \ |
| 3890 | -c "found session_ticket extension" \ |
| 3891 | -c "parse new session ticket" \ |
| 3892 | -S "session successfully restored from cache" \ |
| 3893 | -s "session successfully restored from ticket" \ |
| 3894 | -s "a session has been resumed" \ |
| 3895 | -c "a session has been resumed" |
| 3896 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3897 | # Tests for Session Tickets with DTLS |
| 3898 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3900 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3901 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3902 | "$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] | 3903 | 0 \ |
| 3904 | -c "client hello, adding session ticket extension" \ |
| 3905 | -s "found session ticket extension" \ |
| 3906 | -s "server hello, adding session ticket extension" \ |
| 3907 | -c "found session_ticket extension" \ |
| 3908 | -c "parse new session ticket" \ |
| 3909 | -S "session successfully restored from cache" \ |
| 3910 | -s "session successfully restored from ticket" \ |
| 3911 | -s "a session has been resumed" \ |
| 3912 | -c "a session has been resumed" |
| 3913 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3915 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3916 | "$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] | 3917 | "$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] | 3918 | 0 \ |
| 3919 | -c "client hello, adding session ticket extension" \ |
| 3920 | -s "found session ticket extension" \ |
| 3921 | -s "server hello, adding session ticket extension" \ |
| 3922 | -c "found session_ticket extension" \ |
| 3923 | -c "parse new session ticket" \ |
| 3924 | -S "session successfully restored from cache" \ |
| 3925 | -s "session successfully restored from ticket" \ |
| 3926 | -s "a session has been resumed" \ |
| 3927 | -c "a session has been resumed" |
| 3928 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3930 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3931 | "$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] | 3932 | "$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] | 3933 | 0 \ |
| 3934 | -c "client hello, adding session ticket extension" \ |
| 3935 | -s "found session ticket extension" \ |
| 3936 | -s "server hello, adding session ticket extension" \ |
| 3937 | -c "found session_ticket extension" \ |
| 3938 | -c "parse new session ticket" \ |
| 3939 | -S "session successfully restored from cache" \ |
| 3940 | -S "session successfully restored from ticket" \ |
| 3941 | -S "a session has been resumed" \ |
| 3942 | -C "a session has been resumed" |
| 3943 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3945 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3946 | "$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] | 3947 | "$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] | 3948 | 0 \ |
| 3949 | -c "client hello, adding session ticket extension" \ |
| 3950 | -s "found session ticket extension" \ |
| 3951 | -s "server hello, adding session ticket extension" \ |
| 3952 | -c "found session_ticket extension" \ |
| 3953 | -c "parse new session ticket" \ |
| 3954 | -S "session successfully restored from cache" \ |
| 3955 | -s "session successfully restored from ticket" \ |
| 3956 | -s "a session has been resumed" \ |
| 3957 | -c "a session has been resumed" |
| 3958 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3960 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3961 | "$O_SRV -dtls" \ |
| 3962 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3963 | 0 \ |
| 3964 | -c "client hello, adding session ticket extension" \ |
| 3965 | -c "found session_ticket extension" \ |
| 3966 | -c "parse new session ticket" \ |
| 3967 | -c "a session has been resumed" |
| 3968 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3969 | # 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] | 3970 | # 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] | 3971 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3973 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3974 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3975 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3976 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3977 | rm -f $SESSION )" \ |
| 3978 | 0 \ |
| 3979 | -s "found session ticket extension" \ |
| 3980 | -s "server hello, adding session ticket extension" \ |
| 3981 | -S "session successfully restored from cache" \ |
| 3982 | -s "session successfully restored from ticket" \ |
| 3983 | -s "a session has been resumed" |
| 3984 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3985 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3986 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3987 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3988 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3989 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3990 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3991 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3992 | -c "client hello, adding session ticket extension" \ |
| 3993 | -s "found session ticket extension" \ |
| 3994 | -S "server hello, adding session ticket extension" \ |
| 3995 | -C "found session_ticket extension" \ |
| 3996 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3997 | -s "session successfully restored from cache" \ |
| 3998 | -S "session successfully restored from ticket" \ |
| 3999 | -s "a session has been resumed" \ |
| 4000 | -c "a session has been resumed" |
| 4001 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4002 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4003 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4004 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4005 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4006 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4007 | -C "client hello, adding session ticket extension" \ |
| 4008 | -S "found session ticket extension" \ |
| 4009 | -S "server hello, adding session ticket extension" \ |
| 4010 | -C "found session_ticket extension" \ |
| 4011 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4012 | -s "session successfully restored from cache" \ |
| 4013 | -S "session successfully restored from ticket" \ |
| 4014 | -s "a session has been resumed" \ |
| 4015 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4016 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4017 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4018 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4019 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4020 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4021 | 0 \ |
| 4022 | -S "session successfully restored from cache" \ |
| 4023 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4024 | -S "a session has been resumed" \ |
| 4025 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4026 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4027 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4028 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4029 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4030 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4031 | 0 \ |
| 4032 | -s "session successfully restored from cache" \ |
| 4033 | -S "session successfully restored from ticket" \ |
| 4034 | -s "a session has been resumed" \ |
| 4035 | -c "a session has been resumed" |
| 4036 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4037 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4038 | run_test "Session resume using cache: cache removed" \ |
| 4039 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4040 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4041 | 0 \ |
| 4042 | -C "client hello, adding session ticket extension" \ |
| 4043 | -S "found session ticket extension" \ |
| 4044 | -S "server hello, adding session ticket extension" \ |
| 4045 | -C "found session_ticket extension" \ |
| 4046 | -C "parse new session ticket" \ |
| 4047 | -S "session successfully restored from cache" \ |
| 4048 | -S "session successfully restored from ticket" \ |
| 4049 | -S "a session has been resumed" \ |
| 4050 | -C "a session has been resumed" |
| 4051 | |
| 4052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4053 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4054 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4055 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4056 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4057 | 0 \ |
| 4058 | -s "session successfully restored from cache" \ |
| 4059 | -S "session successfully restored from ticket" \ |
| 4060 | -s "a session has been resumed" \ |
| 4061 | -c "a session has been resumed" |
| 4062 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4063 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4064 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4065 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4066 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4067 | 0 \ |
| 4068 | -S "session successfully restored from cache" \ |
| 4069 | -S "session successfully restored from ticket" \ |
| 4070 | -S "a session has been resumed" \ |
| 4071 | -C "a session has been resumed" |
| 4072 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4073 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4074 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4075 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4076 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4077 | 0 \ |
| 4078 | -s "session successfully restored from cache" \ |
| 4079 | -S "session successfully restored from ticket" \ |
| 4080 | -s "a session has been resumed" \ |
| 4081 | -c "a session has been resumed" |
| 4082 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4083 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4084 | run_test "Session resume using cache: session copy" \ |
| 4085 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4086 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4087 | 0 \ |
| 4088 | -s "session successfully restored from cache" \ |
| 4089 | -S "session successfully restored from ticket" \ |
| 4090 | -s "a session has been resumed" \ |
| 4091 | -c "a session has been resumed" |
| 4092 | |
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: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4095 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4096 | "( $O_CLI -sess_out $SESSION; \ |
| 4097 | $O_CLI -sess_in $SESSION; \ |
| 4098 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4099 | 0 \ |
| 4100 | -s "found session ticket extension" \ |
| 4101 | -S "server hello, adding session ticket extension" \ |
| 4102 | -s "session successfully restored from cache" \ |
| 4103 | -S "session successfully restored from ticket" \ |
| 4104 | -s "a session has been resumed" |
| 4105 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4107 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4108 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4109 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4110 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4111 | 0 \ |
| 4112 | -C "found session_ticket extension" \ |
| 4113 | -C "parse new session ticket" \ |
| 4114 | -c "a session has been resumed" |
| 4115 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4116 | # Tests for Session resume and extensions |
| 4117 | |
| 4118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4119 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4120 | run_test "Session resume and connection ID" \ |
| 4121 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4122 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4123 | 0 \ |
| 4124 | -c "Enable use of CID extension." \ |
| 4125 | -s "Enable use of CID extension." \ |
| 4126 | -c "client hello, adding CID extension" \ |
| 4127 | -s "found CID extension" \ |
| 4128 | -s "Use of CID extension negotiated" \ |
| 4129 | -s "server hello, adding CID extension" \ |
| 4130 | -c "found CID extension" \ |
| 4131 | -c "Use of CID extension negotiated" \ |
| 4132 | -s "Copy CIDs into SSL transform" \ |
| 4133 | -c "Copy CIDs into SSL transform" \ |
| 4134 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4135 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4136 | -s "Use of Connection ID has been negotiated" \ |
| 4137 | -c "Use of Connection ID has been negotiated" |
| 4138 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4139 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4140 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4142 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4143 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4144 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4145 | "$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] | 4146 | 0 \ |
| 4147 | -c "client hello, adding session ticket extension" \ |
| 4148 | -s "found session ticket extension" \ |
| 4149 | -S "server hello, adding session ticket extension" \ |
| 4150 | -C "found session_ticket extension" \ |
| 4151 | -C "parse new session ticket" \ |
| 4152 | -s "session successfully restored from cache" \ |
| 4153 | -S "session successfully restored from ticket" \ |
| 4154 | -s "a session has been resumed" \ |
| 4155 | -c "a session has been resumed" |
| 4156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4158 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4159 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4160 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4161 | "$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] | 4162 | 0 \ |
| 4163 | -C "client hello, adding session ticket extension" \ |
| 4164 | -S "found session ticket extension" \ |
| 4165 | -S "server hello, adding session ticket extension" \ |
| 4166 | -C "found session_ticket extension" \ |
| 4167 | -C "parse new session ticket" \ |
| 4168 | -s "session successfully restored from cache" \ |
| 4169 | -S "session successfully restored from ticket" \ |
| 4170 | -s "a session has been resumed" \ |
| 4171 | -c "a session has been resumed" |
| 4172 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4174 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4175 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4176 | "$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] | 4177 | "$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] | 4178 | 0 \ |
| 4179 | -S "session successfully restored from cache" \ |
| 4180 | -S "session successfully restored from ticket" \ |
| 4181 | -S "a session has been resumed" \ |
| 4182 | -C "a session has been resumed" |
| 4183 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4185 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4186 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4187 | "$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] | 4188 | "$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] | 4189 | 0 \ |
| 4190 | -s "session successfully restored from cache" \ |
| 4191 | -S "session successfully restored from ticket" \ |
| 4192 | -s "a session has been resumed" \ |
| 4193 | -c "a session has been resumed" |
| 4194 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4196 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4197 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4198 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4199 | "$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] | 4200 | 0 \ |
| 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: timeout < delay" \ |
| 4209 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4210 | "$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] | 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: no timeout" \ |
| 4220 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4221 | "$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] | 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 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4230 | run_test "Session resume using cache, DTLS: session copy" \ |
| 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_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [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 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4239 | # 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] | 4240 | # 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] | 4241 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4244 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4245 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4246 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4247 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4248 | rm -f $SESSION )" \ |
| 4249 | 0 \ |
| 4250 | -s "found session ticket extension" \ |
| 4251 | -S "server hello, adding session ticket extension" \ |
| 4252 | -s "session successfully restored from cache" \ |
| 4253 | -S "session successfully restored from ticket" \ |
| 4254 | -s "a session has been resumed" |
| 4255 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4257 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4258 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4259 | "$O_SRV -dtls" \ |
| 4260 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4261 | 0 \ |
| 4262 | -C "found session_ticket extension" \ |
| 4263 | -C "parse new session ticket" \ |
| 4264 | -c "a session has been resumed" |
| 4265 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4266 | # Tests for Max Fragment Length extension |
| 4267 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4268 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4270 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4271 | "$P_SRV debug_level=3" \ |
| 4272 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4273 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4274 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4275 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4276 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4277 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4278 | -C "client hello, adding max_fragment_length extension" \ |
| 4279 | -S "found max fragment length extension" \ |
| 4280 | -S "server hello, max_fragment_length extension" \ |
| 4281 | -C "found max_fragment_length extension" |
| 4282 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4283 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4285 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4286 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4287 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4288 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4289 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4290 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4291 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4292 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4293 | -C "client hello, adding max_fragment_length extension" \ |
| 4294 | -S "found max fragment length extension" \ |
| 4295 | -S "server hello, max_fragment_length extension" \ |
| 4296 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4297 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4298 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4299 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4300 | |
| 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, DTLS: enabled, default, larger message" \ |
| 4304 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4305 | "$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] | 4306 | 1 \ |
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" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +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 | -c "fragment larger than.*maximum " |
| 4316 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4317 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4318 | # (session fragment length will be 16384 regardless of mbedtls |
| 4319 | # content length configuration.) |
| 4320 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4321 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4323 | run_test "Max fragment length: disabled, larger message" \ |
| 4324 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4325 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4326 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4327 | -C "Maximum incoming record payload length is 16384" \ |
| 4328 | -C "Maximum outgoing record payload length is 16384" \ |
| 4329 | -S "Maximum incoming record payload length is 16384" \ |
| 4330 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4331 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4332 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4333 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4334 | |
| 4335 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4337 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4338 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4339 | "$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] | 4340 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4341 | -C "Maximum incoming record payload length is 16384" \ |
| 4342 | -C "Maximum outgoing record payload length is 16384" \ |
| 4343 | -S "Maximum incoming record payload length is 16384" \ |
| 4344 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4345 | -c "fragment larger than.*maximum " |
| 4346 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4347 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4348 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4349 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4350 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4351 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4352 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4353 | -c "Maximum incoming record payload length is 4096" \ |
| 4354 | -c "Maximum outgoing record payload length is 4096" \ |
| 4355 | -s "Maximum incoming record payload length is 4096" \ |
| 4356 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4357 | -c "client hello, adding max_fragment_length extension" \ |
| 4358 | -s "found max fragment length extension" \ |
| 4359 | -s "server hello, max_fragment_length extension" \ |
| 4360 | -c "found max_fragment_length extension" |
| 4361 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4362 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4363 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4364 | run_test "Max fragment length: client 512, server 1024" \ |
| 4365 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4366 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4367 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4368 | -c "Maximum incoming record payload length is 512" \ |
| 4369 | -c "Maximum outgoing record payload length is 512" \ |
| 4370 | -s "Maximum incoming record payload length is 512" \ |
| 4371 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4372 | -c "client hello, adding max_fragment_length extension" \ |
| 4373 | -s "found max fragment length extension" \ |
| 4374 | -s "server hello, max_fragment_length extension" \ |
| 4375 | -c "found max_fragment_length extension" |
| 4376 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4377 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4378 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4379 | run_test "Max fragment length: client 512, server 2048" \ |
| 4380 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4381 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4382 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4383 | -c "Maximum incoming record payload length is 512" \ |
| 4384 | -c "Maximum outgoing record payload length is 512" \ |
| 4385 | -s "Maximum incoming record payload length is 512" \ |
| 4386 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4387 | -c "client hello, adding max_fragment_length extension" \ |
| 4388 | -s "found max fragment length extension" \ |
| 4389 | -s "server hello, max_fragment_length extension" \ |
| 4390 | -c "found max_fragment_length extension" |
| 4391 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4392 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4393 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4394 | run_test "Max fragment length: client 512, server 4096" \ |
| 4395 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4396 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4397 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4398 | -c "Maximum incoming record payload length is 512" \ |
| 4399 | -c "Maximum outgoing record payload length is 512" \ |
| 4400 | -s "Maximum incoming record payload length is 512" \ |
| 4401 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4402 | -c "client hello, adding max_fragment_length extension" \ |
| 4403 | -s "found max fragment length extension" \ |
| 4404 | -s "server hello, max_fragment_length extension" \ |
| 4405 | -c "found max_fragment_length extension" |
| 4406 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4407 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4408 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4409 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4410 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4411 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4412 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4413 | -c "Maximum incoming record payload length is 1024" \ |
| 4414 | -c "Maximum outgoing record payload length is 1024" \ |
| 4415 | -s "Maximum incoming record payload length is 1024" \ |
| 4416 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4417 | -c "client hello, adding max_fragment_length extension" \ |
| 4418 | -s "found max fragment length extension" \ |
| 4419 | -s "server hello, max_fragment_length extension" \ |
| 4420 | -c "found max_fragment_length extension" |
| 4421 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4422 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4423 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4424 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4425 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4426 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4427 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4428 | -c "Maximum incoming record payload length is 1024" \ |
| 4429 | -c "Maximum outgoing record payload length is 1024" \ |
| 4430 | -s "Maximum incoming record payload length is 1024" \ |
| 4431 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4432 | -c "client hello, adding max_fragment_length extension" \ |
| 4433 | -s "found max fragment length extension" \ |
| 4434 | -s "server hello, max_fragment_length extension" \ |
| 4435 | -c "found max_fragment_length extension" |
| 4436 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4437 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4438 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4439 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4440 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4441 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4442 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4443 | -c "Maximum incoming record payload length is 1024" \ |
| 4444 | -c "Maximum outgoing record payload length is 1024" \ |
| 4445 | -s "Maximum incoming record payload length is 1024" \ |
| 4446 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4447 | -c "client hello, adding max_fragment_length extension" \ |
| 4448 | -s "found max fragment length extension" \ |
| 4449 | -s "server hello, max_fragment_length extension" \ |
| 4450 | -c "found max_fragment_length extension" |
| 4451 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4452 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4453 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4454 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4455 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4456 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4457 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4458 | -c "Maximum incoming record payload length is 2048" \ |
| 4459 | -c "Maximum outgoing record payload length is 2048" \ |
| 4460 | -s "Maximum incoming record payload length is 2048" \ |
| 4461 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4462 | -c "client hello, adding max_fragment_length extension" \ |
| 4463 | -s "found max fragment length extension" \ |
| 4464 | -s "server hello, max_fragment_length extension" \ |
| 4465 | -c "found max_fragment_length extension" |
| 4466 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4467 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4468 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4469 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4470 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4471 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4472 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4473 | -c "Maximum incoming record payload length is 2048" \ |
| 4474 | -c "Maximum outgoing record payload length is 2048" \ |
| 4475 | -s "Maximum incoming record payload length is 2048" \ |
| 4476 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4477 | -c "client hello, adding max_fragment_length extension" \ |
| 4478 | -s "found max fragment length extension" \ |
| 4479 | -s "server hello, max_fragment_length extension" \ |
| 4480 | -c "found max_fragment_length extension" |
| 4481 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4482 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4483 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4484 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4485 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4486 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4487 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4488 | -c "Maximum incoming record payload length is 2048" \ |
| 4489 | -c "Maximum outgoing record payload length is 2048" \ |
| 4490 | -s "Maximum incoming record payload length is 2048" \ |
| 4491 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4492 | -c "client hello, adding max_fragment_length extension" \ |
| 4493 | -s "found max fragment length extension" \ |
| 4494 | -s "server hello, max_fragment_length extension" \ |
| 4495 | -c "found max_fragment_length extension" |
| 4496 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4497 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4498 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4499 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4500 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4501 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4502 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4503 | -c "Maximum incoming record payload length is 4096" \ |
| 4504 | -c "Maximum outgoing record payload length is 4096" \ |
| 4505 | -s "Maximum incoming record payload length is 4096" \ |
| 4506 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4507 | -c "client hello, adding max_fragment_length extension" \ |
| 4508 | -s "found max fragment length extension" \ |
| 4509 | -s "server hello, max_fragment_length extension" \ |
| 4510 | -c "found max_fragment_length extension" |
| 4511 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4512 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4513 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4514 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4515 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4516 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4517 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4518 | -c "Maximum incoming record payload length is 4096" \ |
| 4519 | -c "Maximum outgoing record payload length is 4096" \ |
| 4520 | -s "Maximum incoming record payload length is 4096" \ |
| 4521 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4522 | -c "client hello, adding max_fragment_length extension" \ |
| 4523 | -s "found max fragment length extension" \ |
| 4524 | -s "server hello, max_fragment_length extension" \ |
| 4525 | -c "found max_fragment_length extension" |
| 4526 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4527 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4528 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4529 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4530 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4531 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4532 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4533 | -c "Maximum incoming record payload length is 4096" \ |
| 4534 | -c "Maximum outgoing record payload length is 4096" \ |
| 4535 | -s "Maximum incoming record payload length is 4096" \ |
| 4536 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4537 | -c "client hello, adding max_fragment_length extension" \ |
| 4538 | -s "found max fragment length extension" \ |
| 4539 | -s "server hello, max_fragment_length extension" \ |
| 4540 | -c "found max_fragment_length extension" |
| 4541 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4542 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4543 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4544 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4545 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4546 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4547 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4548 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4549 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4550 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4551 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4552 | -C "client hello, adding max_fragment_length extension" \ |
| 4553 | -S "found max fragment length extension" \ |
| 4554 | -S "server hello, max_fragment_length extension" \ |
| 4555 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4556 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4557 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4558 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4559 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4561 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4562 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4563 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4564 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4565 | -c "Maximum incoming record payload length is 4096" \ |
| 4566 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4567 | -c "client hello, adding max_fragment_length extension" \ |
| 4568 | -c "found max_fragment_length extension" |
| 4569 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4570 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4571 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4572 | run_test "Max fragment length: client, message just fits" \ |
| 4573 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4574 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048 request_size=2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4575 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4576 | -c "Maximum incoming record payload length is 2048" \ |
| 4577 | -c "Maximum outgoing record payload length is 2048" \ |
| 4578 | -s "Maximum incoming record payload length is 2048" \ |
| 4579 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4580 | -c "client hello, adding max_fragment_length extension" \ |
| 4581 | -s "found max fragment length extension" \ |
| 4582 | -s "server hello, max_fragment_length extension" \ |
| 4583 | -c "found max_fragment_length extension" \ |
| 4584 | -c "2048 bytes written in 1 fragments" \ |
| 4585 | -s "2048 bytes read" |
| 4586 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4587 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4588 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4589 | run_test "Max fragment length: client, larger message" \ |
| 4590 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4591 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048 request_size=2345" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4592 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4593 | -c "Maximum incoming record payload length is 2048" \ |
| 4594 | -c "Maximum outgoing record payload length is 2048" \ |
| 4595 | -s "Maximum incoming record payload length is 2048" \ |
| 4596 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4597 | -c "client hello, adding max_fragment_length extension" \ |
| 4598 | -s "found max fragment length extension" \ |
| 4599 | -s "server hello, max_fragment_length extension" \ |
| 4600 | -c "found max_fragment_length extension" \ |
| 4601 | -c "2345 bytes written in 2 fragments" \ |
| 4602 | -s "2048 bytes read" \ |
| 4603 | -s "297 bytes read" |
| 4604 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4605 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4606 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
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 | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4608 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4609 | "$P_SRV debug_level=3 dtls=1" \ |
| 4610 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4611 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4612 | -c "Maximum incoming record payload length is 2048" \ |
| 4613 | -c "Maximum outgoing record payload length is 2048" \ |
| 4614 | -s "Maximum incoming record payload length is 2048" \ |
| 4615 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4616 | -c "client hello, adding max_fragment_length extension" \ |
| 4617 | -s "found max fragment length extension" \ |
| 4618 | -s "server hello, max_fragment_length extension" \ |
| 4619 | -c "found max_fragment_length extension" \ |
| 4620 | -c "fragment larger than.*maximum" |
| 4621 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4622 | # Tests for Record Size Limit extension |
| 4623 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4624 | requires_gnutls_tls1_3 |
| 4625 | requires_gnutls_record_size_limit |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4626 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4627 | run_test "Record Size Limit: TLS 1.3: Server-side parsing, debug output and fatal alert" \ |
| 4628 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4629 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4630 | 1 \ |
| 4631 | -c "Preparing extension (Record Size Limit/28) for 'client hello'" \ |
| 4632 | -c "Sending extension Record Size Limit/28 (2 bytes)" \ |
| 4633 | -s "ClientHello: record_size_limit(28) extension received."\ |
| 4634 | -s "found record_size_limit extension" \ |
| 4635 | -s "RecordSizeLimit: 16385 Bytes" \ |
| 4636 | -c "Received alert \[110]: An unsupported extension was sent" |
| 4637 | |
| 4638 | requires_gnutls_tls1_3 |
| 4639 | requires_gnutls_record_size_limit |
| 4640 | requires_gnutls_next_disable_tls13_compat |
| 4641 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4642 | run_test "Record Size Limit: TLS 1.3: Client-side parsing, debug output and fatal alert" \ |
| 4643 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert -d 4" \ |
| 4644 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4645 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4646 | -s "Preparing extension (Record Size Limit/28) for 'encrypted extensions'" |
| 4647 | # The P_CLI can not yet send the Record Size Limit extension. Thus, the G_NEXT_SRV does not send |
| 4648 | # a response in its EncryptedExtensions record. |
| 4649 | # -s "Parsing extension 'Record Size Limit/28 (2 bytes)" \ |
| 4650 | # -s "Sending extension Record Size Limit/28 (2 bytes)" \ |
| 4651 | # -c "EncryptedExtensions: record_size_limit(28) extension received."\ |
| 4652 | # -c "found record_size_limit extension" \ |
| 4653 | # -c "RecordSizeLimit: 16385 Bytes" \ |
| 4654 | # -s "Received alert \[110]: An unsupported extension was sent" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4655 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4656 | # Tests for renegotiation |
| 4657 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4658 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4659 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4660 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4661 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4662 | 0 \ |
| 4663 | -C "client hello, adding renegotiation extension" \ |
| 4664 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4665 | -S "found renegotiation extension" \ |
| 4666 | -s "server hello, secure renegotiation extension" \ |
| 4667 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4668 | -C "=> renegotiate" \ |
| 4669 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4670 | -S "write hello request" |
| 4671 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4672 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4673 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4674 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4675 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4676 | 0 \ |
| 4677 | -c "client hello, adding renegotiation extension" \ |
| 4678 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4679 | -s "found renegotiation extension" \ |
| 4680 | -s "server hello, secure renegotiation extension" \ |
| 4681 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4682 | -c "=> renegotiate" \ |
| 4683 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4684 | -S "write hello request" |
| 4685 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4686 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4687 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4688 | "$P_SRV force_version=tls12 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] | 4689 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4690 | 0 \ |
| 4691 | -c "client hello, adding renegotiation extension" \ |
| 4692 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4693 | -s "found renegotiation extension" \ |
| 4694 | -s "server hello, secure renegotiation extension" \ |
| 4695 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4696 | -c "=> renegotiate" \ |
| 4697 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4698 | -s "write hello request" |
| 4699 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4700 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4701 | # 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] | 4702 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4703 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4704 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4705 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4706 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +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" \ |
| 4713 | -c "=> renegotiate" \ |
| 4714 | -s "=> renegotiate" \ |
| 4715 | -S "write hello request" \ |
| 4716 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4717 | |
| 4718 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4719 | # 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] | 4720 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4721 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4722 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4723 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4724 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4725 | 0 \ |
| 4726 | -c "client hello, adding renegotiation extension" \ |
| 4727 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4728 | -s "found renegotiation extension" \ |
| 4729 | -s "server hello, secure renegotiation extension" \ |
| 4730 | -c "found renegotiation extension" \ |
| 4731 | -c "=> renegotiate" \ |
| 4732 | -s "=> renegotiate" \ |
| 4733 | -s "write hello request" \ |
| 4734 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4735 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4736 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4737 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4738 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4739 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4740 | 0 \ |
| 4741 | -c "client hello, adding renegotiation extension" \ |
| 4742 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4743 | -s "found renegotiation extension" \ |
| 4744 | -s "server hello, secure renegotiation extension" \ |
| 4745 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4746 | -c "=> renegotiate" \ |
| 4747 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4748 | -s "write hello request" |
| 4749 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4750 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4751 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4752 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4753 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4754 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4755 | "$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" \ |
| 4756 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4757 | -c "Maximum incoming record payload length is 2048" \ |
| 4758 | -c "Maximum outgoing record payload length is 2048" \ |
| 4759 | -s "Maximum incoming record payload length is 2048" \ |
| 4760 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4761 | -c "client hello, adding max_fragment_length extension" \ |
| 4762 | -s "found max fragment length extension" \ |
| 4763 | -s "server hello, max_fragment_length extension" \ |
| 4764 | -c "found max_fragment_length extension" \ |
| 4765 | -c "client hello, adding renegotiation extension" \ |
| 4766 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4767 | -s "found renegotiation extension" \ |
| 4768 | -s "server hello, secure renegotiation extension" \ |
| 4769 | -c "found renegotiation extension" \ |
| 4770 | -c "=> renegotiate" \ |
| 4771 | -s "=> renegotiate" \ |
| 4772 | -s "write hello request" |
| 4773 | |
| 4774 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4775 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4776 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4777 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4778 | 1 \ |
| 4779 | -c "client hello, adding renegotiation extension" \ |
| 4780 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4781 | -S "found renegotiation extension" \ |
| 4782 | -s "server hello, secure renegotiation extension" \ |
| 4783 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4784 | -c "=> renegotiate" \ |
| 4785 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4786 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4787 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4788 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4789 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4790 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4791 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4792 | "$P_SRV force_version=tls12 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] | 4793 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4794 | 0 \ |
| 4795 | -C "client hello, adding renegotiation extension" \ |
| 4796 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4797 | -S "found renegotiation extension" \ |
| 4798 | -s "server hello, secure renegotiation extension" \ |
| 4799 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4800 | -C "=> renegotiate" \ |
| 4801 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4802 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4803 | -S "SSL - An unexpected message was received from our peer" \ |
| 4804 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4805 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4806 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4807 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4808 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4809 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4810 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4811 | 0 \ |
| 4812 | -C "client hello, adding renegotiation extension" \ |
| 4813 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4814 | -S "found renegotiation extension" \ |
| 4815 | -s "server hello, secure renegotiation extension" \ |
| 4816 | -c "found renegotiation extension" \ |
| 4817 | -C "=> renegotiate" \ |
| 4818 | -S "=> renegotiate" \ |
| 4819 | -s "write hello request" \ |
| 4820 | -S "SSL - An unexpected message was received from our peer" \ |
| 4821 | -S "failed" |
| 4822 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4823 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4824 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4825 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4826 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4827 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4828 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4829 | 0 \ |
| 4830 | -C "client hello, adding renegotiation extension" \ |
| 4831 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4832 | -S "found renegotiation extension" \ |
| 4833 | -s "server hello, secure renegotiation extension" \ |
| 4834 | -c "found renegotiation extension" \ |
| 4835 | -C "=> renegotiate" \ |
| 4836 | -S "=> renegotiate" \ |
| 4837 | -s "write hello request" \ |
| 4838 | -S "SSL - An unexpected message was received from our peer" \ |
| 4839 | -S "failed" |
| 4840 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4841 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4842 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4843 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4844 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4845 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4846 | 0 \ |
| 4847 | -C "client hello, adding renegotiation extension" \ |
| 4848 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4849 | -S "found renegotiation extension" \ |
| 4850 | -s "server hello, secure renegotiation extension" \ |
| 4851 | -c "found renegotiation extension" \ |
| 4852 | -C "=> renegotiate" \ |
| 4853 | -S "=> renegotiate" \ |
| 4854 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4855 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4856 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4857 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4858 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4859 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4860 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4861 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4862 | 0 \ |
| 4863 | -c "client hello, adding renegotiation extension" \ |
| 4864 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4865 | -s "found renegotiation extension" \ |
| 4866 | -s "server hello, secure renegotiation extension" \ |
| 4867 | -c "found renegotiation extension" \ |
| 4868 | -c "=> renegotiate" \ |
| 4869 | -s "=> renegotiate" \ |
| 4870 | -s "write hello request" \ |
| 4871 | -S "SSL - An unexpected message was received from our peer" \ |
| 4872 | -S "failed" |
| 4873 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4874 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4875 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4876 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4877 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4878 | 0 \ |
| 4879 | -C "client hello, adding renegotiation extension" \ |
| 4880 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4881 | -S "found renegotiation extension" \ |
| 4882 | -s "server hello, secure renegotiation extension" \ |
| 4883 | -c "found renegotiation extension" \ |
| 4884 | -S "record counter limit reached: renegotiate" \ |
| 4885 | -C "=> renegotiate" \ |
| 4886 | -S "=> renegotiate" \ |
| 4887 | -S "write hello request" \ |
| 4888 | -S "SSL - An unexpected message was received from our peer" \ |
| 4889 | -S "failed" |
| 4890 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4891 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4892 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4893 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4894 | "$P_SRV force_version=tls12 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] | 4895 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4896 | 0 \ |
| 4897 | -c "client hello, adding renegotiation extension" \ |
| 4898 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4899 | -s "found renegotiation extension" \ |
| 4900 | -s "server hello, secure renegotiation extension" \ |
| 4901 | -c "found renegotiation extension" \ |
| 4902 | -s "record counter limit reached: renegotiate" \ |
| 4903 | -c "=> renegotiate" \ |
| 4904 | -s "=> renegotiate" \ |
| 4905 | -s "write hello request" \ |
| 4906 | -S "SSL - An unexpected message was received from our peer" \ |
| 4907 | -S "failed" |
| 4908 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4909 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4910 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4911 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4912 | "$P_CLI force_version=tls12 debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4913 | 0 \ |
| 4914 | -c "client hello, adding renegotiation extension" \ |
| 4915 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4916 | -s "found renegotiation extension" \ |
| 4917 | -s "server hello, secure renegotiation extension" \ |
| 4918 | -c "found renegotiation extension" \ |
| 4919 | -s "record counter limit reached: renegotiate" \ |
| 4920 | -c "=> renegotiate" \ |
| 4921 | -s "=> renegotiate" \ |
| 4922 | -s "write hello request" \ |
| 4923 | -S "SSL - An unexpected message was received from our peer" \ |
| 4924 | -S "failed" |
| 4925 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4926 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4927 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4928 | "$P_SRV force_version=tls12 debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4929 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4930 | 0 \ |
| 4931 | -C "client hello, adding renegotiation extension" \ |
| 4932 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4933 | -S "found renegotiation extension" \ |
| 4934 | -s "server hello, secure renegotiation extension" \ |
| 4935 | -c "found renegotiation extension" \ |
| 4936 | -S "record counter limit reached: renegotiate" \ |
| 4937 | -C "=> renegotiate" \ |
| 4938 | -S "=> renegotiate" \ |
| 4939 | -S "write hello request" \ |
| 4940 | -S "SSL - An unexpected message was received from our peer" \ |
| 4941 | -S "failed" |
| 4942 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4943 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4944 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4945 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4946 | "$P_CLI force_version=tls12 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] | 4947 | 0 \ |
| 4948 | -c "client hello, adding renegotiation extension" \ |
| 4949 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4950 | -s "found renegotiation extension" \ |
| 4951 | -s "server hello, secure renegotiation extension" \ |
| 4952 | -c "found renegotiation extension" \ |
| 4953 | -c "=> renegotiate" \ |
| 4954 | -s "=> renegotiate" \ |
| 4955 | -S "write hello request" |
| 4956 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4957 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4958 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4959 | "$P_SRV force_version=tls12 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] | 4960 | "$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] | 4961 | 0 \ |
| 4962 | -c "client hello, adding renegotiation extension" \ |
| 4963 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4964 | -s "found renegotiation extension" \ |
| 4965 | -s "server hello, secure renegotiation extension" \ |
| 4966 | -c "found renegotiation extension" \ |
| 4967 | -c "=> renegotiate" \ |
| 4968 | -s "=> renegotiate" \ |
| 4969 | -s "write hello request" |
| 4970 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4971 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4973 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4974 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4975 | "$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] | 4976 | 0 \ |
| 4977 | -c "client hello, adding renegotiation extension" \ |
| 4978 | -c "found renegotiation extension" \ |
| 4979 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4980 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4981 | -C "error" \ |
| 4982 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4983 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4984 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4985 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4987 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4988 | "$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] | 4989 | "$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] | 4990 | 0 \ |
| 4991 | -c "client hello, adding renegotiation extension" \ |
| 4992 | -c "found renegotiation extension" \ |
| 4993 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4994 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4995 | -C "error" \ |
| 4996 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4997 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4998 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5000 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5001 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5002 | "$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] | 5003 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5004 | 1 \ |
| 5005 | -c "client hello, adding renegotiation extension" \ |
| 5006 | -C "found renegotiation extension" \ |
| 5007 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5008 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5009 | -c "error" \ |
| 5010 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5011 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5012 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5013 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5014 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5015 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5016 | "$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] | 5017 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5018 | allow_legacy=0" \ |
| 5019 | 1 \ |
| 5020 | -c "client hello, adding renegotiation extension" \ |
| 5021 | -C "found renegotiation extension" \ |
| 5022 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5023 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5024 | -c "error" \ |
| 5025 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5026 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5027 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5028 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5030 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5031 | "$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] | 5032 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5033 | allow_legacy=1" \ |
| 5034 | 0 \ |
| 5035 | -c "client hello, adding renegotiation extension" \ |
| 5036 | -C "found renegotiation extension" \ |
| 5037 | -c "=> renegotiate" \ |
| 5038 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5039 | -C "error" \ |
| 5040 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5041 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5042 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5044 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5045 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5046 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5047 | 0 \ |
| 5048 | -c "client hello, adding renegotiation extension" \ |
| 5049 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5050 | -s "found renegotiation extension" \ |
| 5051 | -s "server hello, secure renegotiation extension" \ |
| 5052 | -c "found renegotiation extension" \ |
| 5053 | -c "=> renegotiate" \ |
| 5054 | -s "=> renegotiate" \ |
| 5055 | -S "write hello request" |
| 5056 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5057 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5059 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5060 | "$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] | 5061 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5062 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5063 | 0 \ |
| 5064 | -c "client hello, adding renegotiation extension" \ |
| 5065 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5066 | -s "found renegotiation extension" \ |
| 5067 | -s "server hello, secure renegotiation extension" \ |
| 5068 | -c "found renegotiation extension" \ |
| 5069 | -c "=> renegotiate" \ |
| 5070 | -s "=> renegotiate" \ |
| 5071 | -s "write hello request" |
| 5072 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5073 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5075 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5076 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5077 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5078 | 0 \ |
| 5079 | -c "client hello, adding renegotiation extension" \ |
| 5080 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5081 | -s "found renegotiation extension" \ |
| 5082 | -s "server hello, secure renegotiation extension" \ |
| 5083 | -s "record counter limit reached: renegotiate" \ |
| 5084 | -c "=> renegotiate" \ |
| 5085 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5086 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5087 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5088 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5089 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5091 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5092 | "$G_SRV -u --mtu 4096" \ |
| 5093 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5094 | 0 \ |
| 5095 | -c "client hello, adding renegotiation extension" \ |
| 5096 | -c "found renegotiation extension" \ |
| 5097 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5098 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5099 | -C "error" \ |
| 5100 | -s "Extra-header:" |
| 5101 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5102 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5103 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5104 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5106 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5107 | "$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] | 5108 | "$P_CLI debug_level=3" \ |
| 5109 | 0 \ |
| 5110 | -c "found renegotiation extension" \ |
| 5111 | -C "error" \ |
| 5112 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5113 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5114 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5116 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5117 | "$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] | 5118 | "$P_CLI debug_level=3" \ |
| 5119 | 0 \ |
| 5120 | -C "found renegotiation extension" \ |
| 5121 | -C "error" \ |
| 5122 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5123 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5124 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5126 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5127 | "$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] | 5128 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5129 | 1 \ |
| 5130 | -C "found renegotiation extension" \ |
| 5131 | -c "error" \ |
| 5132 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5133 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5134 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5136 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5137 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5138 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5139 | 0 \ |
| 5140 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5141 | -s "server hello, secure renegotiation extension" |
| 5142 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5143 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5145 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5146 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5147 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5148 | 0 \ |
| 5149 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5150 | -S "server hello, secure renegotiation extension" |
| 5151 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5152 | requires_gnutls |
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 | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5154 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5155 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5156 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5157 | 1 \ |
| 5158 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5159 | -S "server hello, secure renegotiation extension" |
| 5160 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5161 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5162 | |
| 5163 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5165 | run_test "DER format: no trailing bytes" \ |
| 5166 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5167 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5168 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5169 | 0 \ |
| 5170 | -c "Handshake was completed" \ |
| 5171 | |
| 5172 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5174 | run_test "DER format: with a trailing zero byte" \ |
| 5175 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5176 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5177 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5178 | 0 \ |
| 5179 | -c "Handshake was completed" \ |
| 5180 | |
| 5181 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5183 | run_test "DER format: with a trailing random byte" \ |
| 5184 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5185 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5186 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5187 | 0 \ |
| 5188 | -c "Handshake was completed" \ |
| 5189 | |
| 5190 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5192 | run_test "DER format: with 2 trailing random bytes" \ |
| 5193 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5194 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5195 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5196 | 0 \ |
| 5197 | -c "Handshake was completed" \ |
| 5198 | |
| 5199 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5201 | run_test "DER format: with 4 trailing random bytes" \ |
| 5202 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5203 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5204 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5205 | 0 \ |
| 5206 | -c "Handshake was completed" \ |
| 5207 | |
| 5208 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5210 | run_test "DER format: with 8 trailing random bytes" \ |
| 5211 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5212 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5213 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5214 | 0 \ |
| 5215 | -c "Handshake was completed" \ |
| 5216 | |
| 5217 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5219 | run_test "DER format: with 9 trailing random bytes" \ |
| 5220 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5221 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5222 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5223 | 0 \ |
| 5224 | -c "Handshake was completed" \ |
| 5225 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5226 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5227 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5228 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5229 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5230 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5231 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5232 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5233 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5234 | 1 \ |
| 5235 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5236 | -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] | 5237 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5238 | -c "X509 - Certificate verification failed" |
| 5239 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5240 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5241 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5242 | key_file=data_files/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5243 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5244 | 0 \ |
| 5245 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5246 | -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] | 5247 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5248 | -C "X509 - Certificate verification failed" |
| 5249 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5250 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5251 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5252 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5253 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5254 | 0 \ |
| 5255 | -c "x509_verify_cert() returned" \ |
| 5256 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5257 | -c "! Certificate verification flags"\ |
| 5258 | -C "! mbedtls_ssl_handshake returned" \ |
| 5259 | -C "X509 - Certificate verification failed" \ |
| 5260 | -C "SSL - No CA Chain is set, but required to operate" |
| 5261 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5262 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5263 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5264 | "$P_SRV" \ |
| 5265 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5266 | 1 \ |
| 5267 | -c "x509_verify_cert() returned" \ |
| 5268 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5269 | -c "! Certificate verification flags"\ |
| 5270 | -c "! mbedtls_ssl_handshake returned" \ |
| 5271 | -c "SSL - No CA Chain is set, but required to operate" |
| 5272 | |
| 5273 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5274 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5275 | # the client informs the server about the supported curves - it does, though, in the |
| 5276 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5277 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5278 | # different means to have the server ignoring the client's supported curve list. |
| 5279 | |
| 5280 | requires_config_enabled MBEDTLS_ECP_C |
| 5281 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5282 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5283 | crt_file=data_files/server5.ku-ka.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5284 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required curves=secp521r1" \ |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5285 | 1 \ |
| 5286 | -c "bad certificate (EC key curve)"\ |
| 5287 | -c "! Certificate verification flags"\ |
| 5288 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5289 | |
| 5290 | requires_config_enabled MBEDTLS_ECP_C |
| 5291 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5292 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5293 | crt_file=data_files/server5.ku-ka.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5294 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional curves=secp521r1" \ |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5295 | 1 \ |
| 5296 | -c "bad certificate (EC key curve)"\ |
| 5297 | -c "! Certificate verification flags"\ |
| 5298 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5299 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5300 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5301 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5302 | key_file=data_files/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5303 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5304 | 0 \ |
| 5305 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5306 | -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] | 5307 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5308 | -C "X509 - Certificate verification failed" |
| 5309 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5310 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5311 | run_test "Authentication: client SHA256, server required" \ |
| 5312 | "$P_SRV auth_mode=required" \ |
| 5313 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5314 | key_file=data_files/server6.key \ |
| 5315 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5316 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5317 | -c "Supported Signature Algorithm found: 04 " \ |
| 5318 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5319 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5320 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5321 | run_test "Authentication: client SHA384, server required" \ |
| 5322 | "$P_SRV auth_mode=required" \ |
| 5323 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5324 | key_file=data_files/server6.key \ |
| 5325 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5326 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5327 | -c "Supported Signature Algorithm found: 04 " \ |
| 5328 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5329 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5330 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5331 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5332 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5333 | "$P_CLI debug_level=3 crt_file=none \ |
| 5334 | key_file=data_files/server5.key" \ |
| 5335 | 1 \ |
| 5336 | -S "skip write certificate request" \ |
| 5337 | -C "skip parse certificate request" \ |
| 5338 | -c "got a certificate request" \ |
| 5339 | -c "= write certificate$" \ |
| 5340 | -C "skip write certificate$" \ |
| 5341 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5342 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5343 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5344 | -s "No client certification received from the client, but required by the authentication mode" |
| 5345 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5346 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5347 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5348 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5349 | "$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] | 5350 | key_file=data_files/server5.key" \ |
| 5351 | 1 \ |
| 5352 | -S "skip write certificate request" \ |
| 5353 | -C "skip parse certificate request" \ |
| 5354 | -c "got a certificate request" \ |
| 5355 | -C "skip write certificate" \ |
| 5356 | -C "skip write certificate verify" \ |
| 5357 | -S "skip parse certificate verify" \ |
| 5358 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5359 | -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] | 5360 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5361 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5362 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5363 | # We don't check that the client receives the alert because it might |
| 5364 | # detect that its write end of the connection is closed and abort |
| 5365 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5366 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5367 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5368 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5369 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5370 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5371 | key_file=data_files/server5.key" \ |
| 5372 | 0 \ |
| 5373 | -S "skip write certificate request" \ |
| 5374 | -C "skip parse certificate request" \ |
| 5375 | -c "got a certificate request" \ |
| 5376 | -C "skip write certificate" \ |
| 5377 | -C "skip write certificate verify" \ |
| 5378 | -S "skip parse certificate verify" \ |
| 5379 | -S "x509_verify_cert() returned" \ |
| 5380 | -S "! The certificate is not correctly signed" \ |
| 5381 | -S "X509 - Certificate verification failed" |
| 5382 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5383 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5384 | run_test "Authentication: client cert not trusted, server required" \ |
| 5385 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5386 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5387 | key_file=data_files/server5.key" \ |
| 5388 | 1 \ |
| 5389 | -S "skip write certificate request" \ |
| 5390 | -C "skip parse certificate request" \ |
| 5391 | -c "got a certificate request" \ |
| 5392 | -C "skip write certificate" \ |
| 5393 | -C "skip write certificate verify" \ |
| 5394 | -S "skip parse certificate verify" \ |
| 5395 | -s "x509_verify_cert() returned" \ |
| 5396 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5397 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5398 | -s "X509 - Certificate verification failed" |
| 5399 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5400 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5401 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5402 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5403 | "$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] | 5404 | key_file=data_files/server5.key" \ |
| 5405 | 0 \ |
| 5406 | -S "skip write certificate request" \ |
| 5407 | -C "skip parse certificate request" \ |
| 5408 | -c "got a certificate request" \ |
| 5409 | -C "skip write certificate" \ |
| 5410 | -C "skip write certificate verify" \ |
| 5411 | -S "skip parse certificate verify" \ |
| 5412 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5413 | -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] | 5414 | -S "! mbedtls_ssl_handshake returned" \ |
| 5415 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5416 | -S "X509 - Certificate verification failed" |
| 5417 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5418 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5419 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5420 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5421 | "$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] | 5422 | key_file=data_files/server5.key" \ |
| 5423 | 0 \ |
| 5424 | -s "skip write certificate request" \ |
| 5425 | -C "skip parse certificate request" \ |
| 5426 | -c "got no certificate request" \ |
| 5427 | -c "skip write certificate" \ |
| 5428 | -c "skip write certificate verify" \ |
| 5429 | -s "skip parse certificate verify" \ |
| 5430 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5431 | -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] | 5432 | -S "! mbedtls_ssl_handshake returned" \ |
| 5433 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5434 | -S "X509 - Certificate verification failed" |
| 5435 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5436 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5437 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5438 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5439 | "$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] | 5440 | 0 \ |
| 5441 | -S "skip write certificate request" \ |
| 5442 | -C "skip parse certificate request" \ |
| 5443 | -c "got a certificate request" \ |
| 5444 | -C "skip write certificate$" \ |
| 5445 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5446 | -c "skip write certificate verify" \ |
| 5447 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5448 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5449 | -S "! mbedtls_ssl_handshake returned" \ |
| 5450 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5451 | -S "X509 - Certificate verification failed" |
| 5452 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 5453 | requires_openssl_tls1_3 |
| 5454 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5455 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5456 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 5457 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5458 | 0 \ |
| 5459 | -S "skip write certificate request" \ |
| 5460 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5461 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5462 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5463 | -S "X509 - Certificate verification failed" |
| 5464 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5466 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5467 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5468 | "$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] | 5469 | 0 \ |
| 5470 | -C "skip parse certificate request" \ |
| 5471 | -c "got a certificate request" \ |
| 5472 | -C "skip write certificate$" \ |
| 5473 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5474 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5475 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5477 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5478 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5479 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5480 | 1 \ |
| 5481 | -C "skip parse certificate request" \ |
| 5482 | -c "got a certificate request" \ |
| 5483 | -C "skip write certificate$" \ |
| 5484 | -c "skip write certificate verify" \ |
| 5485 | -c "! mbedtls_ssl_handshake returned" |
| 5486 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5487 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5488 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5489 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5490 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5491 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5492 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5493 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5494 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5495 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5496 | # 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] | 5497 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5498 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5499 | run_test "Authentication: server max_int chain, client default" \ |
| 5500 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5501 | key_file=data_files/dir-maxpath/09.key" \ |
| 5502 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5503 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5504 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5505 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5506 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5507 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5508 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5509 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5510 | key_file=data_files/dir-maxpath/10.key" \ |
| 5511 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5512 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5513 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5514 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5515 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5516 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5517 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5518 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5519 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5520 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5521 | auth_mode=optional" \ |
| 5522 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5523 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5524 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5525 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5526 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5527 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5528 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5529 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5530 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5531 | auth_mode=none" \ |
| 5532 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5533 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5534 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5535 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5536 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5537 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5538 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5539 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5540 | key_file=data_files/dir-maxpath/10.key" \ |
| 5541 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5542 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5543 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5544 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5545 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5546 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5547 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5548 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5549 | key_file=data_files/dir-maxpath/10.key" \ |
| 5550 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5551 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5552 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5553 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5554 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5555 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5556 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5557 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5558 | key_file=data_files/dir-maxpath/10.key" \ |
| 5559 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5560 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5561 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5562 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5563 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5564 | run_test "Authentication: client max_int chain, server required" \ |
| 5565 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5566 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5567 | key_file=data_files/dir-maxpath/09.key" \ |
| 5568 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5569 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5570 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5571 | # Tests for CA list in CertificateRequest messages |
| 5572 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5573 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5574 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5575 | "$P_SRV debug_level=3 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5576 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5577 | key_file=data_files/server6.key" \ |
| 5578 | 0 \ |
| 5579 | -s "requested DN" |
| 5580 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5581 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5582 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5583 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5584 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5585 | key_file=data_files/server6.key" \ |
| 5586 | 0 \ |
| 5587 | -S "requested DN" |
| 5588 | |
| 5589 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5590 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5591 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5592 | key_file=data_files/server5.key" \ |
| 5593 | 1 \ |
| 5594 | -S "requested DN" \ |
| 5595 | -s "x509_verify_cert() returned" \ |
| 5596 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5597 | -s "! mbedtls_ssl_handshake returned" \ |
| 5598 | -c "! mbedtls_ssl_handshake returned" \ |
| 5599 | -s "X509 - Certificate verification failed" |
| 5600 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5601 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5602 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5603 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5604 | crt_file2=data_files/server1.crt \ |
| 5605 | key_file2=data_files/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5606 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5607 | crt_file=data_files/server6.crt \ |
| 5608 | key_file=data_files/server6.key" \ |
| 5609 | 0 \ |
| 5610 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5611 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5612 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5613 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5614 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5615 | crt_file2=data_files/server2.crt \ |
| 5616 | key_file2=data_files/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5617 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5618 | crt_file=data_files/server6.crt \ |
| 5619 | key_file=data_files/server6.key" \ |
| 5620 | 0 \ |
| 5621 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5622 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5623 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5624 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5625 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5626 | crt_file2=data_files/server1.crt \ |
| 5627 | key_file2=data_files/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5628 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5629 | crt_file=data_files/server6.crt \ |
| 5630 | key_file=data_files/server6.key" \ |
| 5631 | 0 \ |
| 5632 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5633 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5634 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5635 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5636 | |
| 5637 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5638 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5639 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5640 | key_file=data_files/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5641 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5642 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5643 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5644 | -c "x509_verify_cert() returned" \ |
| 5645 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5646 | -c "! mbedtls_ssl_handshake returned" \ |
| 5647 | -c "X509 - Certificate verification failed" |
| 5648 | |
| 5649 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5650 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5651 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5652 | key_file=data_files/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5653 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5654 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5655 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5656 | -c "x509_verify_cert() returned" \ |
| 5657 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5658 | -C "! mbedtls_ssl_handshake returned" \ |
| 5659 | -C "X509 - Certificate verification failed" |
| 5660 | |
| 5661 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5662 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5663 | # the client informs the server about the supported curves - it does, though, in the |
| 5664 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5665 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5666 | # different means to have the server ignoring the client's supported curve list. |
| 5667 | |
| 5668 | requires_config_enabled MBEDTLS_ECP_C |
| 5669 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5670 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5671 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5672 | crt_file=data_files/server5.ku-ka.crt" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5673 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5674 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5675 | -c "use CA callback for X.509 CRT verification" \ |
| 5676 | -c "bad certificate (EC key curve)" \ |
| 5677 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5678 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5679 | |
| 5680 | requires_config_enabled MBEDTLS_ECP_C |
| 5681 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5682 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5683 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5684 | crt_file=data_files/server5.ku-ka.crt" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5685 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5686 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5687 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5688 | -c "bad certificate (EC key curve)"\ |
| 5689 | -c "! Certificate verification flags"\ |
| 5690 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5691 | |
| 5692 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5693 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5694 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5695 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5696 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5697 | key_file=data_files/server6.key \ |
| 5698 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5699 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5700 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5701 | -c "Supported Signature Algorithm found: 04 " \ |
| 5702 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5703 | |
| 5704 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5705 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5706 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5707 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5708 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5709 | key_file=data_files/server6.key \ |
| 5710 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5711 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5712 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5713 | -c "Supported Signature Algorithm found: 04 " \ |
| 5714 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5715 | |
| 5716 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5717 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5718 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5719 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5720 | key_file=data_files/server5.key" \ |
| 5721 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5722 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5723 | -S "skip write certificate request" \ |
| 5724 | -C "skip parse certificate request" \ |
| 5725 | -c "got a certificate request" \ |
| 5726 | -C "skip write certificate" \ |
| 5727 | -C "skip write certificate verify" \ |
| 5728 | -S "skip parse certificate verify" \ |
| 5729 | -s "x509_verify_cert() returned" \ |
| 5730 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5731 | -s "! mbedtls_ssl_handshake returned" \ |
| 5732 | -s "send alert level=2 message=48" \ |
| 5733 | -c "! mbedtls_ssl_handshake returned" \ |
| 5734 | -s "X509 - Certificate verification failed" |
| 5735 | # We don't check that the client receives the alert because it might |
| 5736 | # detect that its write end of the connection is closed and abort |
| 5737 | # before reading the alert message. |
| 5738 | |
| 5739 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5740 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5741 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5742 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5743 | key_file=data_files/server5.key" \ |
| 5744 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5745 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5746 | -S "skip write certificate request" \ |
| 5747 | -C "skip parse certificate request" \ |
| 5748 | -c "got a certificate request" \ |
| 5749 | -C "skip write certificate" \ |
| 5750 | -C "skip write certificate verify" \ |
| 5751 | -S "skip parse certificate verify" \ |
| 5752 | -s "x509_verify_cert() returned" \ |
| 5753 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5754 | -s "! mbedtls_ssl_handshake returned" \ |
| 5755 | -c "! mbedtls_ssl_handshake returned" \ |
| 5756 | -s "X509 - Certificate verification failed" |
| 5757 | |
| 5758 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5759 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5760 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5761 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5762 | key_file=data_files/server5.key" \ |
| 5763 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5764 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5765 | -S "skip write certificate request" \ |
| 5766 | -C "skip parse certificate request" \ |
| 5767 | -c "got a certificate request" \ |
| 5768 | -C "skip write certificate" \ |
| 5769 | -C "skip write certificate verify" \ |
| 5770 | -S "skip parse certificate verify" \ |
| 5771 | -s "x509_verify_cert() returned" \ |
| 5772 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5773 | -S "! mbedtls_ssl_handshake returned" \ |
| 5774 | -C "! mbedtls_ssl_handshake returned" \ |
| 5775 | -S "X509 - Certificate verification failed" |
| 5776 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5777 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5778 | requires_full_size_output_buffer |
| 5779 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5780 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5781 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5782 | key_file=data_files/dir-maxpath/09.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5783 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5784 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5785 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5786 | -C "X509 - A fatal error occurred" |
| 5787 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5788 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5789 | requires_full_size_output_buffer |
| 5790 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5791 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5792 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5793 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5794 | "$P_CLI force_version=tls12 debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5795 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5796 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5797 | -c "X509 - A fatal error occurred" |
| 5798 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5799 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5800 | requires_full_size_output_buffer |
| 5801 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5802 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5803 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5804 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5805 | "$P_CLI force_version=tls12 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5806 | debug_level=3 auth_mode=optional" \ |
| 5807 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5808 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5809 | -c "X509 - A fatal error occurred" |
| 5810 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5811 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5812 | requires_full_size_output_buffer |
| 5813 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5814 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5815 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5816 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5817 | key_file=data_files/dir-maxpath/10.key" \ |
| 5818 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5819 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5820 | -s "X509 - A fatal error occurred" |
| 5821 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5822 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5823 | requires_full_size_output_buffer |
| 5824 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5825 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5826 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5827 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5828 | key_file=data_files/dir-maxpath/10.key" \ |
| 5829 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5830 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5831 | -s "X509 - A fatal error occurred" |
| 5832 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5833 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5834 | requires_full_size_output_buffer |
| 5835 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5836 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5837 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5838 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5839 | key_file=data_files/dir-maxpath/09.key" \ |
| 5840 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5841 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5842 | -S "X509 - A fatal error occurred" |
| 5843 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5844 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5845 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5846 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5847 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5848 | "$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] | 5849 | key_file=data_files/server5.key \ |
| 5850 | crt_file2=data_files/server5-sha1.crt \ |
| 5851 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5852 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5853 | 0 \ |
| 5854 | -c "signed using.*ECDSA with SHA256" \ |
| 5855 | -C "signed using.*ECDSA with SHA1" |
| 5856 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5857 | # tests for SNI |
| 5858 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5859 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5860 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5861 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5862 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5863 | 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] | 5864 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5865 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5866 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5867 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5868 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5869 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5870 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5871 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5872 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5873 | 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] | 5874 | 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] | 5875 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5876 | 0 \ |
| 5877 | -s "parse ServerName extension" \ |
| 5878 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5879 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5880 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5881 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5882 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5883 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5884 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5885 | 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] | 5886 | 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] | 5887 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5888 | 0 \ |
| 5889 | -s "parse ServerName extension" \ |
| 5890 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5891 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5892 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5893 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5894 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5895 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5896 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5897 | 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] | 5898 | 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] | 5899 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5900 | 1 \ |
| 5901 | -s "parse ServerName extension" \ |
| 5902 | -s "ssl_sni_wrapper() returned" \ |
| 5903 | -s "mbedtls_ssl_handshake returned" \ |
| 5904 | -c "mbedtls_ssl_handshake returned" \ |
| 5905 | -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] | 5906 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5907 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5908 | run_test "SNI: client auth no override: optional" \ |
| 5909 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5910 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5911 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5912 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5913 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5914 | -S "skip write certificate request" \ |
| 5915 | -C "skip parse certificate request" \ |
| 5916 | -c "got a certificate request" \ |
| 5917 | -C "skip write certificate" \ |
| 5918 | -C "skip write certificate verify" \ |
| 5919 | -S "skip parse certificate verify" |
| 5920 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5921 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5922 | run_test "SNI: client auth override: none -> optional" \ |
| 5923 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5924 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5925 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5926 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5927 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5928 | -S "skip write certificate request" \ |
| 5929 | -C "skip parse certificate request" \ |
| 5930 | -c "got a certificate request" \ |
| 5931 | -C "skip write certificate" \ |
| 5932 | -C "skip write certificate verify" \ |
| 5933 | -S "skip parse certificate verify" |
| 5934 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5935 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5936 | run_test "SNI: client auth override: optional -> none" \ |
| 5937 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5938 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5939 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5940 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5941 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5942 | -s "skip write certificate request" \ |
| 5943 | -C "skip parse certificate request" \ |
| 5944 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 5945 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5946 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5947 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5948 | run_test "SNI: CA no override" \ |
| 5949 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5950 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5951 | ca_file=data_files/test-ca.crt \ |
| 5952 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5953 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5954 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5955 | 1 \ |
| 5956 | -S "skip write certificate request" \ |
| 5957 | -C "skip parse certificate request" \ |
| 5958 | -c "got a certificate request" \ |
| 5959 | -C "skip write certificate" \ |
| 5960 | -C "skip write certificate verify" \ |
| 5961 | -S "skip parse certificate verify" \ |
| 5962 | -s "x509_verify_cert() returned" \ |
| 5963 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5964 | -S "The certificate has been revoked (is on a CRL)" |
| 5965 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5966 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5967 | run_test "SNI: CA override" \ |
| 5968 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5969 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5970 | ca_file=data_files/test-ca.crt \ |
| 5971 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5972 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5973 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5974 | 0 \ |
| 5975 | -S "skip write certificate request" \ |
| 5976 | -C "skip parse certificate request" \ |
| 5977 | -c "got a certificate request" \ |
| 5978 | -C "skip write certificate" \ |
| 5979 | -C "skip write certificate verify" \ |
| 5980 | -S "skip parse certificate verify" \ |
| 5981 | -S "x509_verify_cert() returned" \ |
| 5982 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5983 | -S "The certificate has been revoked (is on a CRL)" |
| 5984 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5985 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5986 | run_test "SNI: CA override with CRL" \ |
| 5987 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5988 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5989 | ca_file=data_files/test-ca.crt \ |
| 5990 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5991 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5992 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5993 | 1 \ |
| 5994 | -S "skip write certificate request" \ |
| 5995 | -C "skip parse certificate request" \ |
| 5996 | -c "got a certificate request" \ |
| 5997 | -C "skip write certificate" \ |
| 5998 | -C "skip write certificate verify" \ |
| 5999 | -S "skip parse certificate verify" \ |
| 6000 | -s "x509_verify_cert() returned" \ |
| 6001 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6002 | -s "The certificate has been revoked (is on a CRL)" |
| 6003 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6004 | # Tests for SNI and DTLS |
| 6005 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6006 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6008 | run_test "SNI: DTLS, no SNI callback" \ |
| 6009 | "$P_SRV debug_level=3 dtls=1 \ |
| 6010 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6011 | "$P_CLI server_name=localhost dtls=1" \ |
| 6012 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6013 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6014 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6015 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6016 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6018 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6019 | "$P_SRV debug_level=3 dtls=1 \ |
| 6020 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6021 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6022 | "$P_CLI server_name=localhost dtls=1" \ |
| 6023 | 0 \ |
| 6024 | -s "parse ServerName extension" \ |
| 6025 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6026 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6027 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6028 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6030 | run_test "SNI: DTLS, matching cert 2" \ |
| 6031 | "$P_SRV debug_level=3 dtls=1 \ |
| 6032 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6033 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6034 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6035 | 0 \ |
| 6036 | -s "parse ServerName extension" \ |
| 6037 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6038 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6039 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6041 | run_test "SNI: DTLS, no matching cert" \ |
| 6042 | "$P_SRV debug_level=3 dtls=1 \ |
| 6043 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6044 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6045 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6046 | 1 \ |
| 6047 | -s "parse ServerName extension" \ |
| 6048 | -s "ssl_sni_wrapper() returned" \ |
| 6049 | -s "mbedtls_ssl_handshake returned" \ |
| 6050 | -c "mbedtls_ssl_handshake returned" \ |
| 6051 | -c "SSL - A fatal alert message was received from our peer" |
| 6052 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6054 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6055 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6056 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6057 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6058 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6059 | 0 \ |
| 6060 | -S "skip write certificate request" \ |
| 6061 | -C "skip parse certificate request" \ |
| 6062 | -c "got a certificate request" \ |
| 6063 | -C "skip write certificate" \ |
| 6064 | -C "skip write certificate verify" \ |
| 6065 | -S "skip parse certificate verify" |
| 6066 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6068 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6069 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6070 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6071 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6072 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6073 | 0 \ |
| 6074 | -S "skip write certificate request" \ |
| 6075 | -C "skip parse certificate request" \ |
| 6076 | -c "got a certificate request" \ |
| 6077 | -C "skip write certificate" \ |
| 6078 | -C "skip write certificate verify" \ |
| 6079 | -S "skip parse certificate verify" |
| 6080 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6082 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6083 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6084 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6085 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6086 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6087 | 0 \ |
| 6088 | -s "skip write certificate request" \ |
| 6089 | -C "skip parse certificate request" \ |
| 6090 | -c "got no certificate request" \ |
| 6091 | -c "skip write certificate" \ |
| 6092 | -c "skip write certificate verify" \ |
| 6093 | -s "skip parse certificate verify" |
| 6094 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6096 | run_test "SNI: DTLS, CA no override" \ |
| 6097 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6098 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6099 | ca_file=data_files/test-ca.crt \ |
| 6100 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6101 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6102 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6103 | 1 \ |
| 6104 | -S "skip write certificate request" \ |
| 6105 | -C "skip parse certificate request" \ |
| 6106 | -c "got a certificate request" \ |
| 6107 | -C "skip write certificate" \ |
| 6108 | -C "skip write certificate verify" \ |
| 6109 | -S "skip parse certificate verify" \ |
| 6110 | -s "x509_verify_cert() returned" \ |
| 6111 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6112 | -S "The certificate has been revoked (is on a CRL)" |
| 6113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6115 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6116 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6117 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6118 | ca_file=data_files/test-ca.crt \ |
| 6119 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6120 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6121 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6122 | 0 \ |
| 6123 | -S "skip write certificate request" \ |
| 6124 | -C "skip parse certificate request" \ |
| 6125 | -c "got a certificate request" \ |
| 6126 | -C "skip write certificate" \ |
| 6127 | -C "skip write certificate verify" \ |
| 6128 | -S "skip parse certificate verify" \ |
| 6129 | -S "x509_verify_cert() returned" \ |
| 6130 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6131 | -S "The certificate has been revoked (is on a CRL)" |
| 6132 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6134 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6135 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6136 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6137 | ca_file=data_files/test-ca.crt \ |
| 6138 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6139 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6140 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6141 | 1 \ |
| 6142 | -S "skip write certificate request" \ |
| 6143 | -C "skip parse certificate request" \ |
| 6144 | -c "got a certificate request" \ |
| 6145 | -C "skip write certificate" \ |
| 6146 | -C "skip write certificate verify" \ |
| 6147 | -S "skip parse certificate verify" \ |
| 6148 | -s "x509_verify_cert() returned" \ |
| 6149 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6150 | -s "The certificate has been revoked (is on a CRL)" |
| 6151 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6152 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6153 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6154 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6155 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6156 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6157 | "$P_CLI nbio=2 tickets=0" \ |
| 6158 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6159 | -S "mbedtls_ssl_handshake returned" \ |
| 6160 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6161 | -c "Read from server: .* bytes read" |
| 6162 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6163 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6164 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6165 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6166 | "$P_CLI nbio=2 tickets=0" \ |
| 6167 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6168 | -S "mbedtls_ssl_handshake returned" \ |
| 6169 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6170 | -c "Read from server: .* bytes read" |
| 6171 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6172 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6173 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6174 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6175 | "$P_CLI nbio=2 tickets=1" \ |
| 6176 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6177 | -S "mbedtls_ssl_handshake returned" \ |
| 6178 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6179 | -c "Read from server: .* bytes read" |
| 6180 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6181 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6182 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6183 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6184 | "$P_CLI nbio=2 tickets=1" \ |
| 6185 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6186 | -S "mbedtls_ssl_handshake returned" \ |
| 6187 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6188 | -c "Read from server: .* bytes read" |
| 6189 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6190 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6191 | run_test "Non-blocking I/O: TLS 1.2 + ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6192 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6193 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6194 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6195 | -S "mbedtls_ssl_handshake returned" \ |
| 6196 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6197 | -c "Read from server: .* bytes read" |
| 6198 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6200 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6201 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6202 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6203 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6204 | "$P_CLI force_version=tls13 nbio=2 tickets=1 reconnect=1" \ |
| 6205 | 0 \ |
| 6206 | -S "mbedtls_ssl_handshake returned" \ |
| 6207 | -C "mbedtls_ssl_handshake returned" \ |
| 6208 | -c "Read from server: .* bytes read" |
| 6209 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6210 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6211 | run_test "Non-blocking I/O: TLS 1.2 + ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6212 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6213 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6214 | 0 \ |
| 6215 | -S "mbedtls_ssl_handshake returned" \ |
| 6216 | -C "mbedtls_ssl_handshake returned" \ |
| 6217 | -c "Read from server: .* bytes read" |
| 6218 | |
| 6219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6220 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6221 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6222 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6223 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6224 | "$P_CLI force_version=tls13 nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6225 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6226 | -S "mbedtls_ssl_handshake returned" \ |
| 6227 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6228 | -c "Read from server: .* bytes read" |
| 6229 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6230 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6231 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6232 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6233 | "$P_CLI force_version=tls12 nbio=2 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6234 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6235 | -S "mbedtls_ssl_handshake returned" \ |
| 6236 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6237 | -c "Read from server: .* bytes read" |
| 6238 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6239 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6240 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6241 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6242 | run_test "Event-driven I/O: basic handshake" \ |
| 6243 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6244 | "$P_CLI event=1 tickets=0" \ |
| 6245 | 0 \ |
| 6246 | -S "mbedtls_ssl_handshake returned" \ |
| 6247 | -C "mbedtls_ssl_handshake returned" \ |
| 6248 | -c "Read from server: .* bytes read" |
| 6249 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6250 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6251 | run_test "Event-driven I/O: client auth" \ |
| 6252 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6253 | "$P_CLI event=1 tickets=0" \ |
| 6254 | 0 \ |
| 6255 | -S "mbedtls_ssl_handshake returned" \ |
| 6256 | -C "mbedtls_ssl_handshake returned" \ |
| 6257 | -c "Read from server: .* bytes read" |
| 6258 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6259 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6260 | run_test "Event-driven I/O: ticket" \ |
| 6261 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6262 | "$P_CLI event=1 tickets=1" \ |
| 6263 | 0 \ |
| 6264 | -S "mbedtls_ssl_handshake returned" \ |
| 6265 | -C "mbedtls_ssl_handshake returned" \ |
| 6266 | -c "Read from server: .* bytes read" |
| 6267 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6268 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6269 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6270 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6271 | "$P_CLI event=1 tickets=1" \ |
| 6272 | 0 \ |
| 6273 | -S "mbedtls_ssl_handshake returned" \ |
| 6274 | -C "mbedtls_ssl_handshake returned" \ |
| 6275 | -c "Read from server: .* bytes read" |
| 6276 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6277 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6278 | run_test "Event-driven I/O: TLS 1.2 + ticket + client auth + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6279 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6280 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6281 | 0 \ |
| 6282 | -S "mbedtls_ssl_handshake returned" \ |
| 6283 | -C "mbedtls_ssl_handshake returned" \ |
| 6284 | -c "Read from server: .* bytes read" |
| 6285 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6287 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6288 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6289 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6290 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6291 | "$P_CLI force_version=tls13 event=1 tickets=1 reconnect=1" \ |
| 6292 | 0 \ |
| 6293 | -S "mbedtls_ssl_handshake returned" \ |
| 6294 | -C "mbedtls_ssl_handshake returned" \ |
| 6295 | -c "Read from server: .* bytes read" |
| 6296 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6297 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6298 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6299 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6300 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 6301 | 0 \ |
| 6302 | -S "mbedtls_ssl_handshake returned" \ |
| 6303 | -C "mbedtls_ssl_handshake returned" \ |
| 6304 | -c "Read from server: .* bytes read" |
| 6305 | |
| 6306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6307 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6308 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6309 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 6310 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6311 | "$P_CLI force_version=tls13 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6312 | 0 \ |
| 6313 | -S "mbedtls_ssl_handshake returned" \ |
| 6314 | -C "mbedtls_ssl_handshake returned" \ |
| 6315 | -c "Read from server: .* bytes read" |
| 6316 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6317 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6318 | run_test "Event-driven I/O: session-id resume" \ |
| 6319 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6320 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6321 | 0 \ |
| 6322 | -S "mbedtls_ssl_handshake returned" \ |
| 6323 | -C "mbedtls_ssl_handshake returned" \ |
| 6324 | -c "Read from server: .* bytes read" |
| 6325 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6327 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6328 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6329 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6330 | 0 \ |
| 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 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6334 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6335 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6336 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6337 | 0 \ |
| 6338 | -c "Read from server: .* bytes read" |
| 6339 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6341 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6342 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6343 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6344 | 0 \ |
| 6345 | -c "Read from server: .* bytes read" |
| 6346 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6348 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6349 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6350 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6351 | 0 \ |
| 6352 | -c "Read from server: .* bytes read" |
| 6353 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6355 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6356 | "$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] | 6357 | "$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] | 6358 | 0 \ |
| 6359 | -c "Read from server: .* bytes read" |
| 6360 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6361 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6362 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6363 | "$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] | 6364 | "$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] | 6365 | 0 \ |
| 6366 | -c "Read from server: .* bytes read" |
| 6367 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6369 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6370 | "$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] | 6371 | "$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] | 6372 | 0 \ |
| 6373 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6374 | |
| 6375 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6376 | # During session resumption, the client will send its ApplicationData record |
| 6377 | # within the same datagram as the Finished messages. In this situation, the |
| 6378 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6379 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6381 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6382 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6383 | "$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] | 6384 | "$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] | 6385 | 0 \ |
| 6386 | -c "Read from server: .* bytes read" |
| 6387 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6388 | # Tests for version negotiation |
| 6389 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6390 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6391 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6392 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6393 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6394 | -S "mbedtls_ssl_handshake returned" \ |
| 6395 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6396 | -s "Protocol is TLSv1.2" \ |
| 6397 | -c "Protocol is TLSv1.2" |
| 6398 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6400 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6401 | "$P_SRV" \ |
| 6402 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6403 | 1 \ |
| 6404 | -s "Handshake protocol not within min/max boundaries" \ |
| 6405 | -c "Error in protocol version" \ |
| 6406 | -S "Protocol is TLSv1.0" \ |
| 6407 | -C "Handshake was completed" |
| 6408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6410 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6411 | "$P_SRV" \ |
| 6412 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6413 | 1 \ |
| 6414 | -s "Handshake protocol not within min/max boundaries" \ |
| 6415 | -c "Error in protocol version" \ |
| 6416 | -S "Protocol is TLSv1.1" \ |
| 6417 | -C "Handshake was completed" |
| 6418 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6420 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6421 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6422 | "$P_CLI" \ |
| 6423 | 1 \ |
| 6424 | -s "Error in protocol version" \ |
| 6425 | -c "Handshake protocol not within min/max boundaries" \ |
| 6426 | -S "Version: TLS1.0" \ |
| 6427 | -C "Protocol is TLSv1.0" |
| 6428 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6430 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6431 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6432 | "$P_CLI" \ |
| 6433 | 1 \ |
| 6434 | -s "Error in protocol version" \ |
| 6435 | -c "Handshake protocol not within min/max boundaries" \ |
| 6436 | -S "Version: TLS1.1" \ |
| 6437 | -C "Protocol is TLSv1.1" |
| 6438 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6439 | # Tests for ALPN extension |
| 6440 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6441 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6442 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6443 | "$P_SRV debug_level=3" \ |
| 6444 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6445 | 0 \ |
| 6446 | -C "client hello, adding alpn extension" \ |
| 6447 | -S "found alpn extension" \ |
| 6448 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6449 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6450 | -C "found alpn extension " \ |
| 6451 | -C "Application Layer Protocol is" \ |
| 6452 | -S "Application Layer Protocol is" |
| 6453 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6454 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6455 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6456 | "$P_SRV debug_level=3" \ |
| 6457 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6458 | 0 \ |
| 6459 | -c "client hello, adding alpn extension" \ |
| 6460 | -s "found alpn extension" \ |
| 6461 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6462 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6463 | -C "found alpn extension " \ |
| 6464 | -c "Application Layer Protocol is (none)" \ |
| 6465 | -S "Application Layer Protocol is" |
| 6466 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6467 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6468 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6469 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6470 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6471 | 0 \ |
| 6472 | -C "client hello, adding alpn extension" \ |
| 6473 | -S "found alpn extension" \ |
| 6474 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6475 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6476 | -C "found alpn extension " \ |
| 6477 | -C "Application Layer Protocol is" \ |
| 6478 | -s "Application Layer Protocol is (none)" |
| 6479 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6480 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6481 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6482 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6483 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6484 | 0 \ |
| 6485 | -c "client hello, adding alpn extension" \ |
| 6486 | -s "found alpn extension" \ |
| 6487 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6488 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6489 | -c "found alpn extension" \ |
| 6490 | -c "Application Layer Protocol is abc" \ |
| 6491 | -s "Application Layer Protocol is abc" |
| 6492 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6493 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6494 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6495 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6496 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6497 | 0 \ |
| 6498 | -c "client hello, adding alpn extension" \ |
| 6499 | -s "found alpn extension" \ |
| 6500 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6501 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6502 | -c "found alpn extension" \ |
| 6503 | -c "Application Layer Protocol is abc" \ |
| 6504 | -s "Application Layer Protocol is abc" |
| 6505 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6506 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6507 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6508 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6509 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6510 | 0 \ |
| 6511 | -c "client hello, adding alpn extension" \ |
| 6512 | -s "found alpn extension" \ |
| 6513 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6514 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6515 | -c "found alpn extension" \ |
| 6516 | -c "Application Layer Protocol is 1234" \ |
| 6517 | -s "Application Layer Protocol is 1234" |
| 6518 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6519 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6520 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6521 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6522 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6523 | 1 \ |
| 6524 | -c "client hello, adding alpn extension" \ |
| 6525 | -s "found alpn extension" \ |
| 6526 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6527 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6528 | -C "found alpn extension" \ |
| 6529 | -C "Application Layer Protocol is 1234" \ |
| 6530 | -S "Application Layer Protocol is 1234" |
| 6531 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6532 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6533 | # Tests for keyUsage in leaf certificates, part 1: |
| 6534 | # server-side certificate/suite selection |
| 6535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6536 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6537 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6538 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6539 | "$P_CLI" \ |
| 6540 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6541 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6542 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6543 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6544 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6545 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6546 | "$P_CLI" \ |
| 6547 | 0 \ |
| 6548 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6549 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6550 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6551 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6552 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6553 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6554 | 1 \ |
| 6555 | -C "Ciphersuite is " |
| 6556 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 6557 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6558 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6559 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6560 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6561 | "$P_CLI" \ |
| 6562 | 0 \ |
| 6563 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6564 | |
| 6565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6566 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6567 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6568 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6569 | "$P_CLI" \ |
| 6570 | 0 \ |
| 6571 | -c "Ciphersuite is TLS-ECDH-" |
| 6572 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6573 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6574 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6575 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6576 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6577 | 1 \ |
| 6578 | -C "Ciphersuite is " |
| 6579 | |
| 6580 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6581 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6582 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6583 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6584 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6585 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6586 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6587 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6588 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6589 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6590 | -C "Processing of the Certificate handshake message failed" \ |
| 6591 | -c "Ciphersuite is TLS-" |
| 6592 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6593 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6594 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6595 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6596 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6597 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6598 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6599 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6600 | -C "Processing of the Certificate handshake message failed" \ |
| 6601 | -c "Ciphersuite is TLS-" |
| 6602 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6603 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6604 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6605 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6606 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6607 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6608 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6609 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6610 | -C "Processing of the Certificate handshake message failed" \ |
| 6611 | -c "Ciphersuite is TLS-" |
| 6612 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6613 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6614 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6615 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6616 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6617 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6618 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6619 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6620 | -c "Processing of the Certificate handshake message failed" \ |
| 6621 | -C "Ciphersuite is TLS-" |
| 6622 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6623 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6624 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6625 | -cert data_files/server2.ku-ke.crt" \ |
| 6626 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6627 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6628 | 0 \ |
| 6629 | -c "bad certificate (usage extensions)" \ |
| 6630 | -C "Processing of the Certificate handshake message failed" \ |
| 6631 | -c "Ciphersuite is TLS-" \ |
| 6632 | -c "! Usage does not match the keyUsage extension" |
| 6633 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6634 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6635 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6636 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6637 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6638 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6639 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6640 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6641 | -C "Processing of the Certificate handshake message failed" \ |
| 6642 | -c "Ciphersuite is TLS-" |
| 6643 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6644 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6645 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6646 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6647 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6648 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6649 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6650 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6651 | -c "Processing of the Certificate handshake message failed" \ |
| 6652 | -C "Ciphersuite is TLS-" |
| 6653 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6654 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6655 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6656 | -cert data_files/server2.ku-ds.crt" \ |
| 6657 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6658 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6659 | 0 \ |
| 6660 | -c "bad certificate (usage extensions)" \ |
| 6661 | -C "Processing of the Certificate handshake message failed" \ |
| 6662 | -c "Ciphersuite is TLS-" \ |
| 6663 | -c "! Usage does not match the keyUsage extension" |
| 6664 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6665 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6666 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6667 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6668 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6669 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6670 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6671 | "$P_CLI debug_level=3" \ |
| 6672 | 0 \ |
| 6673 | -C "bad certificate (usage extensions)" \ |
| 6674 | -C "Processing of the Certificate handshake message failed" \ |
| 6675 | -c "Ciphersuite is" |
| 6676 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6677 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6678 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6679 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6680 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6681 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6682 | -cert data_files/server2.ku-ke.crt" \ |
| 6683 | "$P_CLI debug_level=1" \ |
| 6684 | 1 \ |
| 6685 | -c "bad certificate (usage extensions)" \ |
| 6686 | -c "Processing of the Certificate handshake message failed" \ |
| 6687 | -C "Ciphersuite is" |
| 6688 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6689 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6690 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6691 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6692 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6693 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6694 | -cert data_files/server2.ku-ka.crt" \ |
| 6695 | "$P_CLI debug_level=1" \ |
| 6696 | 1 \ |
| 6697 | -c "bad certificate (usage extensions)" \ |
| 6698 | -c "Processing of the Certificate handshake message failed" \ |
| 6699 | -C "Ciphersuite is" |
| 6700 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6701 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6702 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6703 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6704 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6705 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6706 | -cert data_files/server5.ku-ds.crt" \ |
| 6707 | "$P_CLI debug_level=3" \ |
| 6708 | 0 \ |
| 6709 | -C "bad certificate (usage extensions)" \ |
| 6710 | -C "Processing of the Certificate handshake message failed" \ |
| 6711 | -c "Ciphersuite is" |
| 6712 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6713 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6714 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6715 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6716 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6717 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6718 | -cert data_files/server5.ku-ke.crt" \ |
| 6719 | "$P_CLI debug_level=1" \ |
| 6720 | 1 \ |
| 6721 | -c "bad certificate (usage extensions)" \ |
| 6722 | -c "Processing of the Certificate handshake message failed" \ |
| 6723 | -C "Ciphersuite is" |
| 6724 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6725 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6726 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6727 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6728 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6729 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6730 | -cert data_files/server5.ku-ka.crt" \ |
| 6731 | "$P_CLI debug_level=1" \ |
| 6732 | 1 \ |
| 6733 | -c "bad certificate (usage extensions)" \ |
| 6734 | -c "Processing of the Certificate handshake message failed" \ |
| 6735 | -C "Ciphersuite is" |
| 6736 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6737 | # Tests for keyUsage in leaf certificates, part 3: |
| 6738 | # server-side checking of client cert |
| 6739 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6741 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6742 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6743 | "$O_CLI -key data_files/server2.key \ |
| 6744 | -cert data_files/server2.ku-ds.crt" \ |
| 6745 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6746 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6747 | -S "bad certificate (usage extensions)" \ |
| 6748 | -S "Processing of the Certificate handshake message failed" |
| 6749 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6751 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6752 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6753 | "$O_CLI -key data_files/server2.key \ |
| 6754 | -cert data_files/server2.ku-ke.crt" \ |
| 6755 | 0 \ |
| 6756 | -s "bad certificate (usage extensions)" \ |
| 6757 | -S "Processing of the Certificate handshake message failed" |
| 6758 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6760 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6761 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6762 | "$O_CLI -key data_files/server2.key \ |
| 6763 | -cert data_files/server2.ku-ke.crt" \ |
| 6764 | 1 \ |
| 6765 | -s "bad certificate (usage extensions)" \ |
| 6766 | -s "Processing of the Certificate handshake message failed" |
| 6767 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6769 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6770 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6771 | "$O_CLI -key data_files/server5.key \ |
| 6772 | -cert data_files/server5.ku-ds.crt" \ |
| 6773 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6774 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6775 | -S "bad certificate (usage extensions)" \ |
| 6776 | -S "Processing of the Certificate handshake message failed" |
| 6777 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6779 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6780 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6781 | "$O_CLI -key data_files/server5.key \ |
| 6782 | -cert data_files/server5.ku-ka.crt" \ |
| 6783 | 0 \ |
| 6784 | -s "bad certificate (usage extensions)" \ |
| 6785 | -S "Processing of the Certificate handshake message failed" |
| 6786 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6787 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6788 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6789 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6790 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6791 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6792 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6793 | -cert data_files/server2.ku-ds.crt" \ |
| 6794 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6795 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6796 | -S "bad certificate (usage extensions)" \ |
| 6797 | -S "Processing of the Certificate handshake message failed" |
| 6798 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6799 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6800 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6801 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6802 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6803 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6804 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6805 | -cert data_files/server2.ku-ke.crt" \ |
| 6806 | 0 \ |
| 6807 | -s "bad certificate (usage extensions)" \ |
| 6808 | -S "Processing of the Certificate handshake message failed" |
| 6809 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6810 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6811 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6812 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6813 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6814 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6815 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6816 | -cert data_files/server5.ku-ds.crt" \ |
| 6817 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6818 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6819 | -S "bad certificate (usage extensions)" \ |
| 6820 | -S "Processing of the Certificate handshake message failed" |
| 6821 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6822 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6823 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6824 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6825 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6826 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6827 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6828 | -cert data_files/server5.ku-ka.crt" \ |
| 6829 | 0 \ |
| 6830 | -s "bad certificate (usage extensions)" \ |
| 6831 | -S "Processing of the Certificate handshake message failed" |
| 6832 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6833 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6834 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6835 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6836 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6837 | "$P_SRV key_file=data_files/server5.key \ |
| 6838 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6839 | "$P_CLI" \ |
| 6840 | 0 |
| 6841 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6842 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6843 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6844 | "$P_SRV key_file=data_files/server5.key \ |
| 6845 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6846 | "$P_CLI" \ |
| 6847 | 0 |
| 6848 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6849 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6850 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6851 | "$P_SRV key_file=data_files/server5.key \ |
| 6852 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6853 | "$P_CLI" \ |
| 6854 | 0 |
| 6855 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6856 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6857 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6858 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6859 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6860 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6861 | 1 |
| 6862 | |
| 6863 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6864 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6866 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6867 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6868 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6869 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6870 | 0 \ |
| 6871 | -C "bad certificate (usage extensions)" \ |
| 6872 | -C "Processing of the Certificate handshake message failed" \ |
| 6873 | -c "Ciphersuite is TLS-" |
| 6874 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6876 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6877 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6878 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6879 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6880 | 0 \ |
| 6881 | -C "bad certificate (usage extensions)" \ |
| 6882 | -C "Processing of the Certificate handshake message failed" \ |
| 6883 | -c "Ciphersuite is TLS-" |
| 6884 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6886 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6887 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6888 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6889 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6890 | 0 \ |
| 6891 | -C "bad certificate (usage extensions)" \ |
| 6892 | -C "Processing of the Certificate handshake message failed" \ |
| 6893 | -c "Ciphersuite is TLS-" |
| 6894 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6896 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6897 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6898 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6899 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6900 | 1 \ |
| 6901 | -c "bad certificate (usage extensions)" \ |
| 6902 | -c "Processing of the Certificate handshake message failed" \ |
| 6903 | -C "Ciphersuite is TLS-" |
| 6904 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6905 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6906 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6907 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6908 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 6909 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6910 | -cert data_files/server5.eku-srv.crt" \ |
| 6911 | "$P_CLI debug_level=1" \ |
| 6912 | 0 \ |
| 6913 | -C "bad certificate (usage extensions)" \ |
| 6914 | -C "Processing of the Certificate handshake message failed" \ |
| 6915 | -c "Ciphersuite is" |
| 6916 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6917 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6918 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6919 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6920 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 6921 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6922 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6923 | "$P_CLI debug_level=1" \ |
| 6924 | 0 \ |
| 6925 | -C "bad certificate (usage extensions)" \ |
| 6926 | -C "Processing of the Certificate handshake message failed" \ |
| 6927 | -c "Ciphersuite is" |
| 6928 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6929 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6930 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6931 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6932 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 6933 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6934 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6935 | "$P_CLI debug_level=1" \ |
| 6936 | 0 \ |
| 6937 | -C "bad certificate (usage extensions)" \ |
| 6938 | -C "Processing of the Certificate handshake message failed" \ |
| 6939 | -c "Ciphersuite is" |
| 6940 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6941 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6942 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6943 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6944 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 6945 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6946 | -cert data_files/server5.eku-cs.crt" \ |
| 6947 | "$P_CLI debug_level=1" \ |
| 6948 | 1 \ |
| 6949 | -c "bad certificate (usage extensions)" \ |
| 6950 | -c "Processing of the Certificate handshake message failed" \ |
| 6951 | -C "Ciphersuite is" |
| 6952 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6953 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6954 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6956 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6957 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6958 | "$O_CLI -key data_files/server5.key \ |
| 6959 | -cert data_files/server5.eku-cli.crt" \ |
| 6960 | 0 \ |
| 6961 | -S "bad certificate (usage extensions)" \ |
| 6962 | -S "Processing of the Certificate handshake message failed" |
| 6963 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6965 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6966 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6967 | "$O_CLI -key data_files/server5.key \ |
| 6968 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6969 | 0 \ |
| 6970 | -S "bad certificate (usage extensions)" \ |
| 6971 | -S "Processing of the Certificate handshake message failed" |
| 6972 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6974 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6975 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6976 | "$O_CLI -key data_files/server5.key \ |
| 6977 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6978 | 0 \ |
| 6979 | -S "bad certificate (usage extensions)" \ |
| 6980 | -S "Processing of the Certificate handshake message failed" |
| 6981 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6983 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6984 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6985 | "$O_CLI -key data_files/server5.key \ |
| 6986 | -cert data_files/server5.eku-cs.crt" \ |
| 6987 | 0 \ |
| 6988 | -s "bad certificate (usage extensions)" \ |
| 6989 | -S "Processing of the Certificate handshake message failed" |
| 6990 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6992 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6993 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6994 | "$O_CLI -key data_files/server5.key \ |
| 6995 | -cert data_files/server5.eku-cs.crt" \ |
| 6996 | 1 \ |
| 6997 | -s "bad certificate (usage extensions)" \ |
| 6998 | -s "Processing of the Certificate handshake message failed" |
| 6999 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7000 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7001 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7002 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7003 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7004 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7005 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7006 | -cert data_files/server5.eku-cli.crt" \ |
| 7007 | 0 \ |
| 7008 | -S "bad certificate (usage extensions)" \ |
| 7009 | -S "Processing of the Certificate handshake message failed" |
| 7010 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7011 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7012 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7013 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7014 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7015 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7016 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7017 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7018 | 0 \ |
| 7019 | -S "bad certificate (usage extensions)" \ |
| 7020 | -S "Processing of the Certificate handshake message failed" |
| 7021 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7022 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7023 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7024 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7025 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7026 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7027 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7028 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7029 | 0 \ |
| 7030 | -S "bad certificate (usage extensions)" \ |
| 7031 | -S "Processing of the Certificate handshake message failed" |
| 7032 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7033 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7034 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7035 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7036 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7037 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7038 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7039 | -cert data_files/server5.eku-cs.crt" \ |
| 7040 | 0 \ |
| 7041 | -s "bad certificate (usage extensions)" \ |
| 7042 | -S "Processing of the Certificate handshake message failed" |
| 7043 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7044 | # Tests for DHM parameters loading |
| 7045 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7046 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7047 | "$P_SRV" \ |
| 7048 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7049 | debug_level=3" \ |
| 7050 | 0 \ |
| 7051 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7052 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7054 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7055 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7056 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7057 | debug_level=3" \ |
| 7058 | 0 \ |
| 7059 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 7060 | -c "value of 'DHM: G ' (2 bits)" |
| 7061 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7062 | # Tests for DHM client-side size checking |
| 7063 | |
| 7064 | run_test "DHM size: server default, client default, OK" \ |
| 7065 | "$P_SRV" \ |
| 7066 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7067 | debug_level=1" \ |
| 7068 | 0 \ |
| 7069 | -C "DHM prime too short:" |
| 7070 | |
| 7071 | run_test "DHM size: server default, client 2048, OK" \ |
| 7072 | "$P_SRV" \ |
| 7073 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7074 | debug_level=1 dhmlen=2048" \ |
| 7075 | 0 \ |
| 7076 | -C "DHM prime too short:" |
| 7077 | |
| 7078 | run_test "DHM size: server 1024, client default, OK" \ |
| 7079 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7080 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7081 | debug_level=1" \ |
| 7082 | 0 \ |
| 7083 | -C "DHM prime too short:" |
| 7084 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7085 | run_test "DHM size: server 999, client 999, OK" \ |
| 7086 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7087 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7088 | debug_level=1 dhmlen=999" \ |
| 7089 | 0 \ |
| 7090 | -C "DHM prime too short:" |
| 7091 | |
| 7092 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 7093 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7094 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7095 | debug_level=1 dhmlen=1000" \ |
| 7096 | 0 \ |
| 7097 | -C "DHM prime too short:" |
| 7098 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7099 | run_test "DHM size: server 1000, client default, rejected" \ |
| 7100 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7101 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7102 | debug_level=1" \ |
| 7103 | 1 \ |
| 7104 | -c "DHM prime too short:" |
| 7105 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7106 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7107 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7108 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7109 | debug_level=1 dhmlen=1001" \ |
| 7110 | 1 \ |
| 7111 | -c "DHM prime too short:" |
| 7112 | |
| 7113 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7114 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7115 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7116 | debug_level=1 dhmlen=1000" \ |
| 7117 | 1 \ |
| 7118 | -c "DHM prime too short:" |
| 7119 | |
| 7120 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7121 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7122 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7123 | debug_level=1 dhmlen=999" \ |
| 7124 | 1 \ |
| 7125 | -c "DHM prime too short:" |
| 7126 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7127 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7128 | "$P_SRV" \ |
| 7129 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7130 | debug_level=1 dhmlen=2049" \ |
| 7131 | 1 \ |
| 7132 | -c "DHM prime too short:" |
| 7133 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7134 | # Tests for PSK callback |
| 7135 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7136 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7137 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7138 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7139 | psk_identity=foo psk=abc123" \ |
| 7140 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7141 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7142 | -S "SSL - Unknown identity received" \ |
| 7143 | -S "SSL - Verification of the message MAC failed" |
| 7144 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7145 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7146 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7147 | "$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] | 7148 | "$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] | 7149 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7150 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7151 | -C "session hash for extended master secret"\ |
| 7152 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7153 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7154 | -S "SSL - Unknown identity received" \ |
| 7155 | -S "SSL - Verification of the message MAC failed" |
| 7156 | |
| 7157 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7158 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7159 | "$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] | 7160 | "$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] | 7161 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7162 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7163 | -C "session hash for extended master secret"\ |
| 7164 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7165 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7166 | -S "SSL - Unknown identity received" \ |
| 7167 | -S "SSL - Verification of the message MAC failed" |
| 7168 | |
| 7169 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7170 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7171 | "$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] | 7172 | "$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] | 7173 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7174 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7175 | -c "session hash for extended master secret"\ |
| 7176 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7177 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7178 | -S "SSL - Unknown identity received" \ |
| 7179 | -S "SSL - Verification of the message MAC failed" |
| 7180 | |
| 7181 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7182 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7183 | "$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] | 7184 | "$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] | 7185 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7186 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7187 | -c "session hash for extended master secret"\ |
| 7188 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7189 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7190 | -S "SSL - Unknown identity received" \ |
| 7191 | -S "SSL - Verification of the message MAC failed" |
| 7192 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7193 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7194 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7195 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7196 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7197 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7198 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7199 | -C "session hash for extended master secret"\ |
| 7200 | -S "session hash for extended master secret"\ |
| 7201 | -S "SSL - The handshake negotiation failed" \ |
| 7202 | -S "SSL - Unknown identity received" \ |
| 7203 | -S "SSL - Verification of the message MAC failed" |
| 7204 | |
| 7205 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7206 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7207 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7208 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7209 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7210 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7211 | -C "session hash for extended master secret"\ |
| 7212 | -S "session hash for extended master secret"\ |
| 7213 | -S "SSL - The handshake negotiation failed" \ |
| 7214 | -S "SSL - Unknown identity received" \ |
| 7215 | -S "SSL - Verification of the message MAC failed" |
| 7216 | |
| 7217 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7218 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7219 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7220 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7221 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7222 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7223 | -c "session hash for extended master secret"\ |
| 7224 | -s "session hash for extended master secret"\ |
| 7225 | -S "SSL - The handshake negotiation failed" \ |
| 7226 | -S "SSL - Unknown identity received" \ |
| 7227 | -S "SSL - Verification of the message MAC failed" |
| 7228 | |
| 7229 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7230 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7231 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7232 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7233 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7234 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7235 | -c "session hash for extended master secret"\ |
| 7236 | -s "session hash for extended master secret"\ |
| 7237 | -S "SSL - The handshake negotiation failed" \ |
| 7238 | -S "SSL - Unknown identity received" \ |
| 7239 | -S "SSL - Verification of the message MAC failed" |
| 7240 | |
| 7241 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7242 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7243 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7244 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7245 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7246 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7247 | -C "session hash for extended master secret"\ |
| 7248 | -S "session hash for extended master secret"\ |
| 7249 | -S "SSL - The handshake negotiation failed" \ |
| 7250 | -S "SSL - Unknown identity received" \ |
| 7251 | -S "SSL - Verification of the message MAC failed" |
| 7252 | |
| 7253 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7254 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7255 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7256 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7257 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7258 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7259 | -C "session hash for extended master secret"\ |
| 7260 | -S "session hash for extended master secret"\ |
| 7261 | -S "SSL - The handshake negotiation failed" \ |
| 7262 | -S "SSL - Unknown identity received" \ |
| 7263 | -S "SSL - Verification of the message MAC failed" |
| 7264 | |
| 7265 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7266 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7267 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7268 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7269 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7270 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7271 | -c "session hash for extended master secret"\ |
| 7272 | -s "session hash for extended master secret"\ |
| 7273 | -S "SSL - The handshake negotiation failed" \ |
| 7274 | -S "SSL - Unknown identity received" \ |
| 7275 | -S "SSL - Verification of the message MAC failed" |
| 7276 | |
| 7277 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7278 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7279 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7280 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7281 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7282 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7283 | -c "session hash for extended master secret"\ |
| 7284 | -s "session hash for extended master secret"\ |
| 7285 | -S "SSL - The handshake negotiation failed" \ |
| 7286 | -S "SSL - Unknown identity received" \ |
| 7287 | -S "SSL - Verification of the message MAC failed" |
| 7288 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7289 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7290 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7291 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7292 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7293 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7294 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7295 | -C "session hash for extended master secret"\ |
| 7296 | -S "session hash for extended master secret"\ |
| 7297 | -S "SSL - The handshake negotiation failed" \ |
| 7298 | -S "SSL - Unknown identity received" \ |
| 7299 | -S "SSL - Verification of the message MAC failed" |
| 7300 | |
| 7301 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7302 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7303 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7304 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7305 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7306 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7307 | -C "session hash for extended master secret"\ |
| 7308 | -S "session hash for extended master secret"\ |
| 7309 | -S "SSL - The handshake negotiation failed" \ |
| 7310 | -S "SSL - Unknown identity received" \ |
| 7311 | -S "SSL - Verification of the message MAC failed" |
| 7312 | |
| 7313 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7314 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7315 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7316 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7317 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7318 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7319 | -c "session hash for extended master secret"\ |
| 7320 | -s "session hash for extended master secret"\ |
| 7321 | -S "SSL - The handshake negotiation failed" \ |
| 7322 | -S "SSL - Unknown identity received" \ |
| 7323 | -S "SSL - Verification of the message MAC failed" |
| 7324 | |
| 7325 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7326 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7327 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7328 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7329 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7330 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +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" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7336 | |
| 7337 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7338 | 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] | 7339 | "$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" \ |
| 7340 | "$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] | 7341 | psk_identity=foo psk=abc123" \ |
| 7342 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7343 | -C "session hash for extended master secret"\ |
| 7344 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7345 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7346 | -S "SSL - Unknown identity received" \ |
| 7347 | -S "SSL - Verification of the message MAC failed" |
| 7348 | |
| 7349 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7350 | 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] | 7351 | "$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" \ |
| 7352 | "$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] | 7353 | psk_identity=foo psk=abc123" \ |
| 7354 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7355 | -C "session hash for extended master secret"\ |
| 7356 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7357 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7358 | -S "SSL - Unknown identity received" \ |
| 7359 | -S "SSL - Verification of the message MAC failed" |
| 7360 | |
| 7361 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7362 | 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] | 7363 | "$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] | 7364 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7365 | "$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] | 7366 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7367 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7368 | -c "session hash for extended master secret"\ |
| 7369 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7370 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7371 | -S "SSL - Unknown identity received" \ |
| 7372 | -S "SSL - Verification of the message MAC failed" |
| 7373 | |
| 7374 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7375 | 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] | 7376 | "$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] | 7377 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7378 | "$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] | 7379 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7380 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7381 | -c "session hash for extended master secret"\ |
| 7382 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7383 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7384 | -S "SSL - Unknown identity received" \ |
| 7385 | -S "SSL - Verification of the message MAC failed" |
| 7386 | |
| 7387 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7388 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7389 | "$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" \ |
| 7390 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7391 | psk_identity=foo psk=abc123" \ |
| 7392 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7393 | -C "session hash for extended master secret"\ |
| 7394 | -S "session hash for extended master secret"\ |
| 7395 | -S "SSL - The handshake negotiation failed" \ |
| 7396 | -S "SSL - Unknown identity received" \ |
| 7397 | -S "SSL - Verification of the message MAC failed" |
| 7398 | |
| 7399 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7400 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7401 | "$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" \ |
| 7402 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7403 | psk_identity=foo psk=abc123" \ |
| 7404 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7405 | -C "session hash for extended master secret"\ |
| 7406 | -S "session hash for extended master secret"\ |
| 7407 | -S "SSL - The handshake negotiation failed" \ |
| 7408 | -S "SSL - Unknown identity received" \ |
| 7409 | -S "SSL - Verification of the message MAC failed" |
| 7410 | |
| 7411 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7412 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7413 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7414 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7415 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7416 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7417 | 0 \ |
| 7418 | -c "session hash for extended master secret"\ |
| 7419 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7420 | -S "SSL - The handshake negotiation failed" \ |
| 7421 | -S "SSL - Unknown identity received" \ |
| 7422 | -S "SSL - Verification of the message MAC failed" |
| 7423 | |
| 7424 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7425 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7426 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7427 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7428 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7429 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7430 | 0 \ |
| 7431 | -c "session hash for extended master secret"\ |
| 7432 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7433 | -S "SSL - The handshake negotiation failed" \ |
| 7434 | -S "SSL - Unknown identity received" \ |
| 7435 | -S "SSL - Verification of the message MAC failed" |
| 7436 | |
| 7437 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7438 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7439 | "$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" \ |
| 7440 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7441 | psk_identity=foo psk=abc123" \ |
| 7442 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7443 | -C "session hash for extended master secret"\ |
| 7444 | -S "session hash for extended master secret"\ |
| 7445 | -S "SSL - The handshake negotiation failed" \ |
| 7446 | -S "SSL - Unknown identity received" \ |
| 7447 | -S "SSL - Verification of the message MAC failed" |
| 7448 | |
| 7449 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7450 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7451 | "$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" \ |
| 7452 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7453 | psk_identity=foo psk=abc123" \ |
| 7454 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7455 | -C "session hash for extended master secret"\ |
| 7456 | -S "session hash for extended master secret"\ |
| 7457 | -S "SSL - The handshake negotiation failed" \ |
| 7458 | -S "SSL - Unknown identity received" \ |
| 7459 | -S "SSL - Verification of the message MAC failed" |
| 7460 | |
| 7461 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7462 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7463 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7464 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7465 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7466 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7467 | 0 \ |
| 7468 | -c "session hash for extended master secret"\ |
| 7469 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7470 | -S "SSL - The handshake negotiation failed" \ |
| 7471 | -S "SSL - Unknown identity received" \ |
| 7472 | -S "SSL - Verification of the message MAC failed" |
| 7473 | |
| 7474 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7475 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7476 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7477 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7478 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7479 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7480 | 0 \ |
| 7481 | -c "session hash for extended master secret"\ |
| 7482 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7483 | -S "SSL - The handshake negotiation failed" \ |
| 7484 | -S "SSL - Unknown identity received" \ |
| 7485 | -S "SSL - Verification of the message MAC failed" |
| 7486 | |
| 7487 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7488 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7489 | "$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" \ |
| 7490 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7491 | psk_identity=foo psk=abc123" \ |
| 7492 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7493 | -C "session hash for extended master secret"\ |
| 7494 | -S "session hash for extended master secret"\ |
| 7495 | -S "SSL - The handshake negotiation failed" \ |
| 7496 | -S "SSL - Unknown identity received" \ |
| 7497 | -S "SSL - Verification of the message MAC failed" |
| 7498 | |
| 7499 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7500 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7501 | "$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" \ |
| 7502 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7503 | psk_identity=foo psk=abc123" \ |
| 7504 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7505 | -C "session hash for extended master secret"\ |
| 7506 | -S "session hash for extended master secret"\ |
| 7507 | -S "SSL - The handshake negotiation failed" \ |
| 7508 | -S "SSL - Unknown identity received" \ |
| 7509 | -S "SSL - Verification of the message MAC failed" |
| 7510 | |
| 7511 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7512 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7513 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7514 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7515 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7516 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7517 | 0 \ |
| 7518 | -c "session hash for extended master secret"\ |
| 7519 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7520 | -S "SSL - The handshake negotiation failed" \ |
| 7521 | -S "SSL - Unknown identity received" \ |
| 7522 | -S "SSL - Verification of the message MAC failed" |
| 7523 | |
| 7524 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7525 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7526 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7527 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7528 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7529 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7530 | 0 \ |
| 7531 | -c "session hash for extended master secret"\ |
| 7532 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7533 | -S "SSL - The handshake negotiation failed" \ |
| 7534 | -S "SSL - Unknown identity received" \ |
| 7535 | -S "SSL - Verification of the message MAC failed" |
| 7536 | |
| 7537 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7538 | 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] | 7539 | "$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" \ |
| 7540 | "$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] | 7541 | psk_identity=def psk=beef" \ |
| 7542 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7543 | -C "session hash for extended master secret"\ |
| 7544 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7545 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7546 | -S "SSL - Unknown identity received" \ |
| 7547 | -S "SSL - Verification of the message MAC failed" |
| 7548 | |
| 7549 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7550 | 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] | 7551 | "$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" \ |
| 7552 | "$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] | 7553 | psk_identity=def psk=beef" \ |
| 7554 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7555 | -C "session hash for extended master secret"\ |
| 7556 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7557 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 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 | 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] | 7563 | "$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] | 7564 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7565 | "$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] | 7566 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7567 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7568 | -c "session hash for extended master secret"\ |
| 7569 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7570 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7571 | -S "SSL - Unknown identity received" \ |
| 7572 | -S "SSL - Verification of the message MAC failed" |
| 7573 | |
| 7574 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7575 | 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] | 7576 | "$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] | 7577 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7578 | "$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] | 7579 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7580 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7581 | -c "session hash for extended master secret"\ |
| 7582 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7583 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7584 | -S "SSL - Unknown identity received" \ |
| 7585 | -S "SSL - Verification of the message MAC failed" |
| 7586 | |
| 7587 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7588 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7589 | "$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" \ |
| 7590 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7591 | psk_identity=def psk=beef" \ |
| 7592 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7593 | -C "session hash for extended master secret"\ |
| 7594 | -S "session hash for extended master secret"\ |
| 7595 | -S "SSL - The handshake negotiation failed" \ |
| 7596 | -S "SSL - Unknown identity received" \ |
| 7597 | -S "SSL - Verification of the message MAC failed" |
| 7598 | |
| 7599 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7600 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7601 | "$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" \ |
| 7602 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7603 | psk_identity=def psk=beef" \ |
| 7604 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7605 | -C "session hash for extended master secret"\ |
| 7606 | -S "session hash for extended master secret"\ |
| 7607 | -S "SSL - The handshake negotiation failed" \ |
| 7608 | -S "SSL - Unknown identity received" \ |
| 7609 | -S "SSL - Verification of the message MAC failed" |
| 7610 | |
| 7611 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7612 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7613 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7614 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7615 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7616 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7617 | 0 \ |
| 7618 | -c "session hash for extended master secret"\ |
| 7619 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7620 | -S "SSL - The handshake negotiation failed" \ |
| 7621 | -S "SSL - Unknown identity received" \ |
| 7622 | -S "SSL - Verification of the message MAC failed" |
| 7623 | |
| 7624 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7625 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7626 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7627 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7628 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7629 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7630 | 0 \ |
| 7631 | -c "session hash for extended master secret"\ |
| 7632 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7633 | -S "SSL - The handshake negotiation failed" \ |
| 7634 | -S "SSL - Unknown identity received" \ |
| 7635 | -S "SSL - Verification of the message MAC failed" |
| 7636 | |
| 7637 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7638 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7639 | "$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" \ |
| 7640 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7641 | psk_identity=def psk=beef" \ |
| 7642 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7643 | -C "session hash for extended master secret"\ |
| 7644 | -S "session hash for extended master secret"\ |
| 7645 | -S "SSL - The handshake negotiation failed" \ |
| 7646 | -S "SSL - Unknown identity received" \ |
| 7647 | -S "SSL - Verification of the message MAC failed" |
| 7648 | |
| 7649 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7650 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7651 | "$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" \ |
| 7652 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7653 | psk_identity=def psk=beef" \ |
| 7654 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7655 | -C "session hash for extended master secret"\ |
| 7656 | -S "session hash for extended master secret"\ |
| 7657 | -S "SSL - The handshake negotiation failed" \ |
| 7658 | -S "SSL - Unknown identity received" \ |
| 7659 | -S "SSL - Verification of the message MAC failed" |
| 7660 | |
| 7661 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7662 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7663 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7664 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7665 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7666 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7667 | 0 \ |
| 7668 | -c "session hash for extended master secret"\ |
| 7669 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7670 | -S "SSL - The handshake negotiation failed" \ |
| 7671 | -S "SSL - Unknown identity received" \ |
| 7672 | -S "SSL - Verification of the message MAC failed" |
| 7673 | |
| 7674 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7675 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7676 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7677 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7678 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7679 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7680 | 0 \ |
| 7681 | -c "session hash for extended master secret"\ |
| 7682 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7683 | -S "SSL - The handshake negotiation failed" \ |
| 7684 | -S "SSL - Unknown identity received" \ |
| 7685 | -S "SSL - Verification of the message MAC failed" |
| 7686 | |
| 7687 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7688 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7689 | "$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" \ |
| 7690 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7691 | psk_identity=def psk=beef" \ |
| 7692 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7693 | -C "session hash for extended master secret"\ |
| 7694 | -S "session hash for extended master secret"\ |
| 7695 | -S "SSL - The handshake negotiation failed" \ |
| 7696 | -S "SSL - Unknown identity received" \ |
| 7697 | -S "SSL - Verification of the message MAC failed" |
| 7698 | |
| 7699 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7700 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7701 | "$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" \ |
| 7702 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7703 | psk_identity=def psk=beef" \ |
| 7704 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7705 | -C "session hash for extended master secret"\ |
| 7706 | -S "session hash for extended master secret"\ |
| 7707 | -S "SSL - The handshake negotiation failed" \ |
| 7708 | -S "SSL - Unknown identity received" \ |
| 7709 | -S "SSL - Verification of the message MAC failed" |
| 7710 | |
| 7711 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7712 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7713 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7714 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7715 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7716 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7717 | 0 \ |
| 7718 | -c "session hash for extended master secret"\ |
| 7719 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7720 | -S "SSL - The handshake negotiation failed" \ |
| 7721 | -S "SSL - Unknown identity received" \ |
| 7722 | -S "SSL - Verification of the message MAC failed" |
| 7723 | |
| 7724 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7725 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7726 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7727 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7728 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7729 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7730 | 0 \ |
| 7731 | -c "session hash for extended master secret"\ |
| 7732 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7733 | -S "SSL - The handshake negotiation failed" \ |
| 7734 | -S "SSL - Unknown identity received" \ |
| 7735 | -S "SSL - Verification of the message MAC failed" |
| 7736 | |
| 7737 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7738 | 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] | 7739 | "$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" \ |
| 7740 | "$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] | 7741 | psk_identity=def psk=beef" \ |
| 7742 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7743 | -C "session hash for extended master secret"\ |
| 7744 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7745 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7746 | -S "SSL - Unknown identity received" \ |
| 7747 | -S "SSL - Verification of the message MAC failed" |
| 7748 | |
| 7749 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7750 | 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] | 7751 | "$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" \ |
| 7752 | "$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] | 7753 | psk_identity=def psk=beef" \ |
| 7754 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7755 | -C "session hash for extended master secret"\ |
| 7756 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7757 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7758 | -S "SSL - Unknown identity received" \ |
| 7759 | -S "SSL - Verification of the message MAC failed" |
| 7760 | |
| 7761 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7762 | 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] | 7763 | "$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" \ |
| 7764 | "$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] | 7765 | psk_identity=def psk=beef" \ |
| 7766 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7767 | -C "session hash for extended master secret"\ |
| 7768 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7769 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7770 | -S "SSL - Unknown identity received" \ |
| 7771 | -S "SSL - Verification of the message MAC failed" |
| 7772 | |
| 7773 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7774 | 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] | 7775 | "$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" \ |
| 7776 | "$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] | 7777 | psk_identity=def psk=beef" \ |
| 7778 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7779 | -C "session hash for extended master secret"\ |
| 7780 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7781 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7782 | -S "SSL - Unknown identity received" \ |
| 7783 | -S "SSL - Verification of the message MAC failed" |
| 7784 | |
| 7785 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7786 | 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] | 7787 | "$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" \ |
| 7788 | "$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] | 7789 | psk_identity=def psk=beef" \ |
| 7790 | 1 \ |
| 7791 | -s "SSL - Verification of the message MAC failed" |
| 7792 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7793 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7794 | "$P_SRV" \ |
| 7795 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7796 | psk_identity=foo psk=abc123" \ |
| 7797 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7798 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7799 | -S "SSL - Unknown identity received" \ |
| 7800 | -S "SSL - Verification of the message MAC failed" |
| 7801 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7802 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7803 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7804 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7805 | psk_identity=foo psk=abc123" \ |
| 7806 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7807 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7808 | -s "SSL - Unknown identity received" \ |
| 7809 | -S "SSL - Verification of the message MAC failed" |
| 7810 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7811 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7812 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7813 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7814 | psk_identity=abc psk=dead" \ |
| 7815 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7816 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7817 | -S "SSL - Unknown identity received" \ |
| 7818 | -S "SSL - Verification of the message MAC failed" |
| 7819 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7820 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7821 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7822 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7823 | psk_identity=def psk=beef" \ |
| 7824 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7825 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7826 | -S "SSL - Unknown identity received" \ |
| 7827 | -S "SSL - Verification of the message MAC failed" |
| 7828 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7829 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7830 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7831 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7832 | psk_identity=ghi psk=beef" \ |
| 7833 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7834 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7835 | -s "SSL - Unknown identity received" \ |
| 7836 | -S "SSL - Verification of the message MAC failed" |
| 7837 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7838 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7839 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7840 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7841 | psk_identity=abc psk=beef" \ |
| 7842 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7843 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7844 | -S "SSL - Unknown identity received" \ |
| 7845 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7846 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7847 | # Tests for EC J-PAKE |
| 7848 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7849 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7851 | run_test "ECJPAKE: client not configured" \ |
| 7852 | "$P_SRV debug_level=3" \ |
| 7853 | "$P_CLI debug_level=3" \ |
| 7854 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7855 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7856 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7857 | -S "found ecjpake kkpp extension" \ |
| 7858 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7859 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7860 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7861 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7862 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7863 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7864 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7865 | run_test "ECJPAKE: server not configured" \ |
| 7866 | "$P_SRV debug_level=3" \ |
| 7867 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7868 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7869 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7870 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7871 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7872 | -s "found ecjpake kkpp extension" \ |
| 7873 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7874 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7875 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7876 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7877 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7878 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 7879 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 7880 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7881 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7882 | run_test "ECJPAKE: working, TLS" \ |
| 7883 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7884 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7885 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7886 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7887 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7888 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7889 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7890 | -s "found ecjpake kkpp extension" \ |
| 7891 | -S "skip ecjpake kkpp extension" \ |
| 7892 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7893 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7894 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7895 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7896 | -S "SSL - Verification of the message MAC failed" |
| 7897 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 7898 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 7899 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 7900 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 7901 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 7902 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 7903 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7904 | 0 \ |
| 7905 | -c "add ciphersuite: c0ff" \ |
| 7906 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 7907 | -c "using opaque password" \ |
| 7908 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 7909 | -C "re-using cached ecjpake parameters" \ |
| 7910 | -s "found ecjpake kkpp extension" \ |
| 7911 | -S "skip ecjpake kkpp extension" \ |
| 7912 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 7913 | -s "server hello, ecjpake kkpp extension" \ |
| 7914 | -c "found ecjpake_kkpp extension" \ |
| 7915 | -S "SSL - The handshake negotiation failed" \ |
| 7916 | -S "SSL - Verification of the message MAC failed" |
| 7917 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 7918 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 7919 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 7920 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 7921 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 7922 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 7923 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7924 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 7925 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7926 | 0 \ |
| 7927 | -c "add ciphersuite: c0ff" \ |
| 7928 | -c "adding ecjpake_kkpp extension" \ |
| 7929 | -c "using opaque password" \ |
| 7930 | -S "using opaque password" \ |
| 7931 | -C "re-using cached ecjpake parameters" \ |
| 7932 | -s "found ecjpake kkpp extension" \ |
| 7933 | -S "skip ecjpake kkpp extension" \ |
| 7934 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 7935 | -s "server hello, ecjpake kkpp extension" \ |
| 7936 | -c "found ecjpake_kkpp extension" \ |
| 7937 | -S "SSL - The handshake negotiation failed" \ |
| 7938 | -S "SSL - Verification of the message MAC failed" |
| 7939 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 7940 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 7941 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 7942 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 7943 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 7944 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 7945 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 7946 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 7947 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7948 | 0 \ |
| 7949 | -c "add ciphersuite: c0ff" \ |
| 7950 | -c "adding ecjpake_kkpp extension" \ |
| 7951 | -C "using opaque password" \ |
| 7952 | -s "using opaque password" \ |
| 7953 | -C "re-using cached ecjpake parameters" \ |
| 7954 | -s "found ecjpake kkpp extension" \ |
| 7955 | -S "skip ecjpake kkpp extension" \ |
| 7956 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 7957 | -s "server hello, ecjpake kkpp extension" \ |
| 7958 | -c "found ecjpake_kkpp extension" \ |
| 7959 | -S "SSL - The handshake negotiation failed" \ |
| 7960 | -S "SSL - Verification of the message MAC failed" |
| 7961 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7962 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7963 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7964 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 7965 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7966 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 7967 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7968 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7969 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7970 | -s "SSL - Verification of the message MAC failed" |
| 7971 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 7972 | server_needs_more_time 1 |
| 7973 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 7974 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 7975 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 7976 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 7977 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 7978 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7979 | 1 \ |
| 7980 | -c "using opaque password" \ |
| 7981 | -s "using opaque password" \ |
| 7982 | -C "re-using cached ecjpake parameters" \ |
| 7983 | -s "SSL - Verification of the message MAC failed" |
| 7984 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7985 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7986 | run_test "ECJPAKE: working, DTLS" \ |
| 7987 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7988 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7989 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7990 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7991 | -c "re-using cached ecjpake parameters" \ |
| 7992 | -S "SSL - Verification of the message MAC failed" |
| 7993 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7994 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7995 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 7996 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 7997 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7998 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7999 | 0 \ |
| 8000 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8001 | -S "SSL - Verification of the message MAC failed" |
| 8002 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8003 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8004 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8005 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 8006 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8007 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 8008 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8009 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8010 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8011 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8012 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8013 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8014 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8015 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8016 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8017 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8018 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8019 | 0 |
| 8020 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8021 | # Test for ClientHello without extensions |
| 8022 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8023 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8024 | run_test "ClientHello without extensions" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 8025 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8026 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8027 | 0 \ |
| 8028 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8029 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8030 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8031 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8032 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8034 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8035 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8036 | "$P_CLI request_size=100" \ |
| 8037 | 0 \ |
| 8038 | -s "Read from client: 100 bytes read$" |
| 8039 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8041 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8042 | "$P_SRV buffer_size=100" \ |
| 8043 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8044 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8045 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8046 | |
| 8047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8048 | requires_max_content_len 200 |
| 8049 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8050 | "$P_SRV buffer_size=100" \ |
| 8051 | "$P_CLI request_size=200" \ |
| 8052 | 0 \ |
| 8053 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8054 | |
| 8055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8056 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 8057 | "$P_SRV buffer_size=100" \ |
| 8058 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8059 | 0 \ |
| 8060 | -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] | 8061 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8062 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8063 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8064 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8065 | "$P_SRV force_version=tls12" \ |
| 8066 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8067 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8068 | 0 \ |
| 8069 | -s "Read from client: 1 bytes read" |
| 8070 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8071 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8072 | "$P_SRV force_version=tls12" \ |
| 8073 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8074 | 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] | 8075 | 0 \ |
| 8076 | -s "Read from client: 1 bytes read" |
| 8077 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8078 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8079 | "$P_SRV force_version=tls12" \ |
| 8080 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8081 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8082 | 0 \ |
| 8083 | -s "Read from client: 1 bytes read" |
| 8084 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8085 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8086 | "$P_SRV force_version=tls12" \ |
| 8087 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8088 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8089 | 0 \ |
| 8090 | -s "Read from client: 1 bytes read" |
| 8091 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8092 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8093 | "$P_SRV force_version=tls12" \ |
| 8094 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8095 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8096 | 0 \ |
| 8097 | -s "Read from client: 1 bytes read" |
| 8098 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8099 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8100 | run_test "Small client packet TLS 1.3 AEAD" \ |
| 8101 | "$P_SRV force_version=tls13" \ |
| 8102 | "$P_CLI request_size=1 \ |
| 8103 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8104 | 0 \ |
| 8105 | -s "Read from client: 1 bytes read" |
| 8106 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8107 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8108 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
| 8109 | "$P_SRV force_version=tls13" \ |
| 8110 | "$P_CLI request_size=1 \ |
| 8111 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8112 | 0 \ |
| 8113 | -s "Read from client: 1 bytes read" |
| 8114 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8115 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8116 | |
| 8117 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8118 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8119 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8120 | "$P_CLI dtls=1 request_size=1 \ |
| 8121 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8122 | 0 \ |
| 8123 | -s "Read from client: 1 bytes read" |
| 8124 | |
| 8125 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8126 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8127 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8128 | "$P_CLI dtls=1 request_size=1 \ |
| 8129 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8130 | 0 \ |
| 8131 | -s "Read from client: 1 bytes read" |
| 8132 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8133 | # Tests for small server packets |
| 8134 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8135 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8136 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8137 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8138 | 0 \ |
| 8139 | -c "Read from server: 1 bytes read" |
| 8140 | |
| 8141 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8142 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8143 | "$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] | 8144 | 0 \ |
| 8145 | -c "Read from server: 1 bytes read" |
| 8146 | |
| 8147 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8148 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8149 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8150 | 0 \ |
| 8151 | -c "Read from server: 1 bytes read" |
| 8152 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8153 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8154 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8155 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8156 | 0 \ |
| 8157 | -c "Read from server: 1 bytes read" |
| 8158 | |
| 8159 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8160 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8161 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8162 | 0 \ |
| 8163 | -c "Read from server: 1 bytes read" |
| 8164 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8165 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8166 | run_test "Small server packet TLS 1.3 AEAD" \ |
| 8167 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8168 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8169 | 0 \ |
| 8170 | -c "Read from server: 1 bytes read" |
| 8171 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8172 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8173 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
| 8174 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8175 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8176 | 0 \ |
| 8177 | -c "Read from server: 1 bytes read" |
| 8178 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8179 | # Tests for small server packets in DTLS |
| 8180 | |
| 8181 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8182 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8183 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8184 | "$P_CLI dtls=1 \ |
| 8185 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8186 | 0 \ |
| 8187 | -c "Read from server: 1 bytes read" |
| 8188 | |
| 8189 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8190 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8191 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8192 | "$P_CLI dtls=1 \ |
| 8193 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8194 | 0 \ |
| 8195 | -c "Read from server: 1 bytes read" |
| 8196 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8197 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8198 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8199 | # How many fragments do we expect to write $1 bytes? |
| 8200 | fragments_for_write() { |
| 8201 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8202 | } |
| 8203 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8204 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8205 | "$P_SRV force_version=tls12" \ |
| 8206 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8207 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8208 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8209 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8210 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8211 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8212 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8213 | "$P_SRV force_version=tls12" \ |
| 8214 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8216 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8217 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8218 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8219 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8220 | "$P_SRV force_version=tls12" \ |
| 8221 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8222 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8223 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8224 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8225 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8226 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8227 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8228 | "$P_SRV force_version=tls12" \ |
| 8229 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8230 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8231 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8232 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8233 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8234 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8235 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8236 | "$P_SRV force_version=tls12" \ |
| 8237 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8238 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8239 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8240 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8241 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8242 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8243 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8244 | run_test "Large client packet TLS 1.3 AEAD" \ |
| 8245 | "$P_SRV force_version=tls13" \ |
| 8246 | "$P_CLI request_size=16384 \ |
| 8247 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8248 | 0 \ |
| 8249 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8250 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8251 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8252 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8253 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
| 8254 | "$P_SRV force_version=tls13" \ |
| 8255 | "$P_CLI request_size=16384 \ |
| 8256 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8257 | 0 \ |
| 8258 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8259 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8260 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8261 | # 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] | 8262 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8263 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8264 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8265 | 0 \ |
| 8266 | -c "Read from server: 16384 bytes read" |
| 8267 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8268 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8269 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8270 | "$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] | 8271 | 0 \ |
| 8272 | -s "16384 bytes written in 1 fragments" \ |
| 8273 | -c "Read from server: 16384 bytes read" |
| 8274 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8275 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8276 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8277 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8278 | 0 \ |
| 8279 | -c "Read from server: 16384 bytes read" |
| 8280 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8281 | 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] | 8282 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8283 | "$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] | 8284 | 0 \ |
| 8285 | -s "16384 bytes written in 1 fragments" \ |
| 8286 | -c "Read from server: 16384 bytes read" |
| 8287 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8288 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8289 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8290 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8291 | 0 \ |
| 8292 | -c "Read from server: 16384 bytes read" |
| 8293 | |
| 8294 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8295 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8296 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8297 | 0 \ |
| 8298 | -c "Read from server: 16384 bytes read" |
| 8299 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8300 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8301 | run_test "Large server packet TLS 1.3 AEAD" \ |
| 8302 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8303 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8304 | 0 \ |
| 8305 | -c "Read from server: 16384 bytes read" |
| 8306 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8307 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8308 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
| 8309 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8310 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8311 | 0 \ |
| 8312 | -c "Read from server: 16384 bytes read" |
| 8313 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8314 | # Tests for restartable ECC |
| 8315 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8316 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8317 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8318 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8319 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8320 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8321 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8322 | "$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] | 8323 | 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] | 8324 | debug_level=1" \ |
| 8325 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8326 | -C "x509_verify_cert.*4b00" \ |
| 8327 | -C "mbedtls_pk_verify.*4b00" \ |
| 8328 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8329 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8330 | |
| 8331 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8332 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8333 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8334 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8335 | "$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] | 8336 | 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] | 8337 | debug_level=1 ec_max_ops=0" \ |
| 8338 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8339 | -C "x509_verify_cert.*4b00" \ |
| 8340 | -C "mbedtls_pk_verify.*4b00" \ |
| 8341 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8342 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8343 | |
| 8344 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8345 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8346 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8347 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8348 | "$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] | 8349 | 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] | 8350 | debug_level=1 ec_max_ops=65535" \ |
| 8351 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8352 | -C "x509_verify_cert.*4b00" \ |
| 8353 | -C "mbedtls_pk_verify.*4b00" \ |
| 8354 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8355 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8356 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8357 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8358 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8359 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8360 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8361 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8362 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8363 | "$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] | 8364 | 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] | 8365 | debug_level=1 ec_max_ops=1000" \ |
| 8366 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8367 | -c "x509_verify_cert.*4b00" \ |
| 8368 | -c "mbedtls_pk_verify.*4b00" \ |
| 8369 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8370 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8371 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8372 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8373 | # everything except ECDH (where TLS calls PSA directly). |
| 8374 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8375 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8376 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8377 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
| 8378 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 8379 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8380 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8381 | debug_level=1 ec_max_ops=1000" \ |
| 8382 | 0 \ |
| 8383 | -c "x509_verify_cert.*4b00" \ |
| 8384 | -c "mbedtls_pk_verify.*4b00" \ |
| 8385 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8386 | -c "mbedtls_pk_sign.*4b00" |
| 8387 | |
| 8388 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 8389 | # 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] | 8390 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8391 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8392 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8393 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8394 | crt_file=data_files/server5-badsign.crt \ |
| 8395 | key_file=data_files/server5.key" \ |
| 8396 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8397 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8398 | debug_level=1 ec_max_ops=1000" \ |
| 8399 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8400 | -c "x509_verify_cert.*4b00" \ |
| 8401 | -C "mbedtls_pk_verify.*4b00" \ |
| 8402 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8403 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8404 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8405 | -c "! mbedtls_ssl_handshake returned" \ |
| 8406 | -c "X509 - Certificate verification failed" |
| 8407 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8408 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8409 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8410 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8411 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8412 | 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] | 8413 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8414 | crt_file=data_files/server5-badsign.crt \ |
| 8415 | key_file=data_files/server5.key" \ |
| 8416 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8417 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8418 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8419 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8420 | -c "x509_verify_cert.*4b00" \ |
| 8421 | -c "mbedtls_pk_verify.*4b00" \ |
| 8422 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8423 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8424 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8425 | -C "! mbedtls_ssl_handshake returned" \ |
| 8426 | -C "X509 - Certificate verification failed" |
| 8427 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8428 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8429 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8430 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8431 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8432 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8433 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (USE_PSA)" \ |
| 8434 | "$P_SRV curves=secp256r1 auth_mode=required \ |
| 8435 | crt_file=data_files/server5-badsign.crt \ |
| 8436 | key_file=data_files/server5.key" \ |
| 8437 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8438 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8439 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8440 | 0 \ |
| 8441 | -c "x509_verify_cert.*4b00" \ |
| 8442 | -c "mbedtls_pk_verify.*4b00" \ |
| 8443 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8444 | -c "mbedtls_pk_sign.*4b00" \ |
| 8445 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8446 | -C "! mbedtls_ssl_handshake returned" \ |
| 8447 | -C "X509 - Certificate verification failed" |
| 8448 | |
| 8449 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8450 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8451 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8452 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8453 | 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] | 8454 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8455 | crt_file=data_files/server5-badsign.crt \ |
| 8456 | key_file=data_files/server5.key" \ |
| 8457 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8458 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8459 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8460 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8461 | -C "x509_verify_cert.*4b00" \ |
| 8462 | -c "mbedtls_pk_verify.*4b00" \ |
| 8463 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8464 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8465 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8466 | -C "! mbedtls_ssl_handshake returned" \ |
| 8467 | -C "X509 - Certificate verification failed" |
| 8468 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8469 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8470 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8471 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8472 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8473 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8474 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (USE_PSA)" \ |
| 8475 | "$P_SRV curves=secp256r1 auth_mode=required \ |
| 8476 | crt_file=data_files/server5-badsign.crt \ |
| 8477 | key_file=data_files/server5.key" \ |
| 8478 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8479 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8480 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8481 | 0 \ |
| 8482 | -C "x509_verify_cert.*4b00" \ |
| 8483 | -c "mbedtls_pk_verify.*4b00" \ |
| 8484 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8485 | -c "mbedtls_pk_sign.*4b00" \ |
| 8486 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8487 | -C "! mbedtls_ssl_handshake returned" \ |
| 8488 | -C "X509 - Certificate verification failed" |
| 8489 | |
| 8490 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8491 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8492 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8493 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8494 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8495 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8496 | "$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] | 8497 | 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] | 8498 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8499 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8500 | -c "x509_verify_cert.*4b00" \ |
| 8501 | -c "mbedtls_pk_verify.*4b00" \ |
| 8502 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8503 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8504 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8505 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8506 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8507 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8508 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8509 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8510 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
| 8511 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
| 8512 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8513 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8514 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8515 | 0 \ |
| 8516 | -c "x509_verify_cert.*4b00" \ |
| 8517 | -c "mbedtls_pk_verify.*4b00" \ |
| 8518 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8519 | -c "mbedtls_pk_sign.*4b00" |
| 8520 | |
| 8521 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8522 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8523 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8524 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8525 | 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] | 8526 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8527 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8528 | debug_level=1 ec_max_ops=1000" \ |
| 8529 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8530 | -c "x509_verify_cert.*4b00" \ |
| 8531 | -c "mbedtls_pk_verify.*4b00" \ |
| 8532 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8533 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8534 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8535 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8536 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8537 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8538 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8539 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8540 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8541 | run_test "EC restart: TLS, max_ops=1000 no client auth (USE_PSA)" \ |
| 8542 | "$P_SRV curves=secp256r1" \ |
| 8543 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8544 | debug_level=1 ec_max_ops=1000" \ |
| 8545 | 0 \ |
| 8546 | -c "x509_verify_cert.*4b00" \ |
| 8547 | -c "mbedtls_pk_verify.*4b00" \ |
| 8548 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8549 | -C "mbedtls_pk_sign.*4b00" |
| 8550 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8551 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 8552 | # restartable behaviour at all (not even client auth). |
| 8553 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 8554 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8555 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8556 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8557 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
| 8558 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 8559 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
| 8560 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8561 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8562 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8563 | -C "x509_verify_cert.*4b00" \ |
| 8564 | -C "mbedtls_pk_verify.*4b00" \ |
| 8565 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8566 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8567 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8568 | # Tests of asynchronous private key support in SSL |
| 8569 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8571 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8572 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8573 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8574 | "$P_CLI" \ |
| 8575 | 0 \ |
| 8576 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8577 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8578 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8579 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8580 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8581 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8582 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8583 | "$P_CLI" \ |
| 8584 | 0 \ |
| 8585 | -s "Async sign callback: using key slot " \ |
| 8586 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8587 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8588 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8589 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8590 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8591 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8592 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8593 | "$P_CLI" \ |
| 8594 | 0 \ |
| 8595 | -s "Async sign callback: using key slot " \ |
| 8596 | -U "Async sign callback: using key slot " \ |
| 8597 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8598 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8599 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8600 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8601 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8602 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8603 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8604 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8605 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8606 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8607 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8608 | "$P_CLI server_name=polarssl.example" \ |
| 8609 | 0 \ |
| 8610 | -s "Async sign callback: using key slot " \ |
| 8611 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8612 | -s "parse ServerName extension" \ |
| 8613 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8614 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8615 | |
| 8616 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8617 | run_test "SSL async private: decrypt, delay=0" \ |
| 8618 | "$P_SRV \ |
| 8619 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8620 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8621 | 0 \ |
| 8622 | -s "Async decrypt callback: using key slot " \ |
| 8623 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8624 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8625 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8626 | run_test "SSL async private: decrypt, delay=1" \ |
| 8627 | "$P_SRV \ |
| 8628 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8629 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8630 | 0 \ |
| 8631 | -s "Async decrypt callback: using key slot " \ |
| 8632 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8633 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8634 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8635 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8636 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8637 | "$P_SRV psk=abc123 \ |
| 8638 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8639 | "$P_CLI psk=abc123 \ |
| 8640 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8641 | 0 \ |
| 8642 | -s "Async decrypt callback: using key slot " \ |
| 8643 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8644 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8645 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8646 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8647 | "$P_SRV psk=abc123 \ |
| 8648 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8649 | "$P_CLI psk=abc123 \ |
| 8650 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8651 | 0 \ |
| 8652 | -s "Async decrypt callback: using key slot " \ |
| 8653 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8654 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8655 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8656 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8657 | run_test "SSL async private: sign callback not present" \ |
| 8658 | "$P_SRV \ |
| 8659 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8660 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8661 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8662 | 0 \ |
| 8663 | -S "Async sign callback" \ |
| 8664 | -s "! mbedtls_ssl_handshake returned" \ |
| 8665 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8666 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8667 | -s "Successful connection" |
| 8668 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8669 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8670 | run_test "SSL async private: decrypt callback not present" \ |
| 8671 | "$P_SRV debug_level=1 \ |
| 8672 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8673 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 8674 | [ \$? -eq 1 ] && $P_CLI" \ |
| 8675 | 0 \ |
| 8676 | -S "Async decrypt callback" \ |
| 8677 | -s "! mbedtls_ssl_handshake returned" \ |
| 8678 | -s "got no RSA private key" \ |
| 8679 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8680 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8681 | |
| 8682 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8683 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8684 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8685 | "$P_SRV \ |
| 8686 | async_operations=s async_private_delay1=1 \ |
| 8687 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8688 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8689 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8690 | 0 \ |
| 8691 | -s "Async sign callback: using key slot 0," \ |
| 8692 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8693 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8694 | |
| 8695 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8696 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8697 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8698 | "$P_SRV \ |
| 8699 | async_operations=s async_private_delay2=1 \ |
| 8700 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8701 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8702 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8703 | 0 \ |
| 8704 | -s "Async sign callback: using key slot 0," \ |
| 8705 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8706 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8707 | |
| 8708 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8709 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8710 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8711 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8712 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8713 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8714 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8715 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8716 | 0 \ |
| 8717 | -s "Async sign callback: using key slot 1," \ |
| 8718 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8719 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8720 | |
| 8721 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8722 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8723 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8724 | "$P_SRV \ |
| 8725 | async_operations=s async_private_delay1=1 \ |
| 8726 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8727 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8728 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8729 | 0 \ |
| 8730 | -s "Async sign callback: no key matches this certificate." |
| 8731 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8732 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8733 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8734 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8735 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8736 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8737 | "$P_CLI" \ |
| 8738 | 1 \ |
| 8739 | -s "Async sign callback: injected error" \ |
| 8740 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8741 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8742 | -s "! mbedtls_ssl_handshake returned" |
| 8743 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8744 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8745 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8746 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8747 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8748 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8749 | "$P_CLI" \ |
| 8750 | 1 \ |
| 8751 | -s "Async sign callback: using key slot " \ |
| 8752 | -S "Async resume" \ |
| 8753 | -s "Async cancel" |
| 8754 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8755 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8756 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8757 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8758 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8759 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8760 | "$P_CLI" \ |
| 8761 | 1 \ |
| 8762 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8763 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8764 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8765 | -s "! mbedtls_ssl_handshake returned" |
| 8766 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8767 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8768 | run_test "SSL async private: decrypt, error in start" \ |
| 8769 | "$P_SRV \ |
| 8770 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8771 | async_private_error=1" \ |
| 8772 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8773 | 1 \ |
| 8774 | -s "Async decrypt callback: injected error" \ |
| 8775 | -S "Async resume" \ |
| 8776 | -S "Async cancel" \ |
| 8777 | -s "! mbedtls_ssl_handshake returned" |
| 8778 | |
| 8779 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8780 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8781 | "$P_SRV \ |
| 8782 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8783 | async_private_error=2" \ |
| 8784 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8785 | 1 \ |
| 8786 | -s "Async decrypt callback: using key slot " \ |
| 8787 | -S "Async resume" \ |
| 8788 | -s "Async cancel" |
| 8789 | |
| 8790 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8791 | run_test "SSL async private: decrypt, error in resume" \ |
| 8792 | "$P_SRV \ |
| 8793 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8794 | async_private_error=3" \ |
| 8795 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8796 | 1 \ |
| 8797 | -s "Async decrypt callback: using key slot " \ |
| 8798 | -s "Async resume callback: decrypt done but injected error" \ |
| 8799 | -S "Async cancel" \ |
| 8800 | -s "! mbedtls_ssl_handshake returned" |
| 8801 | |
| 8802 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8803 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8804 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8805 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8806 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8807 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8808 | 0 \ |
| 8809 | -s "Async cancel" \ |
| 8810 | -s "! mbedtls_ssl_handshake returned" \ |
| 8811 | -s "Async resume" \ |
| 8812 | -s "Successful connection" |
| 8813 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8814 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8815 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8816 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8817 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8818 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8819 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8820 | 0 \ |
| 8821 | -s "! mbedtls_ssl_handshake returned" \ |
| 8822 | -s "Async resume" \ |
| 8823 | -s "Successful connection" |
| 8824 | |
| 8825 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8826 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 8827 | # Note: the function "detect_required_features()" is not able to detect more than |
| 8828 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 8829 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 8830 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8831 | 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] | 8832 | "$P_SRV \ |
| 8833 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8834 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8835 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8836 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8837 | [ \$? -eq 1 ] && |
| 8838 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8839 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8840 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8841 | -S "Async resume" \ |
| 8842 | -s "Async cancel" \ |
| 8843 | -s "! mbedtls_ssl_handshake returned" \ |
| 8844 | -s "Async sign callback: no key matches this certificate." \ |
| 8845 | -s "Successful connection" |
| 8846 | |
| 8847 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8848 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 8849 | # Note: the function "detect_required_features()" is not able to detect more than |
| 8850 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 8851 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 8852 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8853 | 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] | 8854 | "$P_SRV \ |
| 8855 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 8856 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8857 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8858 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8859 | [ \$? -eq 1 ] && |
| 8860 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8861 | 0 \ |
| 8862 | -s "Async resume" \ |
| 8863 | -s "! mbedtls_ssl_handshake returned" \ |
| 8864 | -s "Async sign callback: no key matches this certificate." \ |
| 8865 | -s "Successful connection" |
| 8866 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8867 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8868 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8869 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8870 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8871 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8872 | exchanges=2 renegotiation=1" \ |
| 8873 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8874 | 0 \ |
| 8875 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8876 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8877 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8878 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8879 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8880 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8881 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8882 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8883 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8884 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8885 | 0 \ |
| 8886 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8887 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8888 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8889 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8890 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8891 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8892 | "$P_SRV \ |
| 8893 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8894 | exchanges=2 renegotiation=1" \ |
| 8895 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8896 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8897 | 0 \ |
| 8898 | -s "Async decrypt callback: using key slot " \ |
| 8899 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8900 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8901 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8902 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8903 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8904 | "$P_SRV \ |
| 8905 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8906 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8907 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8908 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8909 | 0 \ |
| 8910 | -s "Async decrypt callback: using key slot " \ |
| 8911 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8912 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8913 | # Tests for ECC extensions (rfc 4492) |
| 8914 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8915 | requires_config_enabled MBEDTLS_AES_C |
| 8916 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8917 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8918 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8919 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8920 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8921 | "$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] | 8922 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8923 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8924 | -C "client hello, adding supported_point_formats extension" \ |
| 8925 | -S "found supported elliptic curves extension" \ |
| 8926 | -S "found supported point formats extension" |
| 8927 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8928 | requires_config_enabled MBEDTLS_AES_C |
| 8929 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8930 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8931 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8932 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8933 | "$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] | 8934 | "$P_CLI debug_level=3" \ |
| 8935 | 0 \ |
| 8936 | -C "found supported_point_formats extension" \ |
| 8937 | -S "server hello, supported_point_formats extension" |
| 8938 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8939 | requires_config_enabled MBEDTLS_AES_C |
| 8940 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8941 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8942 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8943 | "$P_SRV debug_level=3" \ |
| 8944 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8945 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8946 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8947 | -c "client hello, adding supported_point_formats extension" \ |
| 8948 | -s "found supported elliptic curves extension" \ |
| 8949 | -s "found supported point formats extension" |
| 8950 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8951 | requires_config_enabled MBEDTLS_AES_C |
| 8952 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8953 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8954 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8955 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8956 | "$P_CLI debug_level=3" \ |
| 8957 | 0 \ |
| 8958 | -c "found supported_point_formats extension" \ |
| 8959 | -s "server hello, supported_point_formats extension" |
| 8960 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8961 | # Tests for DTLS HelloVerifyRequest |
| 8962 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8964 | run_test "DTLS cookie: enabled" \ |
| 8965 | "$P_SRV dtls=1 debug_level=2" \ |
| 8966 | "$P_CLI dtls=1 debug_level=2" \ |
| 8967 | 0 \ |
| 8968 | -s "cookie verification failed" \ |
| 8969 | -s "cookie verification passed" \ |
| 8970 | -S "cookie verification skipped" \ |
| 8971 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8972 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8973 | -S "SSL - The requested feature is not available" |
| 8974 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8976 | run_test "DTLS cookie: disabled" \ |
| 8977 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8978 | "$P_CLI dtls=1 debug_level=2" \ |
| 8979 | 0 \ |
| 8980 | -S "cookie verification failed" \ |
| 8981 | -S "cookie verification passed" \ |
| 8982 | -s "cookie verification skipped" \ |
| 8983 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8984 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8985 | -S "SSL - The requested feature is not available" |
| 8986 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8987 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8988 | run_test "DTLS cookie: default (failing)" \ |
| 8989 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8990 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8991 | 1 \ |
| 8992 | -s "cookie verification failed" \ |
| 8993 | -S "cookie verification passed" \ |
| 8994 | -S "cookie verification skipped" \ |
| 8995 | -C "received hello verify request" \ |
| 8996 | -S "hello verification requested" \ |
| 8997 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8998 | |
| 8999 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9000 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9001 | run_test "DTLS cookie: enabled, IPv6" \ |
| 9002 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 9003 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 9004 | 0 \ |
| 9005 | -s "cookie verification failed" \ |
| 9006 | -s "cookie verification passed" \ |
| 9007 | -S "cookie verification skipped" \ |
| 9008 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9009 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9010 | -S "SSL - The requested feature is not available" |
| 9011 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9013 | run_test "DTLS cookie: enabled, nbio" \ |
| 9014 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 9015 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9016 | 0 \ |
| 9017 | -s "cookie verification failed" \ |
| 9018 | -s "cookie verification passed" \ |
| 9019 | -S "cookie verification skipped" \ |
| 9020 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9021 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9022 | -S "SSL - The requested feature is not available" |
| 9023 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9024 | # Tests for client reconnecting from the same port with DTLS |
| 9025 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9026 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9028 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9029 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9030 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9031 | 0 \ |
| 9032 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9033 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9034 | -S "Client initiated reconnection from same port" |
| 9035 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9036 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9038 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9039 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9040 | "$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] | 9041 | 0 \ |
| 9042 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9043 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9044 | -s "Client initiated reconnection from same port" |
| 9045 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9046 | 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] | 9047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9048 | 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] | 9049 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 9050 | "$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] | 9051 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9052 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9053 | -s "Client initiated reconnection from same port" |
| 9054 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9055 | 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] | 9056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9057 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 9058 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 9059 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 9060 | 0 \ |
| 9061 | -S "The operation timed out" \ |
| 9062 | -s "Client initiated reconnection from same port" |
| 9063 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9065 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 9066 | "$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] | 9067 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 9068 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9069 | -s "The operation timed out" \ |
| 9070 | -S "Client initiated reconnection from same port" |
| 9071 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9073 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 9074 | -p "$P_PXY inject_clihlo=1" \ |
| 9075 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 9076 | "$P_CLI dtls=1 exchanges=2" \ |
| 9077 | 0 \ |
| 9078 | -s "possible client reconnect from the same port" \ |
| 9079 | -S "Client initiated reconnection from same port" |
| 9080 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9081 | # Tests for various cases of client authentication with DTLS |
| 9082 | # (focused on handshake flows and message parsing) |
| 9083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9085 | run_test "DTLS client auth: required" \ |
| 9086 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9087 | "$P_CLI dtls=1" \ |
| 9088 | 0 \ |
| 9089 | -s "Verifying peer X.509 certificate... ok" |
| 9090 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9092 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9093 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9094 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9095 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9096 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9097 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9099 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9100 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9101 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9102 | 0 \ |
| 9103 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9104 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9105 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9106 | run_test "DTLS wrong PSK: badmac alert" \ |
| 9107 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 9108 | "$P_CLI dtls=1 psk=abc124" \ |
| 9109 | 1 \ |
| 9110 | -s "SSL - Verification of the message MAC failed" \ |
| 9111 | -c "SSL - A fatal alert message was received from our peer" |
| 9112 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9113 | # Tests for receiving fragmented handshake messages with DTLS |
| 9114 | |
| 9115 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9117 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9118 | "$G_SRV -u --mtu 2048 -a" \ |
| 9119 | "$P_CLI dtls=1 debug_level=2" \ |
| 9120 | 0 \ |
| 9121 | -C "found fragmented DTLS handshake message" \ |
| 9122 | -C "error" |
| 9123 | |
| 9124 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9126 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9127 | "$G_SRV -u --mtu 512" \ |
| 9128 | "$P_CLI dtls=1 debug_level=2" \ |
| 9129 | 0 \ |
| 9130 | -c "found fragmented DTLS handshake message" \ |
| 9131 | -C "error" |
| 9132 | |
| 9133 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9135 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9136 | "$G_SRV -u --mtu 128" \ |
| 9137 | "$P_CLI dtls=1 debug_level=2" \ |
| 9138 | 0 \ |
| 9139 | -c "found fragmented DTLS handshake message" \ |
| 9140 | -C "error" |
| 9141 | |
| 9142 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9144 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9145 | "$G_SRV -u --mtu 128" \ |
| 9146 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9147 | 0 \ |
| 9148 | -c "found fragmented DTLS handshake message" \ |
| 9149 | -C "error" |
| 9150 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9151 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9152 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9154 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9155 | "$G_SRV -u --mtu 256" \ |
| 9156 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9157 | 0 \ |
| 9158 | -c "found fragmented DTLS handshake message" \ |
| 9159 | -c "client hello, adding renegotiation extension" \ |
| 9160 | -c "found renegotiation extension" \ |
| 9161 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9162 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9163 | -C "error" \ |
| 9164 | -s "Extra-header:" |
| 9165 | |
| 9166 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9167 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9169 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9170 | "$G_SRV -u --mtu 256" \ |
| 9171 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9172 | 0 \ |
| 9173 | -c "found fragmented DTLS handshake message" \ |
| 9174 | -c "client hello, adding renegotiation extension" \ |
| 9175 | -c "found renegotiation extension" \ |
| 9176 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9177 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9178 | -C "error" \ |
| 9179 | -s "Extra-header:" |
| 9180 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9182 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9183 | "$O_SRV -dtls -mtu 2048" \ |
| 9184 | "$P_CLI dtls=1 debug_level=2" \ |
| 9185 | 0 \ |
| 9186 | -C "found fragmented DTLS handshake message" \ |
| 9187 | -C "error" |
| 9188 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9190 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 9191 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9192 | "$P_CLI dtls=1 debug_level=2" \ |
| 9193 | 0 \ |
| 9194 | -c "found fragmented DTLS handshake message" \ |
| 9195 | -C "error" |
| 9196 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9198 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9199 | "$O_SRV -dtls -mtu 256" \ |
| 9200 | "$P_CLI dtls=1 debug_level=2" \ |
| 9201 | 0 \ |
| 9202 | -c "found fragmented DTLS handshake message" \ |
| 9203 | -C "error" |
| 9204 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9206 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9207 | "$O_SRV -dtls -mtu 256" \ |
| 9208 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9209 | 0 \ |
| 9210 | -c "found fragmented DTLS handshake message" \ |
| 9211 | -C "error" |
| 9212 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9213 | # Tests for sending fragmented handshake messages with DTLS |
| 9214 | # |
| 9215 | # Use client auth when we need the client to send large messages, |
| 9216 | # and use large cert chains on both sides too (the long chains we have all use |
| 9217 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9218 | # Sizes reached (UDP payload): |
| 9219 | # - 2037B for server certificate |
| 9220 | # - 1542B for client certificate |
| 9221 | # - 1013B for newsessionticket |
| 9222 | # - all others below 512B |
| 9223 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9224 | |
| 9225 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9226 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9227 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9228 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9230 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9231 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9232 | crt_file=data_files/server7_int-ca.crt \ |
| 9233 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9234 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9235 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9236 | "$P_CLI dtls=1 debug_level=2 \ |
| 9237 | crt_file=data_files/server8_int-ca2.crt \ |
| 9238 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9239 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9240 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9241 | 0 \ |
| 9242 | -S "found fragmented DTLS handshake message" \ |
| 9243 | -C "found fragmented DTLS handshake message" \ |
| 9244 | -C "error" |
| 9245 | |
| 9246 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9247 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9248 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9249 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9251 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9252 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9253 | crt_file=data_files/server7_int-ca.crt \ |
| 9254 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9255 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9256 | max_frag_len=1024" \ |
| 9257 | "$P_CLI dtls=1 debug_level=2 \ |
| 9258 | crt_file=data_files/server8_int-ca2.crt \ |
| 9259 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9260 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9261 | max_frag_len=2048" \ |
| 9262 | 0 \ |
| 9263 | -S "found fragmented DTLS handshake message" \ |
| 9264 | -c "found fragmented DTLS handshake message" \ |
| 9265 | -C "error" |
| 9266 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9267 | # With the MFL extension, the server has no way of forcing |
| 9268 | # the client to not exceed a certain MTU; hence, the following |
| 9269 | # test can't be replicated with an MTU proxy such as the one |
| 9270 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9271 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9272 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9273 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9274 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9276 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9277 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9278 | crt_file=data_files/server7_int-ca.crt \ |
| 9279 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9280 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9281 | max_frag_len=512" \ |
| 9282 | "$P_CLI dtls=1 debug_level=2 \ |
| 9283 | crt_file=data_files/server8_int-ca2.crt \ |
| 9284 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9285 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9286 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9287 | 0 \ |
| 9288 | -S "found fragmented DTLS handshake message" \ |
| 9289 | -c "found fragmented DTLS handshake message" \ |
| 9290 | -C "error" |
| 9291 | |
| 9292 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9293 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9294 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9295 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9297 | 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] | 9298 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9299 | crt_file=data_files/server7_int-ca.crt \ |
| 9300 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9301 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9302 | max_frag_len=2048" \ |
| 9303 | "$P_CLI dtls=1 debug_level=2 \ |
| 9304 | crt_file=data_files/server8_int-ca2.crt \ |
| 9305 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9306 | hs_timeout=2500-60000 \ |
| 9307 | max_frag_len=1024" \ |
| 9308 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9309 | -S "found fragmented DTLS handshake message" \ |
| 9310 | -c "found fragmented DTLS handshake message" \ |
| 9311 | -C "error" |
| 9312 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9313 | # While not required by the standard defining the MFL extension |
| 9314 | # (according to which it only applies to records, not to datagrams), |
| 9315 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9316 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9317 | # to the peer. |
| 9318 | # The next test checks that no datagrams significantly larger than the |
| 9319 | # negotiated MFL are sent. |
| 9320 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9321 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9322 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9323 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9325 | 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] | 9326 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9327 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9328 | crt_file=data_files/server7_int-ca.crt \ |
| 9329 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9330 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9331 | max_frag_len=2048" \ |
| 9332 | "$P_CLI dtls=1 debug_level=2 \ |
| 9333 | crt_file=data_files/server8_int-ca2.crt \ |
| 9334 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9335 | hs_timeout=2500-60000 \ |
| 9336 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9337 | 0 \ |
| 9338 | -S "found fragmented DTLS handshake message" \ |
| 9339 | -c "found fragmented DTLS handshake message" \ |
| 9340 | -C "error" |
| 9341 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9342 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9343 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9344 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9345 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9347 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9348 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9349 | crt_file=data_files/server7_int-ca.crt \ |
| 9350 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9351 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9352 | max_frag_len=2048" \ |
| 9353 | "$P_CLI dtls=1 debug_level=2 \ |
| 9354 | crt_file=data_files/server8_int-ca2.crt \ |
| 9355 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9356 | hs_timeout=2500-60000 \ |
| 9357 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9358 | 0 \ |
| 9359 | -s "found fragmented DTLS handshake message" \ |
| 9360 | -c "found fragmented DTLS handshake message" \ |
| 9361 | -C "error" |
| 9362 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9363 | # While not required by the standard defining the MFL extension |
| 9364 | # (according to which it only applies to records, not to datagrams), |
| 9365 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9366 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9367 | # to the peer. |
| 9368 | # The next test checks that no datagrams significantly larger than the |
| 9369 | # negotiated MFL are sent. |
| 9370 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9371 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9372 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9373 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9375 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9376 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9377 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9378 | crt_file=data_files/server7_int-ca.crt \ |
| 9379 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9380 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9381 | max_frag_len=2048" \ |
| 9382 | "$P_CLI dtls=1 debug_level=2 \ |
| 9383 | crt_file=data_files/server8_int-ca2.crt \ |
| 9384 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9385 | hs_timeout=2500-60000 \ |
| 9386 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9387 | 0 \ |
| 9388 | -s "found fragmented DTLS handshake message" \ |
| 9389 | -c "found fragmented DTLS handshake message" \ |
| 9390 | -C "error" |
| 9391 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9392 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9393 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9394 | requires_max_content_len 4096 |
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 | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9396 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9397 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9398 | crt_file=data_files/server7_int-ca.crt \ |
| 9399 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9400 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9401 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9402 | "$P_CLI dtls=1 debug_level=2 \ |
| 9403 | crt_file=data_files/server8_int-ca2.crt \ |
| 9404 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9405 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9406 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9407 | 0 \ |
| 9408 | -S "found fragmented DTLS handshake message" \ |
| 9409 | -C "found fragmented DTLS handshake message" \ |
| 9410 | -C "error" |
| 9411 | |
| 9412 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9413 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9414 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9416 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9417 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9418 | crt_file=data_files/server7_int-ca.crt \ |
| 9419 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9420 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9421 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9422 | "$P_CLI dtls=1 debug_level=2 \ |
| 9423 | crt_file=data_files/server8_int-ca2.crt \ |
| 9424 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9425 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9426 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9427 | 0 \ |
| 9428 | -s "found fragmented DTLS handshake message" \ |
| 9429 | -C "found fragmented DTLS handshake message" \ |
| 9430 | -C "error" |
| 9431 | |
| 9432 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9433 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9434 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9436 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9437 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9438 | crt_file=data_files/server7_int-ca.crt \ |
| 9439 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9440 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9441 | mtu=512" \ |
| 9442 | "$P_CLI dtls=1 debug_level=2 \ |
| 9443 | crt_file=data_files/server8_int-ca2.crt \ |
| 9444 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9445 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9446 | mtu=2048" \ |
| 9447 | 0 \ |
| 9448 | -S "found fragmented DTLS handshake message" \ |
| 9449 | -c "found fragmented DTLS handshake message" \ |
| 9450 | -C "error" |
| 9451 | |
| 9452 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9453 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9454 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9456 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9457 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9458 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9459 | crt_file=data_files/server7_int-ca.crt \ |
| 9460 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9461 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9462 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9463 | "$P_CLI dtls=1 debug_level=2 \ |
| 9464 | crt_file=data_files/server8_int-ca2.crt \ |
| 9465 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9466 | hs_timeout=2500-60000 \ |
| 9467 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9468 | 0 \ |
| 9469 | -s "found fragmented DTLS handshake message" \ |
| 9470 | -c "found fragmented DTLS handshake message" \ |
| 9471 | -C "error" |
| 9472 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9473 | # 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] | 9474 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9475 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9476 | requires_hash_alg SHA_256 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9477 | requires_config_enabled MBEDTLS_AES_C |
| 9478 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9479 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9480 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9481 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9482 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9483 | crt_file=data_files/server7_int-ca.crt \ |
| 9484 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9485 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9486 | mtu=512" \ |
| 9487 | "$P_CLI dtls=1 debug_level=2 \ |
| 9488 | crt_file=data_files/server8_int-ca2.crt \ |
| 9489 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9490 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9491 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9492 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9493 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9494 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9495 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9496 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9497 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9498 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9499 | # 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] | 9500 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9501 | # retransmissions, but in some cases (like both the server and client using |
| 9502 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9503 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9504 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9505 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9506 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9507 | requires_config_enabled MBEDTLS_AES_C |
| 9508 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9509 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9510 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9511 | -p "$P_PXY mtu=508" \ |
| 9512 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9513 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9514 | key_file=data_files/server7.key \ |
| 9515 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9516 | "$P_CLI dtls=1 debug_level=2 \ |
| 9517 | crt_file=data_files/server8_int-ca2.crt \ |
| 9518 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9519 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9520 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9521 | 0 \ |
| 9522 | -s "found fragmented DTLS handshake message" \ |
| 9523 | -c "found fragmented DTLS handshake message" \ |
| 9524 | -C "error" |
| 9525 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9526 | # 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] | 9527 | only_with_valgrind |
| 9528 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9529 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9530 | requires_config_enabled MBEDTLS_AES_C |
| 9531 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9532 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9533 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9534 | -p "$P_PXY mtu=508" \ |
| 9535 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9536 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9537 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9538 | hs_timeout=250-10000" \ |
| 9539 | "$P_CLI dtls=1 debug_level=2 \ |
| 9540 | crt_file=data_files/server8_int-ca2.crt \ |
| 9541 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9542 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9543 | hs_timeout=250-10000" \ |
| 9544 | 0 \ |
| 9545 | -s "found fragmented DTLS handshake message" \ |
| 9546 | -c "found fragmented DTLS handshake message" \ |
| 9547 | -C "error" |
| 9548 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9549 | # 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] | 9550 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9551 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9552 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9553 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9554 | requires_config_enabled MBEDTLS_RSA_C |
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 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9557 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9558 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9559 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 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=10000-60000 \ |
| 9563 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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=10000-60000 \ |
| 9568 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9569 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9570 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9571 | -s "found fragmented DTLS handshake message" \ |
| 9572 | -c "found fragmented DTLS handshake message" \ |
| 9573 | -C "error" |
| 9574 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9575 | # 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] | 9576 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9577 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9578 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9579 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9580 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9581 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9582 | requires_config_enabled MBEDTLS_AES_C |
| 9583 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9584 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9585 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9586 | -p "$P_PXY mtu=512" \ |
| 9587 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9588 | crt_file=data_files/server7_int-ca.crt \ |
| 9589 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9590 | hs_timeout=10000-60000 \ |
| 9591 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9592 | "$P_CLI dtls=1 debug_level=2 \ |
| 9593 | crt_file=data_files/server8_int-ca2.crt \ |
| 9594 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9595 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9596 | hs_timeout=10000-60000 \ |
| 9597 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9598 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9599 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9600 | -s "found fragmented DTLS handshake message" \ |
| 9601 | -c "found fragmented DTLS handshake message" \ |
| 9602 | -C "error" |
| 9603 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9604 | not_with_valgrind # spurious autoreduction due to timeout |
| 9605 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9606 | requires_config_enabled MBEDTLS_RSA_C |
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 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9609 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9610 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9614 | hs_timeout=10000-60000 \ |
| 9615 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9619 | hs_timeout=10000-60000 \ |
| 9620 | mtu=1024 nbio=2" \ |
| 9621 | 0 \ |
| 9622 | -S "autoreduction" \ |
| 9623 | -s "found fragmented DTLS handshake message" \ |
| 9624 | -c "found fragmented DTLS handshake message" \ |
| 9625 | -C "error" |
| 9626 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9627 | # 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] | 9628 | not_with_valgrind # spurious autoreduction due to timeout |
| 9629 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9630 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9631 | requires_config_enabled MBEDTLS_AES_C |
| 9632 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9633 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9634 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9635 | -p "$P_PXY mtu=512" \ |
| 9636 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9637 | crt_file=data_files/server7_int-ca.crt \ |
| 9638 | key_file=data_files/server7.key \ |
| 9639 | hs_timeout=10000-60000 \ |
| 9640 | mtu=512 nbio=2" \ |
| 9641 | "$P_CLI dtls=1 debug_level=2 \ |
| 9642 | crt_file=data_files/server8_int-ca2.crt \ |
| 9643 | key_file=data_files/server8.key \ |
| 9644 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9645 | hs_timeout=10000-60000 \ |
| 9646 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9647 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9648 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9649 | -s "found fragmented DTLS handshake message" \ |
| 9650 | -c "found fragmented DTLS handshake message" \ |
| 9651 | -C "error" |
| 9652 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9653 | # 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] | 9654 | # This ensures things still work after session_reset(). |
| 9655 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9656 | # Since we don't support reading fragmented ClientHello yet, |
| 9657 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9658 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9659 | # An autoreduction on the client-side might happen if the server is |
| 9660 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9661 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9662 | # resumed listening, which would result in a spurious autoreduction. |
| 9663 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9664 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9665 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9666 | requires_config_enabled MBEDTLS_AES_C |
| 9667 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9668 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9669 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9670 | -p "$P_PXY mtu=1450" \ |
| 9671 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9672 | crt_file=data_files/server7_int-ca.crt \ |
| 9673 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9674 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9675 | mtu=1450" \ |
| 9676 | "$P_CLI dtls=1 debug_level=2 \ |
| 9677 | crt_file=data_files/server8_int-ca2.crt \ |
| 9678 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9679 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9680 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 9681 | 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] | 9682 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9683 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9684 | -s "found fragmented DTLS handshake message" \ |
| 9685 | -c "found fragmented DTLS handshake message" \ |
| 9686 | -C "error" |
| 9687 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9688 | # An autoreduction on the client-side might happen if the server is |
| 9689 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9690 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9691 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9692 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9693 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9694 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9695 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9696 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9697 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9698 | -p "$P_PXY mtu=512" \ |
| 9699 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9700 | crt_file=data_files/server7_int-ca.crt \ |
| 9701 | key_file=data_files/server7.key \ |
| 9702 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9703 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9704 | mtu=512" \ |
| 9705 | "$P_CLI dtls=1 debug_level=2 \ |
| 9706 | crt_file=data_files/server8_int-ca2.crt \ |
| 9707 | key_file=data_files/server8.key \ |
| 9708 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9709 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9710 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9711 | mtu=512" \ |
| 9712 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9713 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9714 | -s "found fragmented DTLS handshake message" \ |
| 9715 | -c "found fragmented DTLS handshake message" \ |
| 9716 | -C "error" |
| 9717 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9718 | # An autoreduction on the client-side might happen if the server is |
| 9719 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9720 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9721 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9722 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9723 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9724 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9725 | requires_config_enabled MBEDTLS_AES_C |
| 9726 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9727 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9728 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9729 | -p "$P_PXY mtu=512" \ |
| 9730 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9731 | crt_file=data_files/server7_int-ca.crt \ |
| 9732 | key_file=data_files/server7.key \ |
| 9733 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9734 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9735 | mtu=512" \ |
| 9736 | "$P_CLI dtls=1 debug_level=2 \ |
| 9737 | crt_file=data_files/server8_int-ca2.crt \ |
| 9738 | key_file=data_files/server8.key \ |
| 9739 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9740 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9741 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9742 | mtu=512" \ |
| 9743 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9744 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9745 | -s "found fragmented DTLS handshake message" \ |
| 9746 | -c "found fragmented DTLS handshake message" \ |
| 9747 | -C "error" |
| 9748 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9749 | # An autoreduction on the client-side might happen if the server is |
| 9750 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9751 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9752 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9753 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9754 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9755 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9756 | requires_config_enabled MBEDTLS_AES_C |
| 9757 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9758 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9759 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9760 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9761 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9762 | crt_file=data_files/server7_int-ca.crt \ |
| 9763 | key_file=data_files/server7.key \ |
| 9764 | exchanges=2 renegotiation=1 \ |
| 9765 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9766 | hs_timeout=10000-60000 \ |
| 9767 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9768 | "$P_CLI dtls=1 debug_level=2 \ |
| 9769 | crt_file=data_files/server8_int-ca2.crt \ |
| 9770 | key_file=data_files/server8.key \ |
| 9771 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9772 | hs_timeout=10000-60000 \ |
| 9773 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9774 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9775 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9776 | -s "found fragmented DTLS handshake message" \ |
| 9777 | -c "found fragmented DTLS handshake message" \ |
| 9778 | -C "error" |
| 9779 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9780 | # An autoreduction on the client-side might happen if the server is |
| 9781 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9782 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9783 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9784 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9785 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9786 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9787 | requires_config_enabled MBEDTLS_AES_C |
| 9788 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9789 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9790 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9791 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9792 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9793 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9794 | crt_file=data_files/server7_int-ca.crt \ |
| 9795 | key_file=data_files/server7.key \ |
| 9796 | exchanges=2 renegotiation=1 \ |
| 9797 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9798 | hs_timeout=10000-60000 \ |
| 9799 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9800 | "$P_CLI dtls=1 debug_level=2 \ |
| 9801 | crt_file=data_files/server8_int-ca2.crt \ |
| 9802 | key_file=data_files/server8.key \ |
| 9803 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9804 | hs_timeout=10000-60000 \ |
| 9805 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9806 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9807 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9808 | -s "found fragmented DTLS handshake message" \ |
| 9809 | -c "found fragmented DTLS handshake message" \ |
| 9810 | -C "error" |
| 9811 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9812 | # An autoreduction on the client-side might happen if the server is |
| 9813 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9814 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9815 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9816 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9817 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9818 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9819 | requires_config_enabled MBEDTLS_AES_C |
| 9820 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9821 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9822 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9823 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9824 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9825 | crt_file=data_files/server7_int-ca.crt \ |
| 9826 | key_file=data_files/server7.key \ |
| 9827 | exchanges=2 renegotiation=1 \ |
| 9828 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9829 | hs_timeout=10000-60000 \ |
| 9830 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9831 | "$P_CLI dtls=1 debug_level=2 \ |
| 9832 | crt_file=data_files/server8_int-ca2.crt \ |
| 9833 | key_file=data_files/server8.key \ |
| 9834 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9835 | hs_timeout=10000-60000 \ |
| 9836 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9837 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9838 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9839 | -s "found fragmented DTLS handshake message" \ |
| 9840 | -c "found fragmented DTLS handshake message" \ |
| 9841 | -C "error" |
| 9842 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9843 | # 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] | 9844 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9845 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9846 | requires_config_enabled MBEDTLS_AES_C |
| 9847 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9848 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9849 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9850 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9851 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9852 | "$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] | 9853 | crt_file=data_files/server7_int-ca.crt \ |
| 9854 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9855 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9856 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9857 | crt_file=data_files/server8_int-ca2.crt \ |
| 9858 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9859 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9860 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9861 | 0 \ |
| 9862 | -s "found fragmented DTLS handshake message" \ |
| 9863 | -c "found fragmented DTLS handshake message" \ |
| 9864 | -C "error" |
| 9865 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9866 | # 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] | 9867 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9868 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9869 | requires_config_enabled MBEDTLS_AES_C |
| 9870 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9871 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9872 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9873 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9874 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9875 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9876 | crt_file=data_files/server7_int-ca.crt \ |
| 9877 | key_file=data_files/server7.key \ |
| 9878 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9879 | "$P_CLI dtls=1 debug_level=2 \ |
| 9880 | crt_file=data_files/server8_int-ca2.crt \ |
| 9881 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9882 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9883 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9884 | 0 \ |
| 9885 | -s "found fragmented DTLS handshake message" \ |
| 9886 | -c "found fragmented DTLS handshake message" \ |
| 9887 | -C "error" |
| 9888 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9889 | # interop tests for DTLS fragmentating with reliable connection |
| 9890 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9891 | # here and below we just want to test that the we fragment in a way that |
| 9892 | # pleases other implementations, so we don't need the peer to fragment |
| 9893 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9894 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9895 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9896 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9897 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9898 | "$G_SRV -u" \ |
| 9899 | "$P_CLI dtls=1 debug_level=2 \ |
| 9900 | crt_file=data_files/server8_int-ca2.crt \ |
| 9901 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9902 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9903 | 0 \ |
| 9904 | -c "fragmenting handshake message" \ |
| 9905 | -C "error" |
| 9906 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9907 | # We use --insecure for the GnuTLS client because it expects |
| 9908 | # the hostname / IP it connects to to be the name used in the |
| 9909 | # certificate obtained from the server. Here, however, it |
| 9910 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9911 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9912 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9913 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9914 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9915 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9916 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9917 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9918 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9919 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 9920 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9921 | crt_file=data_files/server7_int-ca.crt \ |
| 9922 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9923 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9924 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9925 | 0 \ |
| 9926 | -s "fragmenting handshake message" |
| 9927 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9928 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9929 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9930 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9931 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9932 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9933 | "$P_CLI dtls=1 debug_level=2 \ |
| 9934 | crt_file=data_files/server8_int-ca2.crt \ |
| 9935 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9936 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9937 | 0 \ |
| 9938 | -c "fragmenting handshake message" \ |
| 9939 | -C "error" |
| 9940 | |
| 9941 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9942 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9943 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9944 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9945 | "$P_SRV dtls=1 debug_level=2 \ |
| 9946 | crt_file=data_files/server7_int-ca.crt \ |
| 9947 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9948 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9949 | "$O_CLI -dtls1_2" \ |
| 9950 | 0 \ |
| 9951 | -s "fragmenting handshake message" |
| 9952 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9953 | # interop tests for DTLS fragmentating with unreliable connection |
| 9954 | # |
| 9955 | # again we just want to test that the we fragment in a way that |
| 9956 | # pleases other implementations, so we don't need the peer to fragment |
| 9957 | requires_gnutls_next |
| 9958 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9959 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9960 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9961 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9962 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9963 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9964 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9965 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9966 | crt_file=data_files/server8_int-ca2.crt \ |
| 9967 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9968 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9969 | 0 \ |
| 9970 | -c "fragmenting handshake message" \ |
| 9971 | -C "error" |
| 9972 | |
| 9973 | requires_gnutls_next |
| 9974 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9975 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9976 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9977 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9978 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9979 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9980 | "$P_SRV dtls=1 debug_level=2 \ |
| 9981 | crt_file=data_files/server7_int-ca.crt \ |
| 9982 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9983 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9984 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9985 | 0 \ |
| 9986 | -s "fragmenting handshake message" |
| 9987 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 9988 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 9989 | ## 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] | 9990 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9991 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9992 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9993 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9994 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9995 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9996 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 9997 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9998 | "$P_CLI dtls=1 debug_level=2 \ |
| 9999 | crt_file=data_files/server8_int-ca2.crt \ |
| 10000 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10001 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10002 | 0 \ |
| 10003 | -c "fragmenting handshake message" \ |
| 10004 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10005 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10006 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10007 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 10008 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10009 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10010 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10011 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10012 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10013 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 10014 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10015 | "$P_SRV dtls=1 debug_level=2 \ |
| 10016 | crt_file=data_files/server7_int-ca.crt \ |
| 10017 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10018 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10019 | "$O_CLI -dtls1_2" \ |
| 10020 | 0 \ |
| 10021 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10022 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10023 | # Tests for DTLS-SRTP (RFC 5764) |
| 10024 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10026 | run_test "DTLS-SRTP all profiles supported" \ |
| 10027 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10028 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10029 | 0 \ |
| 10030 | -s "found use_srtp extension" \ |
| 10031 | -s "found srtp profile" \ |
| 10032 | -s "selected srtp profile" \ |
| 10033 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10034 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10035 | -c "client hello, adding use_srtp extension" \ |
| 10036 | -c "found use_srtp extension" \ |
| 10037 | -c "found srtp profile" \ |
| 10038 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10039 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10040 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10041 | -C "error" |
| 10042 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10043 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10044 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10046 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10047 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10048 | "$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] | 10049 | 0 \ |
| 10050 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10051 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10052 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10053 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10054 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10055 | -c "client hello, adding use_srtp extension" \ |
| 10056 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10057 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10058 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10059 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10060 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10061 | -C "error" |
| 10062 | |
| 10063 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10065 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10066 | "$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] | 10067 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10068 | 0 \ |
| 10069 | -s "found use_srtp extension" \ |
| 10070 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10071 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10072 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10073 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10074 | -c "client hello, adding use_srtp extension" \ |
| 10075 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10076 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10077 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10078 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10079 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10080 | -C "error" |
| 10081 | |
| 10082 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10084 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10085 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10086 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10087 | 0 \ |
| 10088 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10089 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10090 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10091 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10092 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10093 | -c "client hello, adding use_srtp extension" \ |
| 10094 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10095 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10096 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10097 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10098 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10099 | -C "error" |
| 10100 | |
| 10101 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10103 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10104 | "$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] | 10105 | "$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] | 10106 | 0 \ |
| 10107 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10108 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10109 | -S "selected srtp profile" \ |
| 10110 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10111 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10112 | -c "client hello, adding use_srtp extension" \ |
| 10113 | -C "found use_srtp extension" \ |
| 10114 | -C "found srtp profile" \ |
| 10115 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10116 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10117 | -C "error" |
| 10118 | |
| 10119 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10121 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10122 | "$P_SRV dtls=1 debug_level=3" \ |
| 10123 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10124 | 0 \ |
| 10125 | -s "found use_srtp extension" \ |
| 10126 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10127 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10128 | -c "client hello, adding use_srtp extension" \ |
| 10129 | -C "found use_srtp extension" \ |
| 10130 | -C "found srtp profile" \ |
| 10131 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10132 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10133 | -C "error" |
| 10134 | |
| 10135 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10137 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10138 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10139 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10140 | 0 \ |
| 10141 | -s "found use_srtp extension" \ |
| 10142 | -s "found srtp profile" \ |
| 10143 | -s "selected srtp profile" \ |
| 10144 | -s "server hello, adding use_srtp extension" \ |
| 10145 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10146 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10147 | -c "client hello, adding use_srtp extension" \ |
| 10148 | -c "found use_srtp extension" \ |
| 10149 | -c "found srtp profile" \ |
| 10150 | -c "selected srtp profile" \ |
| 10151 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10152 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10153 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10154 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10155 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10156 | -C "error" |
| 10157 | |
| 10158 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10160 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10161 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10162 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10163 | 0 \ |
| 10164 | -s "found use_srtp extension" \ |
| 10165 | -s "found srtp profile" \ |
| 10166 | -s "selected srtp profile" \ |
| 10167 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10168 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10169 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10170 | -S "dumping 'using mki' (8 bytes)" \ |
| 10171 | -c "client hello, adding use_srtp extension" \ |
| 10172 | -c "found use_srtp extension" \ |
| 10173 | -c "found srtp profile" \ |
| 10174 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10175 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10176 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10177 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10178 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10179 | -C "dumping 'received mki' (8 bytes)" \ |
| 10180 | -C "error" |
| 10181 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10182 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10184 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10185 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10186 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10187 | 0 \ |
| 10188 | -s "found use_srtp extension" \ |
| 10189 | -s "found srtp profile" \ |
| 10190 | -s "selected srtp profile" \ |
| 10191 | -s "server hello, adding use_srtp extension" \ |
| 10192 | -s "DTLS-SRTP key material is"\ |
| 10193 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10194 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10195 | |
| 10196 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10198 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10199 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10200 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10201 | 0 \ |
| 10202 | -s "found use_srtp extension" \ |
| 10203 | -s "found srtp profile" \ |
| 10204 | -s "selected srtp profile" \ |
| 10205 | -s "server hello, adding use_srtp extension" \ |
| 10206 | -s "DTLS-SRTP key material is"\ |
| 10207 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10208 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10209 | |
| 10210 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10212 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10213 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10214 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10215 | 0 \ |
| 10216 | -s "found use_srtp extension" \ |
| 10217 | -s "found srtp profile" \ |
| 10218 | -s "selected srtp profile" \ |
| 10219 | -s "server hello, adding use_srtp extension" \ |
| 10220 | -s "DTLS-SRTP key material is"\ |
| 10221 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10222 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10223 | |
| 10224 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10226 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10227 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10228 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10229 | 0 \ |
| 10230 | -s "found use_srtp extension" \ |
| 10231 | -s "found srtp profile" \ |
| 10232 | -s "selected srtp profile" \ |
| 10233 | -s "server hello, adding use_srtp extension" \ |
| 10234 | -s "DTLS-SRTP key material is"\ |
| 10235 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10236 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10237 | |
| 10238 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10240 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10241 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10242 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10243 | 0 \ |
| 10244 | -s "found use_srtp extension" \ |
| 10245 | -s "found srtp profile" \ |
| 10246 | -s "selected srtp profile" \ |
| 10247 | -s "server hello, adding use_srtp extension" \ |
| 10248 | -s "DTLS-SRTP key material is"\ |
| 10249 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10250 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10251 | |
| 10252 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10254 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10255 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10256 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10257 | 0 \ |
| 10258 | -s "found use_srtp extension" \ |
| 10259 | -s "found srtp profile" \ |
| 10260 | -S "selected srtp profile" \ |
| 10261 | -S "server hello, adding use_srtp extension" \ |
| 10262 | -S "DTLS-SRTP key material is"\ |
| 10263 | -C "SRTP Extension negotiated, profile" |
| 10264 | |
| 10265 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10267 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10268 | "$P_SRV dtls=1 debug_level=3" \ |
| 10269 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10270 | 0 \ |
| 10271 | -s "found use_srtp extension" \ |
| 10272 | -S "server hello, adding use_srtp extension" \ |
| 10273 | -S "DTLS-SRTP key material is"\ |
| 10274 | -C "SRTP Extension negotiated, profile" |
| 10275 | |
| 10276 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10278 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10279 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10280 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10281 | 0 \ |
| 10282 | -c "client hello, adding use_srtp extension" \ |
| 10283 | -c "found use_srtp extension" \ |
| 10284 | -c "found srtp profile" \ |
| 10285 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10286 | -c "DTLS-SRTP key material is"\ |
| 10287 | -C "error" |
| 10288 | |
| 10289 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10291 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10292 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10293 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10294 | 0 \ |
| 10295 | -c "client hello, adding use_srtp extension" \ |
| 10296 | -c "found use_srtp extension" \ |
| 10297 | -c "found srtp profile" \ |
| 10298 | -c "selected srtp profile" \ |
| 10299 | -c "DTLS-SRTP key material is"\ |
| 10300 | -C "error" |
| 10301 | |
| 10302 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10304 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10305 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10306 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10307 | 0 \ |
| 10308 | -c "client hello, adding use_srtp extension" \ |
| 10309 | -c "found use_srtp extension" \ |
| 10310 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10311 | -c "selected srtp profile" \ |
| 10312 | -c "DTLS-SRTP key material is"\ |
| 10313 | -C "error" |
| 10314 | |
| 10315 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10317 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 10318 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10319 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10320 | 0 \ |
| 10321 | -c "client hello, adding use_srtp extension" \ |
| 10322 | -c "found use_srtp extension" \ |
| 10323 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10324 | -c "selected srtp profile" \ |
| 10325 | -c "DTLS-SRTP key material is"\ |
| 10326 | -C "error" |
| 10327 | |
| 10328 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10330 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10331 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10332 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10333 | 0 \ |
| 10334 | -c "client hello, adding use_srtp extension" \ |
| 10335 | -c "found use_srtp extension" \ |
| 10336 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10337 | -c "selected srtp profile" \ |
| 10338 | -c "DTLS-SRTP key material is"\ |
| 10339 | -C "error" |
| 10340 | |
| 10341 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10343 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10344 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10345 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10346 | 0 \ |
| 10347 | -c "client hello, adding use_srtp extension" \ |
| 10348 | -C "found use_srtp extension" \ |
| 10349 | -C "found srtp profile" \ |
| 10350 | -C "selected srtp profile" \ |
| 10351 | -C "DTLS-SRTP key material is"\ |
| 10352 | -C "error" |
| 10353 | |
| 10354 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10356 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10357 | "$O_SRV -dtls" \ |
| 10358 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10359 | 0 \ |
| 10360 | -c "client hello, adding use_srtp extension" \ |
| 10361 | -C "found use_srtp extension" \ |
| 10362 | -C "found srtp profile" \ |
| 10363 | -C "selected srtp profile" \ |
| 10364 | -C "DTLS-SRTP key material is"\ |
| 10365 | -C "error" |
| 10366 | |
| 10367 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10369 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10370 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10371 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10372 | 0 \ |
| 10373 | -c "client hello, adding use_srtp extension" \ |
| 10374 | -c "found use_srtp extension" \ |
| 10375 | -c "found srtp profile" \ |
| 10376 | -c "selected srtp profile" \ |
| 10377 | -c "DTLS-SRTP key material is"\ |
| 10378 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10379 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10380 | -C "dumping 'received mki' (8 bytes)" \ |
| 10381 | -C "error" |
| 10382 | |
| 10383 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10384 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10386 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10387 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10388 | "$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] | 10389 | 0 \ |
| 10390 | -s "found use_srtp extension" \ |
| 10391 | -s "found srtp profile" \ |
| 10392 | -s "selected srtp profile" \ |
| 10393 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10394 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10395 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10396 | |
| 10397 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10398 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10400 | 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] | 10401 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10402 | "$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] | 10403 | 0 \ |
| 10404 | -s "found use_srtp extension" \ |
| 10405 | -s "found srtp profile" \ |
| 10406 | -s "selected srtp profile" \ |
| 10407 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10408 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10409 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10410 | |
| 10411 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10412 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10414 | 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] | 10415 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10416 | "$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] | 10417 | 0 \ |
| 10418 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10419 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10420 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10421 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10422 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10423 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10424 | |
| 10425 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10426 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10428 | 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] | 10429 | "$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] | 10430 | "$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] | 10431 | 0 \ |
| 10432 | -s "found use_srtp extension" \ |
| 10433 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10434 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10435 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10436 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10437 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10438 | |
| 10439 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10440 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10441 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10442 | 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] | 10443 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10444 | "$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] | 10445 | 0 \ |
| 10446 | -s "found use_srtp extension" \ |
| 10447 | -s "found srtp profile" \ |
| 10448 | -s "selected srtp profile" \ |
| 10449 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10450 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10451 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10452 | |
| 10453 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10454 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10456 | 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] | 10457 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10458 | "$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] | 10459 | 0 \ |
| 10460 | -s "found use_srtp extension" \ |
| 10461 | -s "found srtp profile" \ |
| 10462 | -S "selected srtp profile" \ |
| 10463 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10464 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10465 | -C "SRTP profile:" |
| 10466 | |
| 10467 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10468 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10470 | 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] | 10471 | "$P_SRV dtls=1 debug_level=3" \ |
| 10472 | "$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] | 10473 | 0 \ |
| 10474 | -s "found use_srtp extension" \ |
| 10475 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10476 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10477 | -C "SRTP profile:" |
| 10478 | |
| 10479 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10480 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10482 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10483 | "$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" \ |
| 10484 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10485 | 0 \ |
| 10486 | -c "client hello, adding use_srtp extension" \ |
| 10487 | -c "found use_srtp extension" \ |
| 10488 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10489 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10490 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10491 | -C "error" |
| 10492 | |
| 10493 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10494 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10496 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10497 | "$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" \ |
| 10498 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10499 | 0 \ |
| 10500 | -c "client hello, adding use_srtp extension" \ |
| 10501 | -c "found use_srtp extension" \ |
| 10502 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10503 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10504 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10505 | -C "error" |
| 10506 | |
| 10507 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10508 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10510 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10511 | "$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" \ |
| 10512 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10513 | 0 \ |
| 10514 | -c "client hello, adding use_srtp extension" \ |
| 10515 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10516 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10517 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10518 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10519 | -C "error" |
| 10520 | |
| 10521 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10522 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10524 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10525 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10526 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10527 | 0 \ |
| 10528 | -c "client hello, adding use_srtp extension" \ |
| 10529 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10530 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10531 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10532 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10533 | -C "error" |
| 10534 | |
| 10535 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10536 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10538 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10539 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10540 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10541 | 0 \ |
| 10542 | -c "client hello, adding use_srtp extension" \ |
| 10543 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10544 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10545 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10546 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10547 | -C "error" |
| 10548 | |
| 10549 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10550 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10552 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10553 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10554 | "$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] | 10555 | 0 \ |
| 10556 | -c "client hello, adding use_srtp extension" \ |
| 10557 | -C "found use_srtp extension" \ |
| 10558 | -C "found srtp profile" \ |
| 10559 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10560 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10561 | -C "error" |
| 10562 | |
| 10563 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10564 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10566 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10567 | "$G_SRV -u" \ |
| 10568 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10569 | 0 \ |
| 10570 | -c "client hello, adding use_srtp extension" \ |
| 10571 | -C "found use_srtp extension" \ |
| 10572 | -C "found srtp profile" \ |
| 10573 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10574 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10575 | -C "error" |
| 10576 | |
| 10577 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10578 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10580 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10581 | "$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" \ |
| 10582 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10583 | 0 \ |
| 10584 | -c "client hello, adding use_srtp extension" \ |
| 10585 | -c "found use_srtp extension" \ |
| 10586 | -c "found srtp profile" \ |
| 10587 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10588 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10589 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10590 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10591 | -c "dumping 'received mki' (8 bytes)" \ |
| 10592 | -C "error" |
| 10593 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10594 | # Tests for specific things with "unreliable" UDP connection |
| 10595 | |
| 10596 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10598 | run_test "DTLS proxy: reference" \ |
| 10599 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10600 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10601 | "$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] | 10602 | 0 \ |
| 10603 | -C "replayed record" \ |
| 10604 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10605 | -C "Buffer record from epoch" \ |
| 10606 | -S "Buffer record from epoch" \ |
| 10607 | -C "ssl_buffer_message" \ |
| 10608 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10609 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10610 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10611 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10612 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10613 | -c "HTTP/1.0 200 OK" |
| 10614 | |
| 10615 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10617 | run_test "DTLS proxy: duplicate every packet" \ |
| 10618 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10619 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10620 | "$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] | 10621 | 0 \ |
| 10622 | -c "replayed record" \ |
| 10623 | -s "replayed record" \ |
| 10624 | -c "record from another epoch" \ |
| 10625 | -s "record from another epoch" \ |
| 10626 | -S "resend" \ |
| 10627 | -s "Extra-header:" \ |
| 10628 | -c "HTTP/1.0 200 OK" |
| 10629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10631 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10632 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10633 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10634 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10635 | 0 \ |
| 10636 | -c "replayed record" \ |
| 10637 | -S "replayed record" \ |
| 10638 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10639 | -s "record from another epoch" \ |
| 10640 | -c "resend" \ |
| 10641 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10642 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10643 | -c "HTTP/1.0 200 OK" |
| 10644 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10646 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10647 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10648 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10649 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10650 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10651 | -c "next record in same datagram" \ |
| 10652 | -s "next record in same datagram" |
| 10653 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10655 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10656 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10657 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10658 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10659 | 0 \ |
| 10660 | -c "next record in same datagram" \ |
| 10661 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10662 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10664 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10665 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10666 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10667 | "$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] | 10668 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10669 | -c "discarding invalid record (mac)" \ |
| 10670 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10671 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10672 | -c "HTTP/1.0 200 OK" \ |
| 10673 | -S "too many records with bad MAC" \ |
| 10674 | -S "Verification of the message MAC failed" |
| 10675 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10677 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10678 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10679 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10680 | "$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] | 10681 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10682 | -C "discarding invalid record (mac)" \ |
| 10683 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10684 | -S "Extra-header:" \ |
| 10685 | -C "HTTP/1.0 200 OK" \ |
| 10686 | -s "too many records with bad MAC" \ |
| 10687 | -s "Verification of the message MAC failed" |
| 10688 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10690 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10691 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10692 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10693 | "$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] | 10694 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10695 | -c "discarding invalid record (mac)" \ |
| 10696 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10697 | -s "Extra-header:" \ |
| 10698 | -c "HTTP/1.0 200 OK" \ |
| 10699 | -S "too many records with bad MAC" \ |
| 10700 | -S "Verification of the message MAC failed" |
| 10701 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10703 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10704 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10705 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10706 | "$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] | 10707 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10708 | -c "discarding invalid record (mac)" \ |
| 10709 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10710 | -s "Extra-header:" \ |
| 10711 | -c "HTTP/1.0 200 OK" \ |
| 10712 | -s "too many records with bad MAC" \ |
| 10713 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10716 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10717 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10718 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10719 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10720 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10721 | -c "record from another epoch" \ |
| 10722 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10723 | -s "Extra-header:" \ |
| 10724 | -c "HTTP/1.0 200 OK" |
| 10725 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10726 | # Tests for reordering support with DTLS |
| 10727 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10728 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10730 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10731 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10732 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10733 | hs_timeout=2500-60000" \ |
| 10734 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10735 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10736 | 0 \ |
| 10737 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10738 | -c "Next handshake message has been buffered - load"\ |
| 10739 | -S "Buffering HS message" \ |
| 10740 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10741 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10742 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10743 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10744 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10745 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10746 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10748 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10749 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10750 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10751 | hs_timeout=2500-60000" \ |
| 10752 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10753 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10754 | 0 \ |
| 10755 | -c "Buffering HS message" \ |
| 10756 | -c "found fragmented DTLS handshake message"\ |
| 10757 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10758 | -c "Next handshake message has been buffered - load"\ |
| 10759 | -S "Buffering HS message" \ |
| 10760 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10761 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10762 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10763 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10764 | -S "Remember CCS message" |
| 10765 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10766 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10767 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10768 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10769 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10770 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10771 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10773 | 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] | 10774 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10775 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10776 | hs_timeout=2500-60000" \ |
| 10777 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10778 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10779 | 0 \ |
| 10780 | -c "Buffering HS message" \ |
| 10781 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10782 | -C "attempt to make space by freeing buffered messages" \ |
| 10783 | -S "Buffering HS message" \ |
| 10784 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10785 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10786 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10787 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10788 | -S "Remember CCS message" |
| 10789 | |
| 10790 | # The size constraints ensure that the delayed certificate message can't |
| 10791 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10792 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10793 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10794 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10795 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10797 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10798 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10799 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10800 | hs_timeout=2500-60000" \ |
| 10801 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10802 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10803 | 0 \ |
| 10804 | -c "Buffering HS message" \ |
| 10805 | -c "attempt to make space by freeing buffered future messages" \ |
| 10806 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10807 | -S "Buffering HS message" \ |
| 10808 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10809 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10810 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10811 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10812 | -S "Remember CCS message" |
| 10813 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10814 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10816 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10817 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10818 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10819 | hs_timeout=2500-60000" \ |
| 10820 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10821 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10822 | 0 \ |
| 10823 | -C "Buffering HS message" \ |
| 10824 | -C "Next handshake message has been buffered - load"\ |
| 10825 | -s "Buffering HS message" \ |
| 10826 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10827 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10828 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10829 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10830 | -S "Remember CCS message" |
| 10831 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10832 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10834 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10835 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10836 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10837 | hs_timeout=2500-60000" \ |
| 10838 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10839 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10840 | 0 \ |
| 10841 | -C "Buffering HS message" \ |
| 10842 | -C "Next handshake message has been buffered - load"\ |
| 10843 | -S "Buffering HS message" \ |
| 10844 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10845 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10846 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10847 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10848 | -S "Remember CCS message" |
| 10849 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10850 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10852 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10853 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10854 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10855 | hs_timeout=2500-60000" \ |
| 10856 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10857 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10858 | 0 \ |
| 10859 | -C "Buffering HS message" \ |
| 10860 | -C "Next handshake message has been buffered - load"\ |
| 10861 | -S "Buffering HS message" \ |
| 10862 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10863 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10864 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10865 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10866 | -s "Remember CCS message" |
| 10867 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10869 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10870 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10871 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10872 | hs_timeout=2500-60000" \ |
| 10873 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10874 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10875 | 0 \ |
| 10876 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10877 | -s "Found buffered record from current epoch - load" \ |
| 10878 | -c "Buffer record from epoch 1" \ |
| 10879 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10880 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10881 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10882 | # from the server are delayed, so that the encrypted Finished message |
| 10883 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10884 | # in afterwards, the encrypted Finished message must be freed in order |
| 10885 | # to make space for the NewSessionTicket to be reassembled. |
| 10886 | # This works only in very particular circumstances: |
| 10887 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10888 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10889 | # the encrypted Finished message. |
| 10890 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10891 | # needs to be fragmented. |
| 10892 | # - All messages sent by the server must be small enough to be either sent |
| 10893 | # without fragmentation or be reassembled within the bounds of |
| 10894 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10895 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10896 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10897 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10898 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10899 | -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] | 10900 | "$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] | 10901 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10902 | 0 \ |
| 10903 | -s "Buffer record from epoch 1" \ |
| 10904 | -s "Found buffered record from current epoch - load" \ |
| 10905 | -c "Buffer record from epoch 1" \ |
| 10906 | -C "Found buffered record from current epoch - load" \ |
| 10907 | -c "Enough space available after freeing future epoch record" |
| 10908 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10909 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10910 | |
| 10911 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10912 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10913 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10914 | "$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] | 10915 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10916 | "$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] | 10917 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10918 | 0 \ |
| 10919 | -s "Extra-header:" \ |
| 10920 | -c "HTTP/1.0 200 OK" |
| 10921 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10922 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10923 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10924 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10925 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10926 | "$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] | 10927 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10928 | 0 \ |
| 10929 | -s "Extra-header:" \ |
| 10930 | -c "HTTP/1.0 200 OK" |
| 10931 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10932 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10934 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10935 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10936 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10937 | "$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] | 10938 | 0 \ |
| 10939 | -s "Extra-header:" \ |
| 10940 | -c "HTTP/1.0 200 OK" |
| 10941 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10942 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10944 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10945 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10946 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10947 | "$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] | 10948 | 0 \ |
| 10949 | -s "Extra-header:" \ |
| 10950 | -c "HTTP/1.0 200 OK" |
| 10951 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10952 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10953 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10954 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10955 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10956 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10957 | "$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] | 10958 | 0 \ |
| 10959 | -s "Extra-header:" \ |
| 10960 | -c "HTTP/1.0 200 OK" |
| 10961 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10962 | client_needs_more_time 2 |
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 | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10964 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 10965 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10966 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 10967 | "$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] | 10968 | 0 \ |
| 10969 | -s "Extra-header:" \ |
| 10970 | -c "HTTP/1.0 200 OK" |
| 10971 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10972 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10974 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10975 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10976 | "$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] | 10977 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10978 | "$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] | 10979 | 0 \ |
| 10980 | -s "Extra-header:" \ |
| 10981 | -c "HTTP/1.0 200 OK" |
| 10982 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10983 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10984 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10985 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10986 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10987 | "$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] | 10988 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10989 | "$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] | 10990 | 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] | 10991 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10992 | 0 \ |
| 10993 | -s "a session has been resumed" \ |
| 10994 | -c "a session has been resumed" \ |
| 10995 | -s "Extra-header:" \ |
| 10996 | -c "HTTP/1.0 200 OK" |
| 10997 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10998 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10999 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11000 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 11001 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11002 | "$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] | 11003 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11004 | "$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] | 11005 | 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] | 11006 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 11007 | 0 \ |
| 11008 | -s "a session has been resumed" \ |
| 11009 | -c "a session has been resumed" \ |
| 11010 | -s "Extra-header:" \ |
| 11011 | -c "HTTP/1.0 200 OK" |
| 11012 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11013 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11014 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11015 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11016 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11017 | "$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] | 11018 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11019 | "$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] | 11020 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11021 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11022 | 0 \ |
| 11023 | -c "=> renegotiate" \ |
| 11024 | -s "=> renegotiate" \ |
| 11025 | -s "Extra-header:" \ |
| 11026 | -c "HTTP/1.0 200 OK" |
| 11027 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11028 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11029 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11030 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11031 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11032 | "$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] | 11033 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11034 | "$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] | 11035 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11036 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11037 | 0 \ |
| 11038 | -c "=> renegotiate" \ |
| 11039 | -s "=> renegotiate" \ |
| 11040 | -s "Extra-header:" \ |
| 11041 | -c "HTTP/1.0 200 OK" |
| 11042 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11043 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11044 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11045 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11046 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11047 | "$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] | 11048 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11049 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11050 | "$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] | 11051 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11052 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11053 | 0 \ |
| 11054 | -c "=> renegotiate" \ |
| 11055 | -s "=> renegotiate" \ |
| 11056 | -s "Extra-header:" \ |
| 11057 | -c "HTTP/1.0 200 OK" |
| 11058 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11059 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11060 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11061 | 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] | 11062 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11063 | "$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] | 11064 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11065 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11066 | "$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] | 11067 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11068 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11069 | 0 \ |
| 11070 | -c "=> renegotiate" \ |
| 11071 | -s "=> renegotiate" \ |
| 11072 | -s "Extra-header:" \ |
| 11073 | -c "HTTP/1.0 200 OK" |
| 11074 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11075 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11076 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11077 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11078 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11079 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11080 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11082 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11083 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 11084 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 11085 | "$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] | 11086 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11087 | -c "HTTP/1.0 200 OK" |
| 11088 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11089 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11090 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11091 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11093 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11094 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11095 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11096 | "$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] | 11097 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11098 | -c "HTTP/1.0 200 OK" |
| 11099 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11100 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11101 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11102 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11104 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11105 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11106 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11107 | "$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] | 11108 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11109 | -c "HTTP/1.0 200 OK" |
| 11110 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11111 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11112 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11113 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11115 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11116 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11117 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11118 | "$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] | 11119 | 0 \ |
| 11120 | -s "Extra-header:" \ |
| 11121 | -c "Extra-header:" |
| 11122 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11123 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11124 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11125 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11127 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11128 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11129 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11130 | "$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] | 11131 | 0 \ |
| 11132 | -s "Extra-header:" \ |
| 11133 | -c "Extra-header:" |
| 11134 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11135 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11136 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11137 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11139 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11140 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11141 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11142 | "$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] | 11143 | 0 \ |
| 11144 | -s "Extra-header:" \ |
| 11145 | -c "Extra-header:" |
| 11146 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11148 | run_test "export keys functionality" \ |
| 11149 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 11150 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11151 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11152 | -c "EAP-TLS key material is:"\ |
| 11153 | -s "EAP-TLS key material is:"\ |
| 11154 | -c "EAP-TLS IV is:" \ |
| 11155 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11156 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11157 | # openssl feature tests: check if tls1.3 exists. |
| 11158 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11159 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11160 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11161 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11162 | 0 \ |
| 11163 | -c "TLS 1.3" \ |
| 11164 | -s "TLS 1.3" |
| 11165 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11166 | # 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] | 11167 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11168 | requires_gnutls_next_no_ticket |
| 11169 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11170 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11171 | "$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] | 11172 | "$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] | 11173 | 0 \ |
| 11174 | -s "Version: TLS1.3" \ |
| 11175 | -c "Version: TLS1.3" |
| 11176 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11177 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11179 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11180 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11181 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
| 11182 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11183 | run_test "TLS 1.3: Default" \ |
| 11184 | "$P_SRV allow_sha1=0 debug_level=3 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
| 11185 | "$P_CLI allow_sha1=0" \ |
| 11186 | 0 \ |
| 11187 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11188 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11189 | -s "ECDH group: x25519" \ |
| 11190 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 11191 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11192 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11193 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11194 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11195 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11196 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11197 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11198 | "$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] | 11199 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11200 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11201 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11202 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11203 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11204 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11205 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11206 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11207 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11208 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11209 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11210 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11211 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11212 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11213 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11214 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11215 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11216 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11217 | -c "=> parse certificate verify" \ |
| 11218 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11219 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11220 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11221 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11222 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11223 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11224 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11225 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11226 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11227 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11228 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11229 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11230 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11231 | "$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] | 11232 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11233 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11234 | -s "SERVER HELLO was queued" \ |
| 11235 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11236 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11237 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11238 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11239 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11240 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11241 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11242 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11243 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11244 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11245 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11246 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11247 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11248 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11249 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11250 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11251 | -c "=> parse certificate verify" \ |
| 11252 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11253 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11254 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11255 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11256 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11257 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11258 | requires_openssl_tls1_3 |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11259 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11260 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11261 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11262 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11263 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11264 | run_test "TLS 1.3: alpn - openssl" \ |
| 11265 | "$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] | 11266 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11267 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11268 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11269 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11270 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11271 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11272 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11273 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11274 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11275 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11276 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11277 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11278 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11279 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11280 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11281 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11282 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11283 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11284 | -c "=> parse certificate verify" \ |
| 11285 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11286 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11287 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11288 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11289 | -c "HTTP/1.0 200 ok" \ |
| 11290 | -c "Application Layer Protocol is h2" |
| 11291 | |
| 11292 | requires_gnutls_tls1_3 |
| 11293 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11294 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11295 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11296 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11297 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11298 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11299 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11300 | "$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] | 11301 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11302 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11303 | -s "SERVER HELLO was queued" \ |
| 11304 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11305 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11306 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11307 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11308 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11309 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11310 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11311 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11312 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11313 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11314 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11315 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11316 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11317 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11318 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11319 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11320 | -c "=> parse certificate verify" \ |
| 11321 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11322 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11323 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11324 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11325 | -c "HTTP/1.0 200 OK" \ |
| 11326 | -c "Application Layer Protocol is h2" |
| 11327 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11328 | requires_openssl_tls1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11329 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11330 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11331 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11332 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11333 | run_test "TLS 1.3: server alpn - openssl" \ |
| 11334 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11335 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11336 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11337 | -s "found alpn extension" \ |
| 11338 | -s "server side, adding alpn extension" \ |
| 11339 | -s "Protocol is TLSv1.3" \ |
| 11340 | -s "HTTP/1.0 200 OK" \ |
| 11341 | -s "Application Layer Protocol is h2" |
| 11342 | |
| 11343 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11344 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11345 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11346 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11347 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11348 | run_test "TLS 1.3: server alpn - gnutls" \ |
| 11349 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11350 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11351 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11352 | -s "found alpn extension" \ |
| 11353 | -s "server side, adding alpn extension" \ |
| 11354 | -s "Protocol is TLSv1.3" \ |
| 11355 | -s "HTTP/1.0 200 OK" \ |
| 11356 | -s "Application Layer Protocol is h2" |
| 11357 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11359 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11360 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11361 | skip_handshake_stage_check |
| 11362 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11363 | 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] | 11364 | "$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] | 11365 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11366 | 1 \ |
| 11367 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11368 | -S "Version: TLS1.0" \ |
| 11369 | -C "Protocol is TLSv1.0" |
| 11370 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11372 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11373 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11374 | skip_handshake_stage_check |
| 11375 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11376 | 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] | 11377 | "$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] | 11378 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11379 | 1 \ |
| 11380 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11381 | -S "Version: TLS1.1" \ |
| 11382 | -C "Protocol is TLSv1.1" |
| 11383 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11385 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11386 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11387 | skip_handshake_stage_check |
| 11388 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11389 | 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] | 11390 | "$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] | 11391 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11392 | 1 \ |
| 11393 | -s "Client's version: 3.3" \ |
| 11394 | -c "is a fatal alert message (msg 40)" \ |
| 11395 | -S "Version: TLS1.2" \ |
| 11396 | -C "Protocol is TLSv1.2" |
| 11397 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11399 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11400 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11401 | skip_handshake_stage_check |
| 11402 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11403 | 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] | 11404 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11405 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11406 | 1 \ |
| 11407 | -s "fatal protocol_version" \ |
| 11408 | -c "is a fatal alert message (msg 70)" \ |
| 11409 | -S "Version: TLS1.0" \ |
| 11410 | -C "Protocol : TLSv1.0" |
| 11411 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11413 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11414 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11415 | skip_handshake_stage_check |
| 11416 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11417 | 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] | 11418 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11419 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11420 | 1 \ |
| 11421 | -s "fatal protocol_version" \ |
| 11422 | -c "is a fatal alert message (msg 70)" \ |
| 11423 | -S "Version: TLS1.1" \ |
| 11424 | -C "Protocol : TLSv1.1" |
| 11425 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11427 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11428 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11429 | skip_handshake_stage_check |
| 11430 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11431 | 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] | 11432 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11433 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11434 | 1 \ |
| 11435 | -s "fatal protocol_version" \ |
| 11436 | -c "is a fatal alert message (msg 70)" \ |
| 11437 | -S "Version: TLS1.2" \ |
| 11438 | -C "Protocol : TLSv1.2" |
| 11439 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11440 | requires_openssl_tls1_3 |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11441 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11442 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11443 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11444 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11445 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11446 | "$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] | 11447 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11448 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11449 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11450 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11451 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11452 | -c "HTTP/1.0 200 ok" \ |
| 11453 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11454 | |
| 11455 | requires_gnutls_tls1_3 |
| 11456 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11457 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11458 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11459 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11460 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11461 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11462 | "$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] | 11463 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11464 | 0 \ |
| 11465 | -c "got a certificate request" \ |
| 11466 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11467 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11468 | -c "HTTP/1.0 200 OK" \ |
| 11469 | -c "Protocol is TLSv1.3" |
| 11470 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11471 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11472 | requires_openssl_tls1_3 |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11473 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11474 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11475 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11476 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11477 | "$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] | 11478 | "$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] | 11479 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11480 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11481 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11482 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11483 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11484 | |
| 11485 | requires_gnutls_tls1_3 |
| 11486 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11487 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11488 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11489 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11490 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11491 | "$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] | 11492 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11493 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11494 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11495 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11496 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11497 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11498 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11499 | |
| 11500 | requires_openssl_tls1_3 |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11501 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11502 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11503 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11504 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11505 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11506 | "$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] | 11507 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11508 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11509 | 0 \ |
| 11510 | -c "got a certificate request" \ |
| 11511 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11512 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11513 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11514 | |
| 11515 | requires_gnutls_tls1_3 |
| 11516 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11517 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11518 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11519 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11520 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11521 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11522 | "$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] | 11523 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11524 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11525 | 0 \ |
| 11526 | -c "got a certificate request" \ |
| 11527 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11528 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11529 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11530 | |
| 11531 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11532 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11533 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11534 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11535 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11536 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11537 | "$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] | 11538 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11539 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11540 | 0 \ |
| 11541 | -c "got a certificate request" \ |
| 11542 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11543 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11544 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11545 | |
| 11546 | requires_gnutls_tls1_3 |
| 11547 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11548 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11549 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11550 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11551 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11552 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11553 | "$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] | 11554 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11555 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11556 | 0 \ |
| 11557 | -c "got a certificate request" \ |
| 11558 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11559 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11560 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11561 | |
| 11562 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11563 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11564 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11565 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11566 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11567 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11568 | "$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] | 11569 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11570 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11571 | 0 \ |
| 11572 | -c "got a certificate request" \ |
| 11573 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11574 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11575 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11576 | |
| 11577 | requires_gnutls_tls1_3 |
| 11578 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11579 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11580 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11581 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11582 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11583 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11584 | "$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] | 11585 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11586 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11587 | 0 \ |
| 11588 | -c "got a certificate request" \ |
| 11589 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11590 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11591 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11592 | |
| 11593 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11594 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11595 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11596 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11597 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11598 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11599 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11600 | "$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] | 11601 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11602 | 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] | 11603 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11604 | -c "got a certificate request" \ |
| 11605 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11606 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11607 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11608 | |
| 11609 | requires_gnutls_tls1_3 |
| 11610 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11611 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11612 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11613 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11614 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11615 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11616 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11617 | "$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] | 11618 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11619 | 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] | 11620 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11621 | -c "got a certificate request" \ |
| 11622 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11623 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11624 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11625 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11626 | requires_openssl_tls1_3 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11627 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11628 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11629 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11630 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11631 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11632 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11633 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11634 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11635 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11636 | 0 \ |
| 11637 | -c "got a certificate request" \ |
| 11638 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11639 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11640 | -c "Protocol is TLSv1.3" |
| 11641 | |
| 11642 | requires_gnutls_tls1_3 |
| 11643 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11644 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11645 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11646 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11647 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11648 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11649 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11650 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11651 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11652 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11653 | 0 \ |
| 11654 | -c "got a certificate request" \ |
| 11655 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11656 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11657 | -c "Protocol is TLSv1.3" |
| 11658 | |
| 11659 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11660 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11661 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11662 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11663 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11664 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11665 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11666 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11667 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11668 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11669 | 0 \ |
| 11670 | -c "got a certificate request" \ |
| 11671 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11672 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11673 | -c "Protocol is TLSv1.3" |
| 11674 | |
| 11675 | requires_gnutls_tls1_3 |
| 11676 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11677 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11678 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11679 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11680 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11681 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11682 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11683 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11684 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11685 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11686 | 0 \ |
| 11687 | -c "got a certificate request" \ |
| 11688 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11689 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11690 | -c "Protocol is TLSv1.3" |
| 11691 | |
| 11692 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11693 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11694 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11695 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11696 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11697 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11698 | 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] | 11699 | "$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] | 11700 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11701 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11702 | 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] | 11703 | 1 \ |
| 11704 | -c "got a certificate request" \ |
| 11705 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11706 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11707 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11708 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11709 | |
| 11710 | requires_gnutls_tls1_3 |
| 11711 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11712 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11713 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11714 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11715 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11716 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11717 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 11718 | "$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] | 11719 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11720 | 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] | 11721 | 1 \ |
| 11722 | -c "got a certificate request" \ |
| 11723 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11724 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11725 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11726 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11727 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11728 | # Test using an opaque private key for client authentication |
| 11729 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11730 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11731 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11732 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11733 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11734 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 11735 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 11736 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 11737 | 0 \ |
| 11738 | -c "got a certificate request" \ |
| 11739 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11740 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11741 | -c "Protocol is TLSv1.3" |
| 11742 | |
| 11743 | requires_gnutls_tls1_3 |
| 11744 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11745 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11746 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11747 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11748 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11749 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 11750 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 11751 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 11752 | key_file=data_files/cli2.key key_opaque=1" \ |
| 11753 | 0 \ |
| 11754 | -c "got a certificate request" \ |
| 11755 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11756 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11757 | -c "Protocol is TLSv1.3" |
| 11758 | |
| 11759 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11760 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11761 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11762 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11763 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11764 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11765 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 11766 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11767 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11768 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11769 | 0 \ |
| 11770 | -c "got a certificate request" \ |
| 11771 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11772 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11773 | -c "Protocol is TLSv1.3" |
| 11774 | |
| 11775 | requires_gnutls_tls1_3 |
| 11776 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11777 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11778 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11779 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11780 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11781 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11782 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 11783 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11784 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11785 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11786 | 0 \ |
| 11787 | -c "got a certificate request" \ |
| 11788 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11789 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11790 | -c "Protocol is TLSv1.3" |
| 11791 | |
| 11792 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11793 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11794 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11795 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11796 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11797 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11798 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 11799 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11800 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11801 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11802 | 0 \ |
| 11803 | -c "got a certificate request" \ |
| 11804 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11805 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11806 | -c "Protocol is TLSv1.3" |
| 11807 | |
| 11808 | requires_gnutls_tls1_3 |
| 11809 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11810 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11811 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11812 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11813 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11814 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11815 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 11816 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11817 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11818 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11819 | 0 \ |
| 11820 | -c "got a certificate request" \ |
| 11821 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11822 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11823 | -c "Protocol is TLSv1.3" |
| 11824 | |
| 11825 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11826 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11827 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11828 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11829 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11830 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11831 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11832 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11833 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11834 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11835 | 0 \ |
| 11836 | -c "got a certificate request" \ |
| 11837 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11838 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11839 | -c "Protocol is TLSv1.3" |
| 11840 | |
| 11841 | requires_gnutls_tls1_3 |
| 11842 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11843 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11844 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11845 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11846 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11847 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11848 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11849 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11850 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11851 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11852 | 0 \ |
| 11853 | -c "got a certificate request" \ |
| 11854 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11855 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11856 | -c "Protocol is TLSv1.3" |
| 11857 | |
| 11858 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11859 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11860 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11861 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11862 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
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 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11865 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11866 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11867 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11868 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11869 | 0 \ |
| 11870 | -c "got a certificate request" \ |
| 11871 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11872 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11873 | -c "Protocol is TLSv1.3" |
| 11874 | |
| 11875 | requires_gnutls_tls1_3 |
| 11876 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11877 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11878 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11879 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11880 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11881 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11882 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11883 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11884 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11885 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11886 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11887 | 0 \ |
| 11888 | -c "got a certificate request" \ |
| 11889 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11890 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11891 | -c "Protocol is TLSv1.3" |
| 11892 | |
| 11893 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11894 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11895 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11896 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11897 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11898 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11899 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11900 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11901 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11902 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11903 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11904 | 0 \ |
| 11905 | -c "got a certificate request" \ |
| 11906 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11907 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11908 | -c "Protocol is TLSv1.3" |
| 11909 | |
| 11910 | requires_gnutls_tls1_3 |
| 11911 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11912 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11913 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11914 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11915 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11916 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11917 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11918 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 11919 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11920 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11921 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11922 | 0 \ |
| 11923 | -c "got a certificate request" \ |
| 11924 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11925 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11926 | -c "Protocol is TLSv1.3" |
| 11927 | |
| 11928 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11929 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11930 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11931 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11932 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11933 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11934 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11935 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 11936 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11937 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11938 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11939 | 0 \ |
| 11940 | -c "got a certificate request" \ |
| 11941 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11942 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11943 | -c "Protocol is TLSv1.3" |
| 11944 | |
| 11945 | requires_gnutls_tls1_3 |
| 11946 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11947 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11948 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11949 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11950 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11951 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11952 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11953 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 11954 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11955 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11956 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11957 | 0 \ |
| 11958 | -c "got a certificate request" \ |
| 11959 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11960 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11961 | -c "Protocol is TLSv1.3" |
| 11962 | |
| 11963 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11964 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11965 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11966 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11967 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11968 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11969 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11970 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 11971 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 11972 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 11973 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11974 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11975 | 1 \ |
| 11976 | -c "got a certificate request" \ |
| 11977 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11978 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11979 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11980 | -C "unkown pk type" |
| 11981 | |
| 11982 | requires_gnutls_tls1_3 |
| 11983 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11984 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11985 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11986 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11987 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11988 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11989 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11990 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 11991 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 11992 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11993 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11994 | 1 \ |
| 11995 | -c "got a certificate request" \ |
| 11996 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11997 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11998 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11999 | -C "unkown pk type" |
| 12000 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12001 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12002 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12003 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12004 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12005 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12006 | 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] | 12007 | "$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] | 12008 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12009 | 0 \ |
| 12010 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12011 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12012 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12013 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12014 | -c "HTTP/1.0 200 ok" |
| 12015 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12016 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12017 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12018 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12019 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12020 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12021 | 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] | 12022 | "$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] | 12023 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12024 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12025 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12026 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12027 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12028 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12029 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12030 | |
| 12031 | requires_gnutls_tls1_3 |
| 12032 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12033 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12034 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12035 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12036 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12037 | 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] | 12038 | "$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] | 12039 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12040 | 0 \ |
| 12041 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12042 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12043 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12044 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12045 | -c "HTTP/1.0 200 OK" |
| 12046 | |
| 12047 | requires_gnutls_tls1_3 |
| 12048 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12049 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12050 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12051 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12052 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12053 | 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] | 12054 | "$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] | 12055 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12056 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12057 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12058 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12059 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12060 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12061 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12062 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12063 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12064 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12065 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12067 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12068 | "$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] | 12069 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12070 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12071 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12072 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12073 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12074 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12075 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12076 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12077 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12078 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12079 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12080 | requires_openssl_tls1_3 |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12081 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12082 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12083 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12084 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12085 | "$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] | 12086 | "$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] | 12087 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12088 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12089 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12090 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12091 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12092 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12093 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12094 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12095 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12096 | -s "=> parse client hello" \ |
| 12097 | -s "<= parse client hello" |
| 12098 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12099 | requires_gnutls_tls1_3 |
| 12100 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12101 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12102 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12103 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12104 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12105 | "$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] | 12106 | "$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] | 12107 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12108 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12109 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12110 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12111 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12112 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12113 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12114 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12115 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12116 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12117 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12118 | requires_gnutls_tls1_3 |
| 12119 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12120 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12121 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12122 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12123 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12124 | "$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" \ |
| 12125 | "$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] | 12126 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12127 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12128 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12129 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12130 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12131 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12132 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12133 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12134 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12135 | -s "=> parse client hello" \ |
| 12136 | -s "<= parse client hello" |
| 12137 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12138 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12139 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12140 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12141 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12142 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 12143 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12144 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12145 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12146 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12147 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12148 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12149 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12150 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12151 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12152 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12153 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12154 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12155 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12156 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12157 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12158 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12159 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12160 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12161 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12162 | "$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" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12163 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12164 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12165 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12166 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12167 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12168 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12169 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12170 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12171 | -s "=> parse client hello" \ |
| 12172 | -s "<= parse client hello" |
| 12173 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12174 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12175 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12176 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12177 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12178 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 12179 | "$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" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12180 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12181 | 1 \ |
| 12182 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12183 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12184 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12185 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12186 | -s "=> write certificate request" \ |
| 12187 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12188 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12189 | -s "=> parse client hello" \ |
| 12190 | -s "<= parse client hello" |
| 12191 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12192 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12193 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12194 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12195 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12196 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 12197 | "$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" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12198 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12199 | 0 \ |
| 12200 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12201 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12202 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12203 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12204 | -s "=> write certificate request" \ |
| 12205 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12206 | -s "=> parse client hello" \ |
| 12207 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12208 | |
| 12209 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12210 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12211 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12212 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12213 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 12214 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12215 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12216 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12217 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12218 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12219 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12220 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12221 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12222 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12223 | -s "=> write hello retry request" \ |
| 12224 | -s "<= write hello retry request" |
| 12225 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12226 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12227 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12228 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12229 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12230 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 12231 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12232 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12233 | 1 \ |
| 12234 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12235 | -s "No certificate available." |
| 12236 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12237 | requires_openssl_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12238 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12239 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12240 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12241 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12242 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12243 | "$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] | 12244 | 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] | 12245 | "$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" \ |
| 12246 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12247 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12248 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12249 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12250 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12251 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12252 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12253 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12254 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12255 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12256 | "$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] | 12257 | 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] | 12258 | "$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" \ |
| 12259 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12260 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12261 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12262 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12263 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12264 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12265 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12266 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12267 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12268 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12269 | "$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 \ |
| 12270 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12271 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12272 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12273 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12274 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12275 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12276 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12277 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12278 | TEST_SUITE_NAME=${i##*/} |
| 12279 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12280 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12281 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12282 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12283 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12284 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12285 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12286 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12287 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12288 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12289 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12290 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
| 12291 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12292 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12293 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12294 | -s "Protocol is TLSv1.3" \ |
| 12295 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12296 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12297 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12298 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12299 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12300 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12301 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12302 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12303 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12304 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
| 12305 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12306 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12307 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12308 | -s "Protocol is TLSv1.3" \ |
| 12309 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12310 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12311 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12312 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12313 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12314 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
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 | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12317 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12318 | 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] | 12319 | "$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] | 12320 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12321 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12322 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12323 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12324 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12325 | |
| 12326 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12327 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12328 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12329 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12330 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12331 | 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] | 12332 | "$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] | 12333 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12334 | 1 \ |
| 12335 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12336 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12337 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12338 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12339 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12340 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12341 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12342 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12343 | "$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] | 12344 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12345 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12346 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12347 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12348 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12349 | requires_gnutls_tls1_3 |
| 12350 | requires_gnutls_next_no_ticket |
| 12351 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12352 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12353 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12354 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12355 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12356 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12357 | "$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] | 12358 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12359 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12360 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12361 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12362 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12363 | |
| 12364 | requires_gnutls_tls1_3 |
| 12365 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12366 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12367 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12368 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12369 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12370 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12371 | "$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] | 12372 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12373 | 1 \ |
| 12374 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12375 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12376 | requires_gnutls_tls1_3 |
| 12377 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12378 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12379 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12380 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12381 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12382 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12383 | "$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] | 12384 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12385 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12386 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12387 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12388 | |
| 12389 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12390 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12391 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12392 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12393 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12394 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
| 12395 | "$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] | 12396 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12397 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12398 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12399 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12400 | -C "14 03 03 00 01" |
| 12401 | |
| 12402 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12403 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12404 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12405 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12406 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12407 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
| 12408 | "$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] | 12409 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12410 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12411 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12412 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12413 | |
| 12414 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12415 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12416 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12417 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12418 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12419 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
| 12420 | "$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] | 12421 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12422 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12423 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12424 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12425 | -c "14 03 03 00 01" |
| 12426 | |
| 12427 | requires_gnutls_tls1_3 |
| 12428 | requires_gnutls_next_no_ticket |
| 12429 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12430 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12431 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12432 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12433 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12434 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
| 12435 | "$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] | 12436 | "$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] | 12437 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12438 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12439 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12440 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12441 | |
| 12442 | requires_gnutls_tls1_3 |
| 12443 | requires_gnutls_next_no_ticket |
| 12444 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12445 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12446 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12447 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12448 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12449 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
| 12450 | "$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] | 12451 | "$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] | 12452 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12453 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12454 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12455 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12456 | -c "discarding change cipher spec in TLS1.3" |
| 12457 | |
| 12458 | requires_gnutls_tls1_3 |
| 12459 | requires_gnutls_next_no_ticket |
| 12460 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12461 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12462 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12463 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12464 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12465 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
| 12466 | "$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] | 12467 | "$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] | 12468 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12469 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12470 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12471 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12472 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12473 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 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 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12478 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
| 12479 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12480 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12481 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12482 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12483 | -c "Protocol is TLSv1.3" \ |
| 12484 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12485 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12486 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12487 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12488 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12489 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12490 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12491 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12492 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12493 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
| 12494 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12495 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12496 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12497 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12498 | -c "Protocol is TLSv1.3" \ |
| 12499 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12500 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12501 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12502 | |
| 12503 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12504 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12505 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12506 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12507 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12508 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12509 | "$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] | 12510 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12511 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12512 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12513 | -c "received HelloRetryRequest message" \ |
| 12514 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12515 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12516 | |
| 12517 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12518 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12519 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12520 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12521 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12522 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12523 | "$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] | 12524 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12525 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12526 | -c "received HelloRetryRequest message" \ |
| 12527 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12528 | |
| 12529 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12530 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12531 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12532 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12533 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12534 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12535 | "$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] | 12536 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12537 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12538 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12539 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12540 | |
| 12541 | requires_gnutls_tls1_3 |
| 12542 | requires_gnutls_next_no_ticket |
| 12543 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12544 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12545 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12546 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12547 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12548 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12549 | "$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] | 12550 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12551 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12552 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12553 | -c "received HelloRetryRequest message" \ |
| 12554 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12555 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12556 | |
| 12557 | requires_gnutls_tls1_3 |
| 12558 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12559 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12560 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12561 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12562 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12563 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12564 | "$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] | 12565 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12566 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12567 | -c "received HelloRetryRequest message" \ |
| 12568 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12569 | |
| 12570 | requires_gnutls_tls1_3 |
| 12571 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12572 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12573 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12574 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12575 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12576 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12577 | "$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] | 12578 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12579 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12580 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12581 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12582 | |
| 12583 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12584 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12585 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12586 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12587 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12588 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
| 12589 | "$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] | 12590 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12591 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12592 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12593 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12594 | -C "14 03 03 00 01" |
| 12595 | |
| 12596 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12597 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12598 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12599 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12600 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12601 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
| 12602 | "$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] | 12603 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12604 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12605 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12606 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12607 | |
| 12608 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12609 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12610 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12611 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12612 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12613 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
| 12614 | "$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] | 12615 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12616 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12617 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12618 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12619 | -c "14 03 03 00 01" |
| 12620 | |
| 12621 | requires_gnutls_tls1_3 |
| 12622 | requires_gnutls_next_no_ticket |
| 12623 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12624 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12625 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12626 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12627 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12628 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
| 12629 | "$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] | 12630 | "$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] | 12631 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12632 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12633 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12634 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12635 | |
| 12636 | requires_gnutls_tls1_3 |
| 12637 | requires_gnutls_next_no_ticket |
| 12638 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12639 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12640 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12641 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12642 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12643 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
| 12644 | "$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] | 12645 | "$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] | 12646 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12647 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12648 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12649 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12650 | -c "discarding change cipher spec in TLS1.3" |
| 12651 | |
| 12652 | requires_gnutls_tls1_3 |
| 12653 | requires_gnutls_next_no_ticket |
| 12654 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12655 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12656 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12657 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12658 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12659 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
| 12660 | "$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] | 12661 | "$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] | 12662 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12663 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12664 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12665 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12666 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12667 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12668 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12669 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12670 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12671 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12672 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12673 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12674 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12675 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12676 | "$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] | 12677 | 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] | 12678 | 0 \ |
| 12679 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12680 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12681 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12682 | |
| 12683 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12684 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12685 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12686 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12687 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12688 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12689 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12690 | -d 4 |
| 12691 | --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 " \ |
| 12692 | "$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] | 12693 | 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] | 12694 | 0 \ |
| 12695 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12696 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12697 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12698 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12699 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12700 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12701 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12702 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12703 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12704 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
| 12705 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12706 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12707 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12708 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12709 | "$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] | 12710 | 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] | 12711 | 0 \ |
| 12712 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12713 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 12714 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12715 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12716 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12717 | |
| 12718 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12719 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12720 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12721 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12722 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12723 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
| 12724 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12725 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12726 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12727 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12728 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12729 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12730 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12731 | 0 \ |
| 12732 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12733 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12734 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12735 | |
| 12736 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12737 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12738 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12739 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12740 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12741 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
| 12742 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12743 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12744 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12745 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12746 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12747 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12748 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 12749 | 0 \ |
| 12750 | -c "Negotiated version: 3.4" \ |
| 12751 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12752 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12753 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12754 | |
| 12755 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12756 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12757 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12758 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12759 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12760 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
| 12761 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12762 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12763 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12764 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12765 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12766 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12767 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 12768 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12769 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12770 | |
| 12771 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12772 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12773 | requires_config_enabled MBEDTLS_SSL_SRV_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 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12776 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
| 12777 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12778 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12779 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12780 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 12781 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12782 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12783 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 12784 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12785 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12786 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12787 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12788 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12789 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12790 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12791 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12792 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
| 12793 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12794 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12795 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12796 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12797 | "$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] | 12798 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12799 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12800 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12801 | |
| 12802 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12803 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12804 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12805 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12806 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12807 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
| 12808 | "$P_SRV debug_level=4 force_version=tls13 |
| 12809 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12810 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12811 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12812 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 12813 | 1 \ |
| 12814 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12815 | |
| 12816 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12817 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12818 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12819 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12820 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12821 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
| 12822 | "$P_SRV debug_level=4 force_version=tls13 |
| 12823 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12824 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12825 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12826 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 12827 | 1 \ |
| 12828 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12829 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12830 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12831 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12832 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12833 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12834 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12835 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
| 12836 | "$P_SRV debug_level=4 force_version=tls13 |
| 12837 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12838 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12839 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12840 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12841 | 1 \ |
| 12842 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12843 | |
| 12844 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12845 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12846 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12847 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12848 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12849 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 12850 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12851 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12852 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 12853 | "$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] | 12854 | 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] | 12855 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12856 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12857 | |
| 12858 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12859 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12860 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12861 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12862 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12863 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 12864 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12865 | -d 4 |
| 12866 | --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 " \ |
| 12867 | "$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] | 12868 | 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] | 12869 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12870 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12871 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12872 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12873 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12874 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12875 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12876 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12877 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
| 12878 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12879 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12880 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12881 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 12882 | "$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] | 12883 | 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] | 12884 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12885 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12886 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12887 | requires_openssl_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12888 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12889 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12890 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12891 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12892 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12893 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12894 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 12895 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12896 | 0 \ |
| 12897 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12898 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12899 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12900 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12901 | -c "HTTP/1.0 200 ok" |
| 12902 | |
| 12903 | requires_gnutls_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12904 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12905 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12906 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12907 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12908 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12909 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Ronald Cron | a709a0f | 2022-09-27 16:46:11 +0200 | [diff] [blame] | 12910 | "$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] | 12911 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12912 | 0 \ |
| 12913 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12914 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12915 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12916 | -c "Reconnecting with saved session" \ |
| 12917 | -c "HTTP/1.0 200 OK" \ |
| 12918 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12919 | |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12920 | requires_openssl_tls1_3 |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12921 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12922 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12923 | requires_config_enabled MBEDTLS_DEBUG_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 \ |
| 12926 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12927 | # https://github.com/openssl/openssl/issues/10714 |
| 12928 | # Until now, OpenSSL client does not support reconnect. |
| 12929 | skip_next_test |
| 12930 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
| 12931 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12932 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 12933 | 0 \ |
| 12934 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 12935 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 12936 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12937 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12938 | requires_gnutls_tls1_3 |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12939 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12940 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12941 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12942 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12943 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12944 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12945 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12946 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12947 | "$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] | 12948 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12949 | -c "Connecting again- trying to resume previous session" \ |
| 12950 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12951 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 12952 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 12953 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12954 | -s "key exchange mode: ephemeral" \ |
| 12955 | -s "key exchange mode: psk_ephemeral" \ |
| 12956 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12957 | |
Ronald Cron | 0a1c504 | 2023-02-20 10:44:22 +0100 | [diff] [blame] | 12958 | requires_gnutls_tls1_3 |
| 12959 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12960 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12961 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12962 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12963 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12964 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | d89360b | 2023-02-21 08:53:33 +0100 | [diff] [blame] | 12965 | # Test the session resumption when the cipher suite for the original session is |
| 12966 | # TLS1-3-AES-256-GCM-SHA384. In that case, the PSK is 384 bits long and not |
| 12967 | # 256 bits long as with all the other TLS 1.3 cipher suites. |
Ronald Cron | 0a1c504 | 2023-02-20 10:44:22 +0100 | [diff] [blame] | 12968 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
| 12969 | run_test "TLS 1.3: NewSessionTicket: Basic check with AES-256-GCM only, G->m" \ |
| 12970 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12971 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-256-GCM -V -r" \ |
| 12972 | 0 \ |
| 12973 | -c "Connecting again- trying to resume previous session" \ |
| 12974 | -c "NEW SESSION TICKET (4) was received" \ |
| 12975 | -s "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \ |
| 12976 | -s "=> write NewSessionTicket msg" \ |
| 12977 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 12978 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
| 12979 | -s "key exchange mode: ephemeral" \ |
| 12980 | -s "key exchange mode: psk_ephemeral" \ |
| 12981 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12982 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12983 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12984 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12985 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12986 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12987 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12988 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12989 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12990 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12991 | "$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] | 12992 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12993 | 0 \ |
| 12994 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12995 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12996 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12997 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12998 | -c "HTTP/1.0 200 OK" \ |
| 12999 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13000 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13001 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13002 | -s "key exchange mode: ephemeral" \ |
| 13003 | -s "key exchange mode: psk_ephemeral" \ |
| 13004 | -s "found pre_shared_key extension" |
| 13005 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13006 | requires_openssl_tls1_3 |
| 13007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13008 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13009 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13010 | 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] | 13011 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13012 | -msg -tls1_2 |
| 13013 | -Verify 10 " \ |
| 13014 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13015 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13016 | min_version=tls12 max_version=tls13 " \ |
| 13017 | 0 \ |
| 13018 | -c "Protocol is TLSv1.2" \ |
| 13019 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13020 | |
| 13021 | |
| 13022 | requires_gnutls_tls1_3 |
| 13023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13024 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13025 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13026 | 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] | 13027 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13028 | -d 4 |
| 13029 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 13030 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13031 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13032 | min_version=tls12 max_version=tls13 " \ |
| 13033 | 0 \ |
| 13034 | -c "Protocol is TLSv1.2" \ |
| 13035 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13036 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13037 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13038 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13039 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13040 | requires_config_enabled MBEDTLS_DEBUG_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 \ |
| 13043 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13044 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13045 | "$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] | 13046 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 13047 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 13048 | 0 \ |
| 13049 | -c "Protocol is TLSv1.3" \ |
| 13050 | -c "got new session ticket." \ |
| 13051 | -c "Saving session for reuse... ok" \ |
| 13052 | -c "Reconnecting with saved session" \ |
| 13053 | -c "HTTP/1.0 200 OK" \ |
| 13054 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13055 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13056 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13057 | -s "key exchange mode: ephemeral" \ |
| 13058 | -s "key exchange mode: psk_ephemeral" \ |
| 13059 | -s "found pre_shared_key extension" |
| 13060 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13061 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13062 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13063 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13064 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13065 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13066 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13067 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13068 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13069 | "$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] | 13070 | 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] | 13071 | "$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] | 13072 | 1 \ |
| 13073 | -c "Protocol is TLSv1.3" \ |
| 13074 | -c "got new session ticket." \ |
| 13075 | -c "Saving session for reuse... ok" \ |
| 13076 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13077 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13078 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13079 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13080 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13081 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13082 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13084 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13085 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13086 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13087 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13088 | run_tests_memory_after_hanshake |
| 13089 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13090 | # Final report |
| 13091 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13092 | echo "------------------------------------------------------------------------" |
| 13093 | |
| 13094 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13095 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13096 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13097 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13098 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 13099 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 13100 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13101 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 13102 | if [ $FAILS -gt 255 ]; then |
| 13103 | # Clamp at 255 as caller gets exit code & 0xFF |
| 13104 | # (so 256 would be 0, or success, etc) |
| 13105 | FAILS=255 |
| 13106 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13107 | exit $FAILS |