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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 224 | # 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] | 225 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 226 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 227 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 228 | *) SKIP_NEXT="YES";; |
| 229 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 230 | } |
| 231 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 232 | # 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] | 233 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 234 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 235 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 236 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 237 | } |
| 238 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 239 | requires_all_configs_enabled() { |
| 240 | if ! $P_QUERY -all $* |
| 241 | then |
| 242 | SKIP_NEXT="YES" |
| 243 | fi |
| 244 | } |
| 245 | |
| 246 | requires_all_configs_disabled() { |
| 247 | if $P_QUERY -any $* |
| 248 | then |
| 249 | SKIP_NEXT="YES" |
| 250 | fi |
| 251 | } |
| 252 | |
| 253 | requires_any_configs_enabled() { |
| 254 | if ! $P_QUERY -any $* |
| 255 | then |
| 256 | SKIP_NEXT="YES" |
| 257 | fi |
| 258 | } |
| 259 | |
| 260 | requires_any_configs_disabled() { |
| 261 | if $P_QUERY -all $* |
| 262 | then |
| 263 | SKIP_NEXT="YES" |
| 264 | fi |
| 265 | } |
| 266 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 267 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 268 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 269 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 270 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 271 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 272 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 273 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 274 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 275 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 276 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 277 | then |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 278 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 279 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 280 | then |
| 281 | SKIP_NEXT="YES" |
| 282 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 283 | } |
| 284 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 285 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 286 | # This function uses the query_config command line option to query the |
| 287 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 288 | # program. The command will always return a success value if the |
| 289 | # configuration is defined and the value will be printed to stdout. |
| 290 | # |
| 291 | # Note that if the configuration is not defined or is defined to nothing, |
| 292 | # the output of this function will be an empty string. |
| 293 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 297 | VAL="$( get_config_value_or_default "$1" )" |
| 298 | if [ -z "$VAL" ]; then |
| 299 | # Should never happen |
| 300 | echo "Mbed TLS configuration $1 is not defined" |
| 301 | exit 1 |
| 302 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 303 | SKIP_NEXT="YES" |
| 304 | fi |
| 305 | } |
| 306 | |
| 307 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 308 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 309 | if [ -z "$VAL" ]; then |
| 310 | # Should never happen |
| 311 | echo "Mbed TLS configuration $1 is not defined" |
| 312 | exit 1 |
| 313 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 314 | SKIP_NEXT="YES" |
| 315 | fi |
| 316 | } |
| 317 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 318 | requires_config_value_equals() { |
| 319 | VAL=$( get_config_value_or_default "$1" ) |
| 320 | if [ -z "$VAL" ]; then |
| 321 | # Should never happen |
| 322 | echo "Mbed TLS configuration $1 is not defined" |
| 323 | exit 1 |
| 324 | elif [ "$VAL" -ne "$2" ]; then |
| 325 | SKIP_NEXT="YES" |
| 326 | fi |
| 327 | } |
| 328 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 329 | # Require Mbed TLS to support the given protocol version. |
| 330 | # |
| 331 | # Inputs: |
| 332 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 333 | requires_protocol_version() { |
| 334 | # Support for DTLS is detected separately in detect_dtls(). |
| 335 | case "$1" in |
| 336 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 337 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 338 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 339 | esac |
| 340 | } |
| 341 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 342 | # Space-separated list of ciphersuites supported by this build of |
| 343 | # Mbed TLS. |
| 344 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 345 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 346 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 347 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 348 | case $P_CIPHERSUITES in |
| 349 | *" $1 "*) :;; |
| 350 | *) SKIP_NEXT="YES";; |
| 351 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 352 | } |
| 353 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 354 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 355 | # If CMD (call to a TLS client or server program) requires certain features, |
| 356 | # arrange to only run the following test case if those features are enabled. |
| 357 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 358 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 359 | *\ force_version=*) |
| 360 | tmp="${1##*\ force_version=}" |
| 361 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 362 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 363 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 364 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 365 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 366 | *\ force_ciphersuite=*) |
| 367 | tmp="${1##*\ force_ciphersuite=}" |
| 368 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 369 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 370 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 371 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 372 | case " $1 " in |
| 373 | *[-_\ =]tickets=[^0]*) |
| 374 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 375 | esac |
| 376 | case " $1 " in |
| 377 | *[-_\ =]alpn=*) |
| 378 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 379 | esac |
| 380 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 381 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 382 | } |
| 383 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 384 | requires_certificate_authentication () { |
| 385 | if [ "$PSK_ONLY" = "YES" ]; then |
| 386 | SKIP_NEXT="YES" |
| 387 | fi |
| 388 | } |
| 389 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 390 | adapt_cmd_for_psk () { |
| 391 | case "$2" in |
| 392 | *openssl*) s='-psk abc123 -nocert';; |
| 393 | *gnutls-*) s='--pskkey=abc123';; |
| 394 | *) s='psk=abc123';; |
| 395 | esac |
| 396 | eval $1='"$2 $s"' |
| 397 | unset s |
| 398 | } |
| 399 | |
| 400 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 401 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 402 | # |
| 403 | # If not running in a PSK-only build, do nothing. |
| 404 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 405 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 406 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 407 | # a pre-shared key, do nothing. |
| 408 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 409 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 410 | # |
| 411 | # Inputs: |
| 412 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 413 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 414 | # * "$@": options passed to run_test. |
| 415 | # |
| 416 | # Outputs: |
| 417 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 418 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 419 | maybe_adapt_for_psk() { |
| 420 | if [ "$PSK_ONLY" != "YES" ]; then |
| 421 | return |
| 422 | fi |
| 423 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 424 | return |
| 425 | fi |
| 426 | case "$CLI_CMD $SRV_CMD" in |
| 427 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 428 | return;; |
| 429 | *force_ciphersuite*) |
| 430 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 431 | # PSK cipher suite could be substituted, but we're not ready for |
| 432 | # that yet. |
| 433 | SKIP_NEXT="YES" |
| 434 | return;; |
| 435 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 436 | # The test case involves certificates. PSK won't do. |
| 437 | SKIP_NEXT="YES" |
| 438 | return;; |
| 439 | esac |
| 440 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 441 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 442 | } |
| 443 | |
| 444 | case " $CONFIGS_ENABLED " in |
| 445 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 446 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 447 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 448 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 449 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 450 | *) PSK_ONLY="NO";; |
| 451 | esac |
| 452 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 453 | HAS_ALG_SHA_1="NO" |
| 454 | HAS_ALG_SHA_224="NO" |
| 455 | HAS_ALG_SHA_256="NO" |
| 456 | HAS_ALG_SHA_384="NO" |
| 457 | HAS_ALG_SHA_512="NO" |
| 458 | |
| 459 | check_for_hash_alg() |
| 460 | { |
| 461 | CURR_ALG="INVALID"; |
| 462 | USE_PSA="NO" |
| 463 | case $CONFIGS_ENABLED in |
| 464 | *" MBEDTLS_USE_PSA_CRYPTO"[\ =]*) |
| 465 | USE_PSA="YES"; |
| 466 | ;; |
| 467 | *) :;; |
| 468 | esac |
| 469 | if [ $USE_PSA = "YES" ]; then |
| 470 | CURR_ALG=PSA_WANT_ALG_${1} |
| 471 | else |
| 472 | CURR_ALG=MBEDTLS_${1}_C |
| 473 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 474 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 475 | fi |
| 476 | |
| 477 | case $CONFIGS_ENABLED in |
| 478 | *" $CURR_ALG"[\ =]*) |
| 479 | return 0 |
| 480 | ;; |
| 481 | *) :;; |
| 482 | esac |
| 483 | return 1 |
| 484 | } |
| 485 | |
| 486 | populate_enabled_hash_algs() |
| 487 | { |
| 488 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 489 | if check_for_hash_alg "$hash_alg"; then |
| 490 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 491 | eval ${hash_alg_variable}=YES |
| 492 | fi |
| 493 | done |
| 494 | } |
| 495 | |
| 496 | # skip next test if the given hash alg is not supported |
| 497 | requires_hash_alg() { |
| 498 | HASH_DEFINE="Invalid" |
| 499 | HAS_HASH_ALG="NO" |
| 500 | case $1 in |
| 501 | SHA_1):;; |
| 502 | SHA_224):;; |
| 503 | SHA_256):;; |
| 504 | SHA_384):;; |
| 505 | SHA_512):;; |
| 506 | *) |
| 507 | echo "Unsupported hash alg - $1" |
| 508 | exit 1 |
| 509 | ;; |
| 510 | esac |
| 511 | |
| 512 | HASH_DEFINE=HAS_ALG_${1} |
| 513 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 514 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 515 | then |
| 516 | SKIP_NEXT="YES" |
| 517 | fi |
| 518 | } |
| 519 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 520 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 521 | requires_openssl_with_fallback_scsv() { |
| 522 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 523 | 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] | 524 | then |
| 525 | OPENSSL_HAS_FBSCSV="YES" |
| 526 | else |
| 527 | OPENSSL_HAS_FBSCSV="NO" |
| 528 | fi |
| 529 | fi |
| 530 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 531 | SKIP_NEXT="YES" |
| 532 | fi |
| 533 | } |
| 534 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 535 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 536 | requires_max_content_len() { |
| 537 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 538 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 539 | } |
| 540 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 541 | # skip next test if GnuTLS isn't available |
| 542 | requires_gnutls() { |
| 543 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 544 | 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] | 545 | GNUTLS_AVAILABLE="YES" |
| 546 | else |
| 547 | GNUTLS_AVAILABLE="NO" |
| 548 | fi |
| 549 | fi |
| 550 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 551 | SKIP_NEXT="YES" |
| 552 | fi |
| 553 | } |
| 554 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 555 | # skip next test if GnuTLS-next isn't available |
| 556 | requires_gnutls_next() { |
| 557 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 558 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 559 | GNUTLS_NEXT_AVAILABLE="YES" |
| 560 | else |
| 561 | GNUTLS_NEXT_AVAILABLE="NO" |
| 562 | fi |
| 563 | fi |
| 564 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 565 | SKIP_NEXT="YES" |
| 566 | fi |
| 567 | } |
| 568 | |
| 569 | # skip next test if OpenSSL-legacy isn't available |
| 570 | requires_openssl_legacy() { |
| 571 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 572 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 573 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 574 | else |
| 575 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 576 | fi |
| 577 | fi |
| 578 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 579 | SKIP_NEXT="YES" |
| 580 | fi |
| 581 | } |
| 582 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 583 | requires_openssl_next() { |
| 584 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 585 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 586 | OPENSSL_NEXT_AVAILABLE="YES" |
| 587 | else |
| 588 | OPENSSL_NEXT_AVAILABLE="NO" |
| 589 | fi |
| 590 | fi |
| 591 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 592 | SKIP_NEXT="YES" |
| 593 | fi |
| 594 | } |
| 595 | |
| 596 | # skip next test if tls1_3 is not available |
| 597 | requires_openssl_tls1_3() { |
| 598 | requires_openssl_next |
| 599 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 600 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 601 | fi |
| 602 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 603 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 604 | then |
| 605 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 606 | else |
| 607 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 608 | fi |
| 609 | fi |
| 610 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 611 | SKIP_NEXT="YES" |
| 612 | fi |
| 613 | } |
| 614 | |
| 615 | # skip next test if tls1_3 is not available |
| 616 | requires_gnutls_tls1_3() { |
| 617 | requires_gnutls_next |
| 618 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 619 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 620 | fi |
| 621 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 622 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 623 | then |
| 624 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 625 | else |
| 626 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 627 | fi |
| 628 | fi |
| 629 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 630 | SKIP_NEXT="YES" |
| 631 | fi |
| 632 | } |
| 633 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 634 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 635 | requires_gnutls_next_no_ticket() { |
| 636 | requires_gnutls_next |
| 637 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 638 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 639 | fi |
| 640 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 641 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 642 | then |
| 643 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 644 | else |
| 645 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 646 | fi |
| 647 | fi |
| 648 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 649 | SKIP_NEXT="YES" |
| 650 | fi |
| 651 | } |
| 652 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 653 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 654 | requires_gnutls_next_disable_tls13_compat() { |
| 655 | requires_gnutls_next |
| 656 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 657 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 658 | fi |
| 659 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 660 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 661 | then |
| 662 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 663 | else |
| 664 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 665 | fi |
| 666 | fi |
| 667 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 668 | SKIP_NEXT="YES" |
| 669 | fi |
| 670 | } |
| 671 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 672 | # skip next test if GnuTLS does not support the record size limit extension |
| 673 | requires_gnutls_record_size_limit() { |
| 674 | requires_gnutls_next |
| 675 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 676 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 677 | else |
| 678 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 679 | fi |
| 680 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 681 | SKIP_NEXT="YES" |
| 682 | fi |
| 683 | } |
| 684 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 685 | # skip next test if IPv6 isn't available on this host |
| 686 | requires_ipv6() { |
| 687 | if [ -z "${HAS_IPV6:-}" ]; then |
| 688 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 689 | SRV_PID=$! |
| 690 | sleep 1 |
| 691 | kill $SRV_PID >/dev/null 2>&1 |
| 692 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 693 | HAS_IPV6="NO" |
| 694 | else |
| 695 | HAS_IPV6="YES" |
| 696 | fi |
| 697 | rm -r $SRV_OUT |
| 698 | fi |
| 699 | |
| 700 | if [ "$HAS_IPV6" = "NO" ]; then |
| 701 | SKIP_NEXT="YES" |
| 702 | fi |
| 703 | } |
| 704 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 705 | # skip next test if it's i686 or uname is not available |
| 706 | requires_not_i686() { |
| 707 | if [ -z "${IS_I686:-}" ]; then |
| 708 | IS_I686="YES" |
| 709 | if which "uname" >/dev/null 2>&1; then |
| 710 | if [ -z "$(uname -a | grep i686)" ]; then |
| 711 | IS_I686="NO" |
| 712 | fi |
| 713 | fi |
| 714 | fi |
| 715 | if [ "$IS_I686" = "YES" ]; then |
| 716 | SKIP_NEXT="YES" |
| 717 | fi |
| 718 | } |
| 719 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 720 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 721 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 722 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 723 | 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] | 724 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 725 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 726 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 727 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 728 | fi |
| 729 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 730 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 731 | fi |
| 732 | |
| 733 | # skip the next test if the SSL output buffer is less than 16KB |
| 734 | requires_full_size_output_buffer() { |
| 735 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 736 | SKIP_NEXT="YES" |
| 737 | fi |
| 738 | } |
| 739 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 740 | # skip the next test if valgrind is in use |
| 741 | not_with_valgrind() { |
| 742 | if [ "$MEMCHECK" -gt 0 ]; then |
| 743 | SKIP_NEXT="YES" |
| 744 | fi |
| 745 | } |
| 746 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 747 | # skip the next test if valgrind is NOT in use |
| 748 | only_with_valgrind() { |
| 749 | if [ "$MEMCHECK" -eq 0 ]; then |
| 750 | SKIP_NEXT="YES" |
| 751 | fi |
| 752 | } |
| 753 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 754 | # 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] | 755 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 756 | CLI_DELAY_FACTOR=$1 |
| 757 | } |
| 758 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 759 | # wait for the given seconds after the client finished in the next test |
| 760 | server_needs_more_time() { |
| 761 | SRV_DELAY_SECONDS=$1 |
| 762 | } |
| 763 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 764 | # print_name <name> |
| 765 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 766 | TESTS=$(( $TESTS + 1 )) |
| 767 | LINE="" |
| 768 | |
| 769 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 770 | LINE="$TESTS " |
| 771 | fi |
| 772 | |
| 773 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 774 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 775 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 776 | for i in `seq 1 $LEN`; do printf '.'; done |
| 777 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 778 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 779 | } |
| 780 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 781 | # record_outcome <outcome> [<failure-reason>] |
| 782 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 783 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 784 | record_outcome() { |
| 785 | echo "$1" |
| 786 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 787 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 788 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 789 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 790 | "$1" "${2-}" \ |
| 791 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 792 | fi |
| 793 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 794 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 795 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 796 | # True if the presence of the given pattern in a log definitely indicates |
| 797 | # that the test has failed. False if the presence is inconclusive. |
| 798 | # |
| 799 | # Inputs: |
| 800 | # * $1: pattern found in the logs |
| 801 | # * $TIMES_LEFT: >0 if retrying is an option |
| 802 | # |
| 803 | # Outputs: |
| 804 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 805 | # unchanged otherwise. |
| 806 | # * Return value: 1 if the pattern is inconclusive, |
| 807 | # 0 if the failure is definitive. |
| 808 | log_pattern_presence_is_conclusive() { |
| 809 | # If we've run out of attempts, then don't retry no matter what. |
| 810 | if [ $TIMES_LEFT -eq 0 ]; then |
| 811 | return 0 |
| 812 | fi |
| 813 | case $1 in |
| 814 | "resend") |
| 815 | # An undesired resend may have been caused by the OS dropping or |
| 816 | # delaying a packet at an inopportune time. |
| 817 | outcome="RETRY(resend)" |
| 818 | return 1;; |
| 819 | esac |
| 820 | } |
| 821 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 822 | # fail <message> |
| 823 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 824 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 825 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 826 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 827 | mv $SRV_OUT o-srv-${TESTS}.log |
| 828 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 829 | if [ -n "$PXY_CMD" ]; then |
| 830 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 831 | fi |
| 832 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 833 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 834 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 835 | echo " ! server output:" |
| 836 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 837 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 838 | echo " ! client output:" |
| 839 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 840 | if [ -n "$PXY_CMD" ]; then |
| 841 | echo " ! ========================================================" |
| 842 | echo " ! proxy output:" |
| 843 | cat o-pxy-${TESTS}.log |
| 844 | fi |
| 845 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 846 | fi |
| 847 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 848 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 849 | } |
| 850 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 851 | # is_polar <cmd_line> |
| 852 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 853 | case "$1" in |
| 854 | *ssl_client2*) true;; |
| 855 | *ssl_server2*) true;; |
| 856 | *) false;; |
| 857 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 858 | } |
| 859 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 860 | # openssl s_server doesn't have -www with DTLS |
| 861 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 862 | case "$SRV_CMD" in |
| 863 | *s_server*-dtls*) |
| 864 | NEEDS_INPUT=1 |
| 865 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 866 | *) NEEDS_INPUT=0;; |
| 867 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 868 | } |
| 869 | |
| 870 | # provide input to commands that need it |
| 871 | provide_input() { |
| 872 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 873 | return |
| 874 | fi |
| 875 | |
| 876 | while true; do |
| 877 | echo "HTTP/1.0 200 OK" |
| 878 | sleep 1 |
| 879 | done |
| 880 | } |
| 881 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 882 | # has_mem_err <log_file_name> |
| 883 | has_mem_err() { |
| 884 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 885 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 886 | then |
| 887 | return 1 # false: does not have errors |
| 888 | else |
| 889 | return 0 # true: has errors |
| 890 | fi |
| 891 | } |
| 892 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 893 | # 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] | 894 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 895 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 896 | newline=' |
| 897 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 898 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 899 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 900 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 901 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 902 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 903 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 904 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 905 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 906 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 907 | # When we use a proxy, it will be listening on the same port we |
| 908 | # 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] | 909 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 910 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 911 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 912 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 913 | echo "$3 START TIMEOUT" |
| 914 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 915 | break |
| 916 | fi |
| 917 | # Linux and *BSD support decimal arguments to sleep. On other |
| 918 | # OSes this may be a tight loop. |
| 919 | sleep 0.1 2>/dev/null || true |
| 920 | done |
| 921 | } |
| 922 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 923 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 924 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 925 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 926 | } |
| 927 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 928 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 929 | # Wait for server process $2 to be listening on port $1. |
| 930 | wait_server_start() { |
| 931 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 932 | } |
| 933 | |
| 934 | # Wait for proxy process $2 to be listening on port $1. |
| 935 | wait_proxy_start() { |
| 936 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 937 | } |
| 938 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 939 | # 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] | 940 | # 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] | 941 | # acceptable bounds |
| 942 | check_server_hello_time() { |
| 943 | # 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] | 944 | 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] | 945 | # Get the Unix timestamp for now |
| 946 | CUR_TIME=$(date +'%s') |
| 947 | THRESHOLD_IN_SECS=300 |
| 948 | |
| 949 | # Check if the ServerHello time was printed |
| 950 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 951 | return 1 |
| 952 | fi |
| 953 | |
| 954 | # Check the time in ServerHello is within acceptable bounds |
| 955 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 956 | # The time in ServerHello is at least 5 minutes before now |
| 957 | return 1 |
| 958 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 959 | # 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] | 960 | return 1 |
| 961 | else |
| 962 | return 0 |
| 963 | fi |
| 964 | } |
| 965 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 966 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 967 | handshake_memory_get() { |
| 968 | OUTPUT_VARIABLE="$1" |
| 969 | OUTPUT_FILE="$2" |
| 970 | |
| 971 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 972 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 973 | |
| 974 | # Check if memory usage was read |
| 975 | if [ -z "$MEM_USAGE" ]; then |
| 976 | echo "Error: Can not read the value of handshake memory usage" |
| 977 | return 1 |
| 978 | else |
| 979 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 980 | return 0 |
| 981 | fi |
| 982 | } |
| 983 | |
| 984 | # Get handshake memory usage from server or client output and check if this value |
| 985 | # is not higher than the maximum given by the first argument |
| 986 | handshake_memory_check() { |
| 987 | MAX_MEMORY="$1" |
| 988 | OUTPUT_FILE="$2" |
| 989 | |
| 990 | # Get memory usage |
| 991 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 992 | return 1 |
| 993 | fi |
| 994 | |
| 995 | # Check if memory usage is below max value |
| 996 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 997 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 998 | "but should be below $MAX_MEMORY bytes" |
| 999 | return 1 |
| 1000 | else |
| 1001 | return 0 |
| 1002 | fi |
| 1003 | } |
| 1004 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1005 | # wait for client to terminate and set CLI_EXIT |
| 1006 | # must be called right after starting the client |
| 1007 | wait_client_done() { |
| 1008 | CLI_PID=$! |
| 1009 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1010 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1011 | CLI_DELAY_FACTOR=1 |
| 1012 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1013 | ( 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] | 1014 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1015 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1016 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1017 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1018 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1019 | CLI_EXIT=$? |
| 1020 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1021 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1022 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1023 | |
| 1024 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1025 | |
| 1026 | sleep $SRV_DELAY_SECONDS |
| 1027 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1028 | } |
| 1029 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1030 | # check if the given command uses dtls and sets global variable DTLS |
| 1031 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1032 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1033 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1034 | *) DTLS=0;; |
| 1035 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1036 | } |
| 1037 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1038 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1039 | is_gnutls() { |
| 1040 | case "$1" in |
| 1041 | *gnutls-cli*) |
| 1042 | CMD_IS_GNUTLS=1 |
| 1043 | ;; |
| 1044 | *gnutls-serv*) |
| 1045 | CMD_IS_GNUTLS=1 |
| 1046 | ;; |
| 1047 | *) |
| 1048 | CMD_IS_GNUTLS=0 |
| 1049 | ;; |
| 1050 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1051 | } |
| 1052 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1053 | # Generate random psk_list argument for ssl_server2 |
| 1054 | get_srv_psk_list () |
| 1055 | { |
| 1056 | case $(( TESTS % 3 )) in |
| 1057 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1058 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1059 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1060 | esac |
| 1061 | } |
| 1062 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1063 | # Determine what calc_verify trace is to be expected, if any. |
| 1064 | # |
| 1065 | # calc_verify is only called for two things: to calculate the |
| 1066 | # extended master secret, and to process client authentication. |
| 1067 | # |
| 1068 | # Warning: the current implementation assumes that extended_ms is not |
| 1069 | # disabled on the client or on the server. |
| 1070 | # |
| 1071 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1072 | # * $1: the value of the server auth_mode parameter. |
| 1073 | # 'required' if client authentication is expected, |
| 1074 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1075 | # * $CONFIGS_ENABLED |
| 1076 | # |
| 1077 | # Outputs: |
| 1078 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1079 | set_maybe_calc_verify() { |
| 1080 | maybe_calc_verify= |
| 1081 | case $CONFIGS_ENABLED in |
| 1082 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1083 | *) |
| 1084 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1085 | ''|none) return;; |
| 1086 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1087 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1088 | esac |
| 1089 | esac |
| 1090 | case $CONFIGS_ENABLED in |
| 1091 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1092 | *) maybe_calc_verify="<= calc verify";; |
| 1093 | esac |
| 1094 | } |
| 1095 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1096 | # Compare file content |
| 1097 | # Usage: find_in_both pattern file1 file2 |
| 1098 | # extract from file1 the first line matching the pattern |
| 1099 | # check in file2 that the same line can be found |
| 1100 | find_in_both() { |
| 1101 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1102 | if [ -z "$srv_pattern" ]; then |
| 1103 | return 1; |
| 1104 | fi |
| 1105 | |
| 1106 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1107 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1108 | else |
| 1109 | return 1; |
| 1110 | fi |
| 1111 | } |
| 1112 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1113 | SKIP_HANDSHAKE_CHECK="NO" |
| 1114 | skip_handshake_stage_check() { |
| 1115 | SKIP_HANDSHAKE_CHECK="YES" |
| 1116 | } |
| 1117 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1118 | # Analyze the commands that will be used in a test. |
| 1119 | # |
| 1120 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1121 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1122 | # |
| 1123 | # Inputs: |
| 1124 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1125 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1126 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1127 | # |
| 1128 | # Outputs: |
| 1129 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1130 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1131 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1132 | # 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] | 1133 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1134 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1135 | case " $SRV_CMD " in |
| 1136 | *' server_addr=::1 '*) |
| 1137 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1138 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1139 | fi |
| 1140 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1141 | # update CMD_IS_GNUTLS variable |
| 1142 | is_gnutls "$SRV_CMD" |
| 1143 | |
| 1144 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1145 | # set the default priority |
| 1146 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1147 | case "$SRV_CMD" in |
| 1148 | *--priority*) :;; |
| 1149 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1150 | esac |
| 1151 | fi |
| 1152 | |
| 1153 | # update CMD_IS_GNUTLS variable |
| 1154 | is_gnutls "$CLI_CMD" |
| 1155 | |
| 1156 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1157 | # set the default priority |
| 1158 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1159 | case "$CLI_CMD" in |
| 1160 | *--priority*) :;; |
| 1161 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1162 | esac |
| 1163 | fi |
| 1164 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1165 | # fix client port |
| 1166 | if [ -n "$PXY_CMD" ]; then |
| 1167 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1168 | else |
| 1169 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1170 | fi |
| 1171 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1172 | # prepend valgrind to our commands if active |
| 1173 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1174 | if is_polar "$SRV_CMD"; then |
| 1175 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1176 | fi |
| 1177 | if is_polar "$CLI_CMD"; then |
| 1178 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1179 | fi |
| 1180 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1181 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1182 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1183 | # Check for failure conditions after a test case. |
| 1184 | # |
| 1185 | # Inputs from run_test: |
| 1186 | # * positional parameters: test options (see run_test documentation) |
| 1187 | # * $CLI_EXIT: client return code |
| 1188 | # * $CLI_EXPECT: expected client return code |
| 1189 | # * $SRV_RET: server return code |
| 1190 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1191 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1192 | # |
| 1193 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1194 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1195 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1196 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1197 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1198 | if [ $TIMES_LEFT -gt 0 ] && |
| 1199 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1200 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1201 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1202 | return |
| 1203 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1204 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1205 | # 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] | 1206 | # (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] | 1207 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1208 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1209 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1210 | then |
| 1211 | if is_polar "$SRV_CMD"; then |
| 1212 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1213 | else |
| 1214 | fail "server or client failed to reach handshake stage" |
| 1215 | return |
| 1216 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1217 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1218 | if is_polar "$CLI_CMD"; then |
| 1219 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1220 | else |
| 1221 | fail "server or client failed to reach handshake stage" |
| 1222 | return |
| 1223 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1224 | fi |
| 1225 | fi |
| 1226 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1227 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1228 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1229 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1230 | # care anyway), in case e.g. the server reports a memory leak. |
| 1231 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1232 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1233 | return |
| 1234 | fi |
| 1235 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1236 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1237 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1238 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1239 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1240 | 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] | 1241 | return |
| 1242 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1243 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1244 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1245 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1246 | # 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] | 1247 | while [ $# -gt 0 ] |
| 1248 | do |
| 1249 | case $1 in |
| 1250 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1251 | 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] | 1252 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1253 | return |
| 1254 | fi |
| 1255 | ;; |
| 1256 | |
| 1257 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1258 | 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] | 1259 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1260 | return |
| 1261 | fi |
| 1262 | ;; |
| 1263 | |
| 1264 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1265 | 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] | 1266 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1267 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1268 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1269 | return |
| 1270 | fi |
| 1271 | ;; |
| 1272 | |
| 1273 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1274 | 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] | 1275 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1276 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1277 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1278 | return |
| 1279 | fi |
| 1280 | ;; |
| 1281 | |
| 1282 | # The filtering in the following two options (-u and -U) do the following |
| 1283 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1284 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1285 | # - keep one of each non-unique line |
| 1286 | # - count how many lines remain |
| 1287 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1288 | # if there were no duplicates. |
| 1289 | "-U") |
| 1290 | 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 |
| 1291 | fail "lines following pattern '$2' must be unique in Server output" |
| 1292 | return |
| 1293 | fi |
| 1294 | ;; |
| 1295 | |
| 1296 | "-u") |
| 1297 | 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 |
| 1298 | 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] | 1299 | return |
| 1300 | fi |
| 1301 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1302 | "-F") |
| 1303 | if ! $2 "$SRV_OUT"; then |
| 1304 | fail "function call to '$2' failed on Server output" |
| 1305 | return |
| 1306 | fi |
| 1307 | ;; |
| 1308 | "-f") |
| 1309 | if ! $2 "$CLI_OUT"; then |
| 1310 | fail "function call to '$2' failed on Client output" |
| 1311 | return |
| 1312 | fi |
| 1313 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1314 | "-g") |
| 1315 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1316 | fail "function call to '$2' failed on Server and Client output" |
| 1317 | return |
| 1318 | fi |
| 1319 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1320 | |
| 1321 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1322 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1323 | exit 1 |
| 1324 | esac |
| 1325 | shift 2 |
| 1326 | done |
| 1327 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1328 | # check valgrind's results |
| 1329 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1330 | 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] | 1331 | fail "Server has memory errors" |
| 1332 | return |
| 1333 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1334 | 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] | 1335 | fail "Client has memory errors" |
| 1336 | return |
| 1337 | fi |
| 1338 | fi |
| 1339 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1340 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1341 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1342 | } |
| 1343 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1344 | # Run the current test case: start the server and if applicable the proxy, run |
| 1345 | # the client, wait for all processes to finish or time out. |
| 1346 | # |
| 1347 | # Inputs: |
| 1348 | # * $NAME: test case name |
| 1349 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1350 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1351 | # |
| 1352 | # Outputs: |
| 1353 | # * $CLI_EXIT: client return code |
| 1354 | # * $SRV_RET: server return code |
| 1355 | do_run_test_once() { |
| 1356 | # run the commands |
| 1357 | if [ -n "$PXY_CMD" ]; then |
| 1358 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1359 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1360 | PXY_PID=$! |
| 1361 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1362 | fi |
| 1363 | |
| 1364 | check_osrv_dtls |
| 1365 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1366 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1367 | SRV_PID=$! |
| 1368 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1369 | |
| 1370 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1371 | # The client must be a subprocess of the script in order for killing it to |
| 1372 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1373 | # not at the end of the line: the latter approach will spawn eval as a |
| 1374 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1375 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1376 | wait_client_done |
| 1377 | |
| 1378 | sleep 0.05 |
| 1379 | |
| 1380 | # terminate the server (and the proxy) |
| 1381 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1382 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1383 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1384 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1385 | SRV_RET=$? |
| 1386 | |
| 1387 | if [ -n "$PXY_CMD" ]; then |
| 1388 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1389 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1390 | fi |
| 1391 | } |
| 1392 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1393 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1394 | # Options: -s pattern pattern that must be present in server output |
| 1395 | # -c pattern pattern that must be present in client output |
| 1396 | # -u pattern lines after pattern must be unique in client output |
| 1397 | # -f call shell function on client output |
| 1398 | # -S pattern pattern that must be absent in server output |
| 1399 | # -C pattern pattern that must be absent in client output |
| 1400 | # -U pattern lines after pattern must be unique in server output |
| 1401 | # -F call shell function on server output |
| 1402 | # -g call shell function on server and client output |
| 1403 | run_test() { |
| 1404 | NAME="$1" |
| 1405 | shift 1 |
| 1406 | |
| 1407 | if is_excluded "$NAME"; then |
| 1408 | SKIP_NEXT="NO" |
| 1409 | # There was no request to run the test, so don't record its outcome. |
| 1410 | return |
| 1411 | fi |
| 1412 | |
| 1413 | print_name "$NAME" |
| 1414 | |
| 1415 | # Do we only run numbered tests? |
| 1416 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1417 | case ",$RUN_TEST_NUMBER," in |
| 1418 | *",$TESTS,"*) :;; |
| 1419 | *) SKIP_NEXT="YES";; |
| 1420 | esac |
| 1421 | fi |
| 1422 | |
| 1423 | # does this test use a proxy? |
| 1424 | if [ "X$1" = "X-p" ]; then |
| 1425 | PXY_CMD="$2" |
| 1426 | shift 2 |
| 1427 | else |
| 1428 | PXY_CMD="" |
| 1429 | fi |
| 1430 | |
| 1431 | # get commands and client output |
| 1432 | SRV_CMD="$1" |
| 1433 | CLI_CMD="$2" |
| 1434 | CLI_EXPECT="$3" |
| 1435 | shift 3 |
| 1436 | |
| 1437 | # Check if test uses files |
| 1438 | case "$SRV_CMD $CLI_CMD" in |
| 1439 | *data_files/*) |
| 1440 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1441 | esac |
| 1442 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1443 | # Check if the test uses DTLS. |
| 1444 | detect_dtls "$SRV_CMD" |
| 1445 | if [ "$DTLS" -eq 1 ]; then |
| 1446 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1447 | fi |
| 1448 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1449 | # If the client or server requires certain features that can be detected |
| 1450 | # from their command-line arguments, check that they're enabled. |
| 1451 | detect_required_features "$SRV_CMD" "$@" |
| 1452 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1453 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1454 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1455 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1456 | |
| 1457 | # should we skip? |
| 1458 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1459 | SKIP_NEXT="NO" |
| 1460 | record_outcome "SKIP" |
| 1461 | SKIPS=$(( $SKIPS + 1 )) |
| 1462 | return |
| 1463 | fi |
| 1464 | |
| 1465 | analyze_test_commands "$@" |
| 1466 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1467 | # One regular run and two retries |
| 1468 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1469 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1470 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1471 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1472 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1473 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1474 | check_test_failure "$@" |
| 1475 | case $outcome in |
| 1476 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1477 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1478 | FAIL) return;; |
| 1479 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1480 | done |
| 1481 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1482 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1483 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1484 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1485 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1486 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1487 | if [ -n "$PXY_CMD" ]; then |
| 1488 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1489 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1490 | fi |
| 1491 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1492 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1493 | } |
| 1494 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1495 | run_test_psa() { |
| 1496 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1497 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1498 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1499 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1500 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1501 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1502 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1503 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1504 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1505 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1506 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1507 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1508 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1509 | -S "error" \ |
| 1510 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1511 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1512 | } |
| 1513 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1514 | run_test_psa_force_curve() { |
| 1515 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1516 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1517 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1518 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1519 | "$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] | 1520 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1521 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1522 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1523 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1524 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1525 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1526 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1527 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1528 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1529 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1530 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1531 | } |
| 1532 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1533 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1534 | # a maximum fragment length. |
| 1535 | # first argument ($1) is MFL for SSL client |
| 1536 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1537 | run_test_memory_after_hanshake_with_mfl() |
| 1538 | { |
| 1539 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1540 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1541 | |
| 1542 | # Leave some margin for robustness |
| 1543 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1544 | |
| 1545 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1546 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1547 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1548 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1549 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1550 | 0 \ |
| 1551 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1552 | } |
| 1553 | |
| 1554 | |
| 1555 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1556 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1557 | run_tests_memory_after_hanshake() |
| 1558 | { |
| 1559 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1560 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1561 | |
| 1562 | # first test with default MFU is to get reference memory usage |
| 1563 | MEMORY_USAGE_MFL_16K=0 |
| 1564 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1565 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1566 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1567 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1568 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1569 | 0 \ |
| 1570 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1571 | |
| 1572 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1573 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1574 | |
| 1575 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1576 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1577 | |
| 1578 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1579 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1580 | |
| 1581 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1582 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1583 | } |
| 1584 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1585 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1586 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1587 | rm -f context_srv.txt |
| 1588 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1589 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1590 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1591 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1592 | 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] | 1593 | exit 1 |
| 1594 | } |
| 1595 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1596 | # |
| 1597 | # MAIN |
| 1598 | # |
| 1599 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1600 | get_options "$@" |
| 1601 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1602 | populate_enabled_hash_algs |
| 1603 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1604 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1605 | # patterns rather than regular expressions, use a case statement instead |
| 1606 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1607 | # detects simple cases: plain substring, everything, nothing. |
| 1608 | # |
| 1609 | # As an exception, the character '.' is treated as an ordinary character |
| 1610 | # if it is the only special character in the string. This is because it's |
| 1611 | # rare to need "any one character", but needing a literal '.' is common |
| 1612 | # (e.g. '-f "DTLS 1.2"'). |
| 1613 | need_grep= |
| 1614 | case "$FILTER" in |
| 1615 | '^$') simple_filter=;; |
| 1616 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1617 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1618 | need_grep=1;; |
| 1619 | *) # No regexp or shell-pattern special character |
| 1620 | simple_filter="*$FILTER*";; |
| 1621 | esac |
| 1622 | case "$EXCLUDE" in |
| 1623 | '^$') simple_exclude=;; |
| 1624 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1625 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1626 | need_grep=1;; |
| 1627 | *) # No regexp or shell-pattern special character |
| 1628 | simple_exclude="*$EXCLUDE*";; |
| 1629 | esac |
| 1630 | if [ -n "$need_grep" ]; then |
| 1631 | is_excluded () { |
| 1632 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1633 | } |
| 1634 | else |
| 1635 | is_excluded () { |
| 1636 | case "$1" in |
| 1637 | $simple_exclude) true;; |
| 1638 | $simple_filter) false;; |
| 1639 | *) true;; |
| 1640 | esac |
| 1641 | } |
| 1642 | fi |
| 1643 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1644 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1645 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1646 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1647 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1648 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1649 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1650 | exit 1 |
| 1651 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1652 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1653 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1654 | exit 1 |
| 1655 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1656 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1657 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1658 | exit 1 |
| 1659 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1660 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1661 | if which valgrind >/dev/null 2>&1; then :; else |
| 1662 | echo "Memcheck not possible. Valgrind not found" |
| 1663 | exit 1 |
| 1664 | fi |
| 1665 | fi |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 1666 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1667 | echo "Command '$OPENSSL' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1668 | exit 1 |
| 1669 | fi |
| 1670 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1671 | # used by watchdog |
| 1672 | MAIN_PID="$$" |
| 1673 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1674 | # We use somewhat arbitrary delays for tests: |
| 1675 | # - how long do we wait for the server to start (when lsof not available)? |
| 1676 | # - how long do we allow for the client to finish? |
| 1677 | # (not to check performance, just to avoid waiting indefinitely) |
| 1678 | # Things are slower with valgrind, so give extra time here. |
| 1679 | # |
| 1680 | # Note: without lsof, there is a trade-off between the running time of this |
| 1681 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1682 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1683 | # 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] | 1684 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1685 | START_DELAY=6 |
| 1686 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1687 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1688 | START_DELAY=2 |
| 1689 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1690 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1691 | |
| 1692 | # some particular tests need more time: |
| 1693 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1694 | # - for the server, we sleep for a number of seconds after the client exits |
| 1695 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1696 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1697 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1698 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1699 | # 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] | 1700 | # +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] | 1701 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1702 | # 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] | 1703 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1704 | 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] | 1705 | 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] | 1706 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1707 | 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] | 1708 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1709 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1710 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1711 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1712 | 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] | 1713 | 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] | 1714 | fi |
| 1715 | |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1716 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 1717 | # low-security ones. This covers not just cipher suites but also protocol |
| 1718 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 1719 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 1720 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 1721 | # 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] | 1722 | case $($OPENSSL version) in |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1723 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 1724 | *) |
| 1725 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 1726 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 1727 | ;; |
| 1728 | esac |
| 1729 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1730 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1731 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1732 | 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] | 1733 | 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] | 1734 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1735 | 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] | 1736 | fi |
| 1737 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1738 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1739 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1740 | 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] | 1741 | fi |
| 1742 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1743 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1744 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1745 | 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] | 1746 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1747 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1748 | # Allow SHA-1, because many of our test certificates use it |
| 1749 | P_SRV="$P_SRV allow_sha1=1" |
| 1750 | P_CLI="$P_CLI allow_sha1=1" |
| 1751 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1752 | # Also pick a unique name for intermediate files |
| 1753 | SRV_OUT="srv_out.$$" |
| 1754 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1755 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1756 | SESSION="session.$$" |
| 1757 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1758 | SKIP_NEXT="NO" |
| 1759 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1760 | trap cleanup INT TERM HUP |
| 1761 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1762 | # Basic test |
| 1763 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1764 | # Checks that: |
| 1765 | # - 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] | 1766 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1768 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1769 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1770 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1771 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1772 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1773 | "$P_CLI" \ |
| 1774 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1775 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1776 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1777 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1778 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1779 | -S "error" \ |
| 1780 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1781 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1783 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1784 | run_test "Default, DTLS" \ |
| 1785 | "$P_SRV dtls=1" \ |
| 1786 | "$P_CLI dtls=1" \ |
| 1787 | 0 \ |
| 1788 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1789 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1790 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1792 | run_test "TLS client auth: required" \ |
| 1793 | "$P_SRV auth_mode=required" \ |
| 1794 | "$P_CLI" \ |
| 1795 | 0 \ |
| 1796 | -s "Verifying peer X.509 certificate... ok" |
| 1797 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1799 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1800 | "$P_SRV" \ |
| 1801 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1802 | 0 \ |
| 1803 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1804 | -c "Key size is 256" |
| 1805 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1807 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1808 | "$P_SRV" \ |
| 1809 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1810 | 0 \ |
| 1811 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1812 | -c "Key size is 128" |
| 1813 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1815 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1816 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1817 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1818 | run_test "TLS: password protected client key" \ |
| 1819 | "$P_SRV auth_mode=required" \ |
| 1820 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1821 | 0 |
| 1822 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1824 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1825 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1826 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1827 | run_test "TLS: password protected server key" \ |
| 1828 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1829 | "$P_CLI" \ |
| 1830 | 0 |
| 1831 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1833 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1834 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1835 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1836 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1837 | run_test "TLS: password protected server key, two certificates" \ |
| 1838 | "$P_SRV \ |
| 1839 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1840 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1841 | "$P_CLI" \ |
| 1842 | 0 |
| 1843 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1845 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1846 | run_test "CA callback on client" \ |
| 1847 | "$P_SRV debug_level=3" \ |
| 1848 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1849 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1850 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1851 | -S "error" \ |
| 1852 | -C "error" |
| 1853 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1855 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1856 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1857 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1858 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1859 | run_test "CA callback on server" \ |
| 1860 | "$P_SRV auth_mode=required" \ |
| 1861 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1862 | key_file=data_files/server5.key" \ |
| 1863 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1864 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1865 | -s "Verifying peer X.509 certificate... ok" \ |
| 1866 | -S "error" \ |
| 1867 | -C "error" |
| 1868 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1869 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1871 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1872 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1873 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1874 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1875 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1876 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1877 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1878 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1879 | 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] | 1880 | 0 \ |
| 1881 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1882 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1883 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1884 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1885 | -S "error" \ |
| 1886 | -C "error" |
| 1887 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1888 | # Test using a RSA opaque private key for client authentication |
| 1889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1890 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1891 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1892 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1893 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1894 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1895 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1896 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1897 | key_file=data_files/server2.key" \ |
| 1898 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1899 | 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] | 1900 | 0 \ |
| 1901 | -c "key type: Opaque" \ |
| 1902 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1903 | -s "Verifying peer X.509 certificate... ok" \ |
| 1904 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1905 | -S "error" \ |
| 1906 | -C "error" |
| 1907 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1909 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1910 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1911 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1912 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1913 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1914 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1915 | key_file=data_files/server2.key" \ |
| 1916 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1917 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1918 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1919 | 0 \ |
| 1920 | -c "key type: Opaque" \ |
| 1921 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1922 | -s "Verifying peer X.509 certificate... ok" \ |
| 1923 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1924 | -S "error" \ |
| 1925 | -C "error" |
| 1926 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1927 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1929 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1930 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1931 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1932 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1933 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1934 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1935 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1936 | "$P_CLI" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1937 | 0 \ |
| 1938 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1939 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1940 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1941 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1942 | -S "error" \ |
| 1943 | -C "error" |
| 1944 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1946 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1947 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1948 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1949 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1950 | run_test "Opaque key for server authentication: ECDH-" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1951 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1952 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1953 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1954 | "$P_CLI" \ |
| 1955 | 0 \ |
| 1956 | -c "Verifying peer X.509 certificate... ok" \ |
| 1957 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1958 | -s "key types: Opaque, none" \ |
| 1959 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1960 | -S "error" \ |
| 1961 | -C "error" |
| 1962 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1964 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1965 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1966 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1967 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1968 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1969 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 1970 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 1971 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1972 | debug_level=1" \ |
| 1973 | "$P_CLI" \ |
| 1974 | 1 \ |
| 1975 | -s "key types: Opaque, none" \ |
| 1976 | -s "error" \ |
| 1977 | -c "error" \ |
| 1978 | -c "Public key type mismatch" |
| 1979 | |
| 1980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1981 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1982 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1983 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1984 | requires_config_enabled MBEDTLS_RSA_C |
| 1985 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1986 | requires_hash_alg SHA_256 |
| 1987 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 1988 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1989 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 1990 | debug_level=1" \ |
| 1991 | "$P_CLI" \ |
| 1992 | 1 \ |
| 1993 | -s "key types: Opaque, none" \ |
| 1994 | -s "error" \ |
| 1995 | -c "error" \ |
| 1996 | -c "Public key type mismatch" |
| 1997 | |
| 1998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1999 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2000 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2001 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2002 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2003 | requires_hash_alg SHA_256 |
| 2004 | 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] | 2005 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2006 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2007 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2008 | "$P_CLI" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2009 | 1 \ |
| 2010 | -s "key types: Opaque, none" \ |
| 2011 | -s "got ciphersuites in common, but none of them usable" \ |
| 2012 | -s "error" \ |
| 2013 | -c "error" |
| 2014 | |
| 2015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2016 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2017 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2018 | requires_config_enabled MBEDTLS_ECDSA_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2019 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2020 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2021 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2022 | 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] | 2023 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2024 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2025 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2026 | "$P_CLI" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2027 | 1 \ |
| 2028 | -s "key types: Opaque, none" \ |
| 2029 | -s "got ciphersuites in common, but none of them usable" \ |
| 2030 | -s "error" \ |
| 2031 | -c "error" |
| 2032 | |
| 2033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2034 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2035 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2036 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2037 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2038 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2039 | 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] | 2040 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2041 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 2042 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2043 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2044 | 1 \ |
| 2045 | -s "key types: Opaque, none" \ |
| 2046 | -s "got ciphersuites in common, but none of them usable" \ |
| 2047 | -s "error" \ |
| 2048 | -c "error" |
| 2049 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2051 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2052 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2053 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2054 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2055 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2056 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2057 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2058 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2059 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2060 | key_opaque_algs2=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2061 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2062 | 0 \ |
| 2063 | -c "Verifying peer X.509 certificate... ok" \ |
| 2064 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2065 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2066 | -s "key types: Opaque, Opaque" \ |
| 2067 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2068 | -S "error" \ |
| 2069 | -C "error" |
| 2070 | |
| 2071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2072 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2073 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2074 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2075 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2076 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2077 | 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] | 2078 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2079 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2080 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2081 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2082 | "$P_CLI force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2083 | 0 \ |
| 2084 | -c "Verifying peer X.509 certificate... ok" \ |
| 2085 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2086 | -c "CN=Polarssl Test EC CA" \ |
| 2087 | -s "key types: Opaque, Opaque" \ |
| 2088 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2089 | -S "error" \ |
| 2090 | -C "error" |
| 2091 | |
| 2092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2093 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2094 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2095 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2096 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2097 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2098 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2099 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2100 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2101 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2102 | crt_file2=data_files/server2-sha256.crt \ |
| 2103 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2104 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2105 | 0 \ |
| 2106 | -c "Verifying peer X.509 certificate... ok" \ |
| 2107 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2108 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2109 | -s "key types: Opaque, Opaque" \ |
| 2110 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2111 | -S "error" \ |
| 2112 | -C "error" |
| 2113 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2115 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2116 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2117 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2118 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2119 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2120 | "$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] | 2121 | "$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] | 2122 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2123 | -s "The SSL configuration is tls13 only" \ |
| 2124 | -c "key type: Opaque" \ |
| 2125 | -s "key types: Opaque, Opaque" \ |
| 2126 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2127 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2128 | |
| 2129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2130 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2131 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2132 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2133 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2134 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2135 | "$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] | 2136 | "$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] | 2137 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2138 | -s "The SSL configuration is tls13 only" \ |
| 2139 | -c "key type: Opaque" \ |
| 2140 | -s "key types: Opaque, Opaque" \ |
| 2141 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2142 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2143 | |
| 2144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2145 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2146 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2147 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2148 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2149 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
| 2150 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
| 2151 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2152 | 0 \ |
| 2153 | -s "The SSL configuration is tls13 only" \ |
| 2154 | -s "key types: Opaque, Opaque" \ |
| 2155 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2156 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2157 | -C "error" \ |
| 2158 | -S "error" \ |
| 2159 | |
| 2160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2161 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2162 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2163 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2164 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2165 | 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] | 2166 | "$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] | 2167 | "$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] | 2168 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2169 | -s "The SSL configuration is tls13 only" \ |
| 2170 | -c "key type: Opaque" \ |
| 2171 | -s "key types: Opaque, Opaque" \ |
| 2172 | -C "error" \ |
| 2173 | -S "error" \ |
| 2174 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2175 | # Test using a RSA opaque private key for server authentication |
| 2176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2177 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2178 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2179 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2180 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2181 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2182 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2183 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2184 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2185 | "$P_CLI" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2186 | 0 \ |
| 2187 | -c "Verifying peer X.509 certificate... ok" \ |
| 2188 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2189 | -s "key types: Opaque, none" \ |
| 2190 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2191 | -S "error" \ |
| 2192 | -C "error" |
| 2193 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2194 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2195 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2196 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2197 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2198 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2199 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2200 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2201 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2202 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2203 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2204 | 0 \ |
| 2205 | -c "Verifying peer X.509 certificate... ok" \ |
| 2206 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2207 | -s "key types: Opaque, none" \ |
| 2208 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2209 | -S "error" \ |
| 2210 | -C "error" |
| 2211 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2213 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2214 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2216 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2217 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2218 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2219 | psk=abc123 psk_identity=foo" \ |
| 2220 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 2221 | psk=abc123 psk_identity=foo" \ |
| 2222 | 0 \ |
| 2223 | -c "Verifying peer X.509 certificate... ok" \ |
| 2224 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2225 | -s "key types: Opaque, Opaque" \ |
| 2226 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2227 | -S "error" \ |
| 2228 | -C "error" |
| 2229 | |
| 2230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2231 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2232 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2233 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2234 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2235 | run_test "Opaque key for server authentication: RSA-" \ |
| 2236 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
| 2237 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
| 2238 | 0 \ |
| 2239 | -c "Verifying peer X.509 certificate... ok" \ |
| 2240 | -c "Ciphersuite is TLS-RSA-" \ |
| 2241 | -s "key types: Opaque, Opaque" \ |
| 2242 | -s "Ciphersuite is TLS-RSA-" \ |
| 2243 | -S "error" \ |
| 2244 | -C "error" |
| 2245 | |
| 2246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2247 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2248 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2250 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2251 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2252 | 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] | 2253 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2254 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2255 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2256 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2257 | 1 \ |
| 2258 | -s "key types: Opaque, none" \ |
| 2259 | -s "got ciphersuites in common, but none of them usable" \ |
| 2260 | -s "error" \ |
| 2261 | -c "error" |
| 2262 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2264 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2265 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2266 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2267 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2268 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2269 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2270 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2271 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2272 | 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] | 2273 | crt_file2=data_files/server4.crt \ |
| 2274 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2275 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2276 | 0 \ |
| 2277 | -c "Verifying peer X.509 certificate... ok" \ |
| 2278 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2279 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2280 | -s "key types: Opaque, Opaque" \ |
| 2281 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2282 | -S "error" \ |
| 2283 | -C "error" |
| 2284 | |
| 2285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2286 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2287 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2288 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2289 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2290 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2291 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2292 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2293 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2294 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2295 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2296 | crt_file2=data_files/server4.crt \ |
| 2297 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2298 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2299 | 0 \ |
| 2300 | -c "Verifying peer X.509 certificate... ok" \ |
| 2301 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2302 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2303 | -s "key types: Opaque, Opaque" \ |
| 2304 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2305 | -S "error" \ |
| 2306 | -C "error" |
| 2307 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2308 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2310 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2311 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2312 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2313 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2314 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2315 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2316 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2317 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2318 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2319 | 0 \ |
| 2320 | -c "key type: Opaque" \ |
| 2321 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2322 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2323 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2324 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2325 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2326 | -S "error" \ |
| 2327 | -C "error" |
| 2328 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2329 | # Test using a RSA opaque private key for client/server authentication |
| 2330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2331 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2332 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2333 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2334 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2335 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2336 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2337 | "$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] | 2338 | 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] | 2339 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2340 | 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] | 2341 | 0 \ |
| 2342 | -c "key type: Opaque" \ |
| 2343 | -c "Verifying peer X.509 certificate... ok" \ |
| 2344 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2345 | -s "key types: Opaque, none" \ |
| 2346 | -s "Verifying peer X.509 certificate... ok" \ |
| 2347 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2348 | -S "error" \ |
| 2349 | -C "error" |
| 2350 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2352 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2353 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2354 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2355 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2356 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2357 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2358 | "$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] | 2359 | 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] | 2360 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2361 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2362 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2363 | 0 \ |
| 2364 | -c "key type: Opaque" \ |
| 2365 | -c "Verifying peer X.509 certificate... ok" \ |
| 2366 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2367 | -s "key types: Opaque, none" \ |
| 2368 | -s "Verifying peer X.509 certificate... ok" \ |
| 2369 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2370 | -S "error" \ |
| 2371 | -C "error" |
| 2372 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2373 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2374 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2375 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2376 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2377 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2378 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2379 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2380 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2381 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2382 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2383 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2384 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2385 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2387 | run_test_psa_force_curve "secp521r1" |
| 2388 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2389 | run_test_psa_force_curve "brainpoolP512r1" |
| 2390 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2391 | run_test_psa_force_curve "secp384r1" |
| 2392 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2393 | run_test_psa_force_curve "brainpoolP384r1" |
| 2394 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2395 | run_test_psa_force_curve "secp256r1" |
| 2396 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2397 | run_test_psa_force_curve "secp256k1" |
| 2398 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2399 | run_test_psa_force_curve "brainpoolP256r1" |
| 2400 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2401 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2402 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2403 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2404 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2405 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2406 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2407 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2408 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2410 | run_test_psa_force_curve "secp192r1" |
| 2411 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2412 | run_test_psa_force_curve "secp192k1" |
| 2413 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2414 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2416 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2417 | run_test "ServerHello contains gmt_unix_time" \ |
| 2418 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2419 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2420 | 0 \ |
| 2421 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2422 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2423 | |
| 2424 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2426 | run_test "Unique IV in GCM" \ |
| 2427 | "$P_SRV exchanges=20 debug_level=4" \ |
| 2428 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2429 | 0 \ |
| 2430 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2431 | -U "IV used" |
| 2432 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2433 | # Test for correctness of sent single supported algorithm |
| 2434 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2436 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2437 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2438 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2440 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2441 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2442 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2443 | "$P_CLI sig_algs=ecdsa_secp256r1_sha256 debug_level=3" \ |
| 2444 | 0 \ |
| 2445 | -c "Supported Signature Algorithm found: 04 03" |
| 2446 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2448 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2449 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2450 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2451 | requires_hash_alg SHA_256 |
| 2452 | run_test "Single supported algorithm sending: openssl client" \ |
| 2453 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2454 | "$O_CLI -cert data_files/server6.crt \ |
| 2455 | -key data_files/server6.key" \ |
| 2456 | 0 |
| 2457 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2458 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2460 | run_test "Configuration-specific CRT verification callback" \ |
| 2461 | "$P_SRV debug_level=3" \ |
| 2462 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 2463 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2464 | -S "error" \ |
| 2465 | -c "Verify requested for " \ |
| 2466 | -c "Use configuration-specific verification callback" \ |
| 2467 | -C "Use context-specific verification callback" \ |
| 2468 | -C "error" |
| 2469 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2471 | run_test "Context-specific CRT verification callback" \ |
| 2472 | "$P_SRV debug_level=3" \ |
| 2473 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 2474 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2475 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2476 | -c "Verify requested for " \ |
| 2477 | -c "Use context-specific verification callback" \ |
| 2478 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2479 | -C "error" |
| 2480 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2481 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2483 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2484 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2485 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2486 | 1 \ |
| 2487 | -c "The certificate is signed with an unacceptable hash" |
| 2488 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2490 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2491 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2492 | "$P_CLI allow_sha1=1" \ |
| 2493 | 0 |
| 2494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2496 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2497 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2498 | "$P_CLI allow_sha1=0" \ |
| 2499 | 0 |
| 2500 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2502 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2503 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2504 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2505 | 1 \ |
| 2506 | -s "The certificate is signed with an unacceptable hash" |
| 2507 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2509 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 2510 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2511 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2512 | 0 |
| 2513 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2515 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2516 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2517 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2518 | 0 |
| 2519 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2520 | # Dummy TLS 1.3 test |
| 2521 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2522 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2526 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2527 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2528 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2529 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2530 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2531 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2534 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2535 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2536 | run_test "TLS 1.3: key exchange mode parameter passing: PSK-ephemeral only" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2537 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2538 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2539 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2540 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2543 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2544 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2545 | run_test "TLS 1.3: key exchange mode parameter passing: Pure-ephemeral only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 2546 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2547 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2548 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2549 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2550 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2552 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2553 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2554 | run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2555 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2556 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 2557 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2558 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2561 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2562 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2563 | run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2564 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2565 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2566 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2567 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2570 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2571 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2572 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2573 | "$P_SRV tls13_kex_modes=all" \ |
| 2574 | "$P_CLI tls13_kex_modes=all" \ |
| 2575 | 0 |
| 2576 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2577 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2579 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2580 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2581 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2582 | 0 \ |
| 2583 | -c "next record in same datagram" \ |
| 2584 | -s "next record in same datagram" |
| 2585 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2587 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2588 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2589 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2590 | 0 \ |
| 2591 | -s "next record in same datagram" \ |
| 2592 | -C "next record in same datagram" |
| 2593 | |
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, server only" \ |
| 2596 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2597 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2598 | 0 \ |
| 2599 | -S "next record in same datagram" \ |
| 2600 | -c "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, neither client nor server" \ |
| 2604 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2605 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2606 | 0 \ |
| 2607 | -S "next record in same datagram" \ |
| 2608 | -C "next record in same datagram" |
| 2609 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2610 | # Tests for Context serialization |
| 2611 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2613 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2614 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2615 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2616 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2617 | 0 \ |
| 2618 | -c "Deserializing connection..." \ |
| 2619 | -S "Deserializing connection..." |
| 2620 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2622 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2623 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2624 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2625 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2626 | 0 \ |
| 2627 | -c "Deserializing connection..." \ |
| 2628 | -S "Deserializing connection..." |
| 2629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2632 | run_test "Context serialization, client serializes, GCM" \ |
| 2633 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2634 | "$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] | 2635 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2636 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2637 | -S "Deserializing connection..." |
| 2638 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2640 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2641 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2642 | run_test "Context serialization, client serializes, with CID" \ |
| 2643 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2644 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2645 | 0 \ |
| 2646 | -c "Deserializing connection..." \ |
| 2647 | -S "Deserializing connection..." |
| 2648 | |
| 2649 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2650 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2651 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2652 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2653 | 0 \ |
| 2654 | -C "Deserializing connection..." \ |
| 2655 | -s "Deserializing connection..." |
| 2656 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2658 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2659 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2660 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2661 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2662 | 0 \ |
| 2663 | -C "Deserializing connection..." \ |
| 2664 | -s "Deserializing connection..." |
| 2665 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2667 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2668 | run_test "Context serialization, server serializes, GCM" \ |
| 2669 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2670 | "$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] | 2671 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2672 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2673 | -s "Deserializing connection..." |
| 2674 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2676 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2677 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2678 | run_test "Context serialization, server serializes, with CID" \ |
| 2679 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2680 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2681 | 0 \ |
| 2682 | -C "Deserializing connection..." \ |
| 2683 | -s "Deserializing connection..." |
| 2684 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2687 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2688 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2689 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2690 | 0 \ |
| 2691 | -c "Deserializing connection..." \ |
| 2692 | -s "Deserializing connection..." |
| 2693 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2695 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2696 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2697 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2698 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2699 | 0 \ |
| 2700 | -c "Deserializing connection..." \ |
| 2701 | -s "Deserializing connection..." |
| 2702 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2704 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2705 | run_test "Context serialization, both serialize, GCM" \ |
| 2706 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2707 | "$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] | 2708 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2709 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2710 | -s "Deserializing connection..." |
| 2711 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2713 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2714 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2715 | run_test "Context serialization, both serialize, with CID" \ |
| 2716 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2717 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2718 | 0 \ |
| 2719 | -c "Deserializing connection..." \ |
| 2720 | -s "Deserializing connection..." |
| 2721 | |
| 2722 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2723 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2724 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2725 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2726 | 0 \ |
| 2727 | -c "Deserializing connection..." \ |
| 2728 | -S "Deserializing connection..." |
| 2729 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2731 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2732 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2733 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2734 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2735 | 0 \ |
| 2736 | -c "Deserializing connection..." \ |
| 2737 | -S "Deserializing connection..." |
| 2738 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2739 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2740 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2741 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2742 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2743 | "$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] | 2744 | 0 \ |
| 2745 | -c "Deserializing connection..." \ |
| 2746 | -S "Deserializing connection..." |
| 2747 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2749 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2750 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2751 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2752 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2753 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2754 | 0 \ |
| 2755 | -c "Deserializing connection..." \ |
| 2756 | -S "Deserializing connection..." |
| 2757 | |
| 2758 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2759 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2760 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2761 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2762 | 0 \ |
| 2763 | -C "Deserializing connection..." \ |
| 2764 | -s "Deserializing connection..." |
| 2765 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2767 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2768 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2769 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2770 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2771 | 0 \ |
| 2772 | -C "Deserializing connection..." \ |
| 2773 | -s "Deserializing connection..." |
| 2774 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2776 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2777 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2778 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2779 | "$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] | 2780 | 0 \ |
| 2781 | -C "Deserializing connection..." \ |
| 2782 | -s "Deserializing connection..." |
| 2783 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2785 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2786 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2787 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2788 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2789 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2790 | 0 \ |
| 2791 | -C "Deserializing connection..." \ |
| 2792 | -s "Deserializing connection..." |
| 2793 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2795 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2796 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2797 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2798 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2799 | 0 \ |
| 2800 | -c "Deserializing connection..." \ |
| 2801 | -s "Deserializing connection..." |
| 2802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2804 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2805 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2806 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2807 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2808 | 0 \ |
| 2809 | -c "Deserializing connection..." \ |
| 2810 | -s "Deserializing connection..." |
| 2811 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2813 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2814 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2815 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2816 | "$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] | 2817 | 0 \ |
| 2818 | -c "Deserializing connection..." \ |
| 2819 | -s "Deserializing connection..." |
| 2820 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2822 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2823 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2824 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2825 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2826 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2827 | 0 \ |
| 2828 | -c "Deserializing connection..." \ |
| 2829 | -s "Deserializing connection..." |
| 2830 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2832 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2833 | run_test "Saving the serialized context to a file" \ |
| 2834 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2835 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2836 | 0 \ |
| 2837 | -s "Save serialized context to a file... ok" \ |
| 2838 | -c "Save serialized context to a file... ok" |
| 2839 | rm -f context_srv.txt |
| 2840 | rm -f context_cli.txt |
| 2841 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2842 | # Tests for DTLS Connection ID extension |
| 2843 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2844 | # So far, the CID API isn't implemented, so we can't |
| 2845 | # grep for output witnessing its use. This needs to be |
| 2846 | # changed once the CID extension is implemented. |
| 2847 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2849 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2850 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2851 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2852 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2853 | 0 \ |
| 2854 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2855 | -s "found CID extension" \ |
| 2856 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2857 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2858 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2859 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2860 | -C "found CID extension" \ |
| 2861 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2862 | -C "Copy CIDs into SSL transform" \ |
| 2863 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2864 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2866 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2867 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2868 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2869 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2870 | 0 \ |
| 2871 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2872 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2873 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2874 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2875 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2876 | -C "found CID extension" \ |
| 2877 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2878 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2879 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2880 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2882 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2883 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2884 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2885 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2886 | 0 \ |
| 2887 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2888 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2889 | -c "client hello, adding CID extension" \ |
| 2890 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2891 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2892 | -s "server hello, adding CID extension" \ |
| 2893 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2894 | -c "Use of CID extension negotiated" \ |
| 2895 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2896 | -c "Copy CIDs into SSL transform" \ |
| 2897 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2898 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2899 | -s "Use of Connection ID has been negotiated" \ |
| 2900 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2901 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2903 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2904 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2905 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2906 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2907 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2908 | 0 \ |
| 2909 | -c "Enable use of CID extension." \ |
| 2910 | -s "Enable use of CID extension." \ |
| 2911 | -c "client hello, adding CID extension" \ |
| 2912 | -s "found CID extension" \ |
| 2913 | -s "Use of CID extension negotiated" \ |
| 2914 | -s "server hello, adding CID extension" \ |
| 2915 | -c "found CID extension" \ |
| 2916 | -c "Use of CID extension negotiated" \ |
| 2917 | -s "Copy CIDs into SSL transform" \ |
| 2918 | -c "Copy CIDs into SSL transform" \ |
| 2919 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2920 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2921 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2922 | -c "Use of Connection ID has been negotiated" \ |
| 2923 | -c "ignoring unexpected CID" \ |
| 2924 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2925 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2927 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2928 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2929 | -p "$P_PXY mtu=800" \ |
| 2930 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2931 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2932 | 0 \ |
| 2933 | -c "Enable use of CID extension." \ |
| 2934 | -s "Enable use of CID extension." \ |
| 2935 | -c "client hello, adding CID extension" \ |
| 2936 | -s "found CID extension" \ |
| 2937 | -s "Use of CID extension negotiated" \ |
| 2938 | -s "server hello, adding CID extension" \ |
| 2939 | -c "found CID extension" \ |
| 2940 | -c "Use of CID extension negotiated" \ |
| 2941 | -s "Copy CIDs into SSL transform" \ |
| 2942 | -c "Copy CIDs into SSL transform" \ |
| 2943 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2944 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2945 | -s "Use of Connection ID has been negotiated" \ |
| 2946 | -c "Use of Connection ID has been negotiated" |
| 2947 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2949 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2950 | 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] | 2951 | -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] | 2952 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2953 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2954 | 0 \ |
| 2955 | -c "Enable use of CID extension." \ |
| 2956 | -s "Enable use of CID extension." \ |
| 2957 | -c "client hello, adding CID extension" \ |
| 2958 | -s "found CID extension" \ |
| 2959 | -s "Use of CID extension negotiated" \ |
| 2960 | -s "server hello, adding CID extension" \ |
| 2961 | -c "found CID extension" \ |
| 2962 | -c "Use of CID extension negotiated" \ |
| 2963 | -s "Copy CIDs into SSL transform" \ |
| 2964 | -c "Copy CIDs into SSL transform" \ |
| 2965 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2966 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2967 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2968 | -c "Use of Connection ID has been negotiated" \ |
| 2969 | -c "ignoring unexpected CID" \ |
| 2970 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2971 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2973 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2974 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2975 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2976 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2977 | 0 \ |
| 2978 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2979 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2980 | -c "client hello, adding CID extension" \ |
| 2981 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2982 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2983 | -s "server hello, adding CID extension" \ |
| 2984 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2985 | -c "Use of CID extension negotiated" \ |
| 2986 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2987 | -c "Copy CIDs into SSL transform" \ |
| 2988 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2989 | -s "Peer CID (length 0 Bytes):" \ |
| 2990 | -s "Use of Connection ID has been negotiated" \ |
| 2991 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2992 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2994 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2995 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2996 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2997 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2998 | 0 \ |
| 2999 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3000 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3001 | -c "client hello, adding CID extension" \ |
| 3002 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3003 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3004 | -s "server hello, adding CID extension" \ |
| 3005 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3006 | -c "Use of CID extension negotiated" \ |
| 3007 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3008 | -c "Copy CIDs into SSL transform" \ |
| 3009 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3010 | -c "Peer CID (length 0 Bytes):" \ |
| 3011 | -s "Use of Connection ID has been negotiated" \ |
| 3012 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3013 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3014 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3015 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3016 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3017 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3018 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3019 | 0 \ |
| 3020 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3021 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3022 | -c "client hello, adding CID extension" \ |
| 3023 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3024 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3025 | -s "server hello, adding CID extension" \ |
| 3026 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3027 | -c "Use of CID extension negotiated" \ |
| 3028 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3029 | -c "Copy CIDs into SSL transform" \ |
| 3030 | -S "Use of Connection ID has been negotiated" \ |
| 3031 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3032 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3034 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3035 | 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] | 3036 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3037 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3038 | 0 \ |
| 3039 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3040 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3041 | -c "client hello, adding CID extension" \ |
| 3042 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3043 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3044 | -s "server hello, adding CID extension" \ |
| 3045 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3046 | -c "Use of CID extension negotiated" \ |
| 3047 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3048 | -c "Copy CIDs into SSL transform" \ |
| 3049 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3050 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3051 | -s "Use of Connection ID has been negotiated" \ |
| 3052 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3053 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
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 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3076 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3077 | 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] | 3078 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3079 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3080 | 0 \ |
| 3081 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3082 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3083 | -c "client hello, adding CID extension" \ |
| 3084 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3085 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3086 | -s "server hello, adding CID extension" \ |
| 3087 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3088 | -c "Use of CID extension negotiated" \ |
| 3089 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3090 | -c "Copy CIDs into SSL transform" \ |
| 3091 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3092 | -c "Peer CID (length 0 Bytes):" \ |
| 3093 | -s "Use of Connection ID has been negotiated" \ |
| 3094 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3098 | 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] | 3099 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3100 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3101 | 0 \ |
| 3102 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3103 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3104 | -c "client hello, adding CID extension" \ |
| 3105 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3106 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3107 | -s "server hello, adding CID extension" \ |
| 3108 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3109 | -c "Use of CID extension negotiated" \ |
| 3110 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3111 | -c "Copy CIDs into SSL transform" \ |
| 3112 | -S "Use of Connection ID has been negotiated" \ |
| 3113 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3114 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3116 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3117 | 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] | 3118 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3119 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3120 | 0 \ |
| 3121 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3122 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3123 | -c "client hello, adding CID extension" \ |
| 3124 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3125 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3126 | -s "server hello, adding CID extension" \ |
| 3127 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3128 | -c "Use of CID extension negotiated" \ |
| 3129 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3130 | -c "Copy CIDs into SSL transform" \ |
| 3131 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3132 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3133 | -s "Use of Connection ID has been negotiated" \ |
| 3134 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3135 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3137 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3138 | 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] | 3139 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3140 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3141 | 0 \ |
| 3142 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3143 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3144 | -c "client hello, adding CID extension" \ |
| 3145 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3146 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3147 | -s "server hello, adding CID extension" \ |
| 3148 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3149 | -c "Use of CID extension negotiated" \ |
| 3150 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3151 | -c "Copy CIDs into SSL transform" \ |
| 3152 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3153 | -s "Peer CID (length 0 Bytes):" \ |
| 3154 | -s "Use of Connection ID has been negotiated" \ |
| 3155 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3158 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3159 | 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] | 3160 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3161 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3162 | 0 \ |
| 3163 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3164 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3165 | -c "client hello, adding CID extension" \ |
| 3166 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3167 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3168 | -s "server hello, adding CID extension" \ |
| 3169 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3170 | -c "Use of CID extension negotiated" \ |
| 3171 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3172 | -c "Copy CIDs into SSL transform" \ |
| 3173 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3174 | -c "Peer CID (length 0 Bytes):" \ |
| 3175 | -s "Use of Connection ID has been negotiated" \ |
| 3176 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3177 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3179 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3180 | 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] | 3181 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3182 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3183 | 0 \ |
| 3184 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3185 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3186 | -c "client hello, adding CID extension" \ |
| 3187 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3188 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3189 | -s "server hello, adding CID extension" \ |
| 3190 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3191 | -c "Use of CID extension negotiated" \ |
| 3192 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3193 | -c "Copy CIDs into SSL transform" \ |
| 3194 | -S "Use of Connection ID has been negotiated" \ |
| 3195 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3196 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3198 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3199 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3200 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3201 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3202 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3203 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3204 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3205 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3206 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3207 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3208 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3209 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3210 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3211 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3212 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3214 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3215 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3216 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3217 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3218 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3219 | 0 \ |
| 3220 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3221 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3222 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3223 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3224 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3225 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3226 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3227 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3228 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3230 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3231 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3232 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3233 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3234 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3235 | 0 \ |
| 3236 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3237 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3238 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3239 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3240 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3241 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3242 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3243 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3246 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3247 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3248 | 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] | 3249 | -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] | 3250 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3251 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3252 | 0 \ |
| 3253 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3254 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3255 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3256 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3257 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3258 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3259 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3260 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3261 | -c "ignoring unexpected CID" \ |
| 3262 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3263 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3265 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3266 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3267 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3268 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3269 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3270 | 0 \ |
| 3271 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3272 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3273 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3274 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3275 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3276 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3277 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3278 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3279 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3281 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3282 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3283 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3284 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3285 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3286 | 0 \ |
| 3287 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3288 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3289 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3290 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3291 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3292 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3293 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3294 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3295 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3297 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3298 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3299 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3300 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3301 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3302 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3303 | 0 \ |
| 3304 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3305 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3306 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3307 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3308 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3309 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3310 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3311 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3312 | -c "ignoring unexpected CID" \ |
| 3313 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3314 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3318 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3319 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3320 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3321 | 0 \ |
| 3322 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3323 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3324 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3325 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3326 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3327 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3328 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3330 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3332 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3333 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3334 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3335 | 0 \ |
| 3336 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3337 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3338 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3339 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3340 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3341 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3342 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3344 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3345 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3346 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3347 | -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] | 3348 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3349 | "$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" \ |
| 3350 | 0 \ |
| 3351 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3352 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3353 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3354 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3355 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3356 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3357 | -c "ignoring unexpected CID" \ |
| 3358 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3359 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3362 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3363 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3364 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3365 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3366 | 0 \ |
| 3367 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3368 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3369 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3370 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3371 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3372 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3373 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3374 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3375 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3376 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3378 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3379 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3380 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3381 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3382 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3383 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3384 | 0 \ |
| 3385 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3386 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3387 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3388 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3389 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3390 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3391 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3392 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3393 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3394 | -c "ignoring unexpected CID" \ |
| 3395 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3396 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3398 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3399 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3400 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3401 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3402 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3403 | 0 \ |
| 3404 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3405 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3406 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3407 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3408 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3409 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3410 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3411 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3412 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3413 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3415 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3416 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3417 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3418 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3419 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3420 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3421 | 0 \ |
| 3422 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3423 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3424 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3425 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3426 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3427 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3428 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3429 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3430 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3431 | -c "ignoring unexpected CID" \ |
| 3432 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3433 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3434 | # 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] | 3435 | # tests check that the buffer contents are reallocated when the message is |
| 3436 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3438 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3439 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3440 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3441 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3442 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3443 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3444 | 0 \ |
| 3445 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3446 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3447 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3448 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3449 | -s "Reallocating in_buf" \ |
| 3450 | -s "Reallocating out_buf" |
| 3451 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3453 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3454 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3455 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3456 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3457 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3458 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3459 | 0 \ |
| 3460 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3461 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3462 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3463 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3464 | -s "Reallocating in_buf" \ |
| 3465 | -s "Reallocating out_buf" |
| 3466 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3467 | # Tests for Encrypt-then-MAC extension |
| 3468 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3470 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3471 | "$P_SRV debug_level=3 \ |
| 3472 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3473 | "$P_CLI debug_level=3" \ |
| 3474 | 0 \ |
| 3475 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3476 | -s "found encrypt then mac extension" \ |
| 3477 | -s "server hello, adding encrypt then mac extension" \ |
| 3478 | -c "found encrypt_then_mac extension" \ |
| 3479 | -c "using encrypt then mac" \ |
| 3480 | -s "using encrypt then mac" |
| 3481 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3483 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3484 | "$P_SRV debug_level=3 etm=0 \ |
| 3485 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3486 | "$P_CLI debug_level=3 etm=1" \ |
| 3487 | 0 \ |
| 3488 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3489 | -s "found encrypt then mac extension" \ |
| 3490 | -S "server hello, adding encrypt then mac extension" \ |
| 3491 | -C "found encrypt_then_mac extension" \ |
| 3492 | -C "using encrypt then mac" \ |
| 3493 | -S "using encrypt then mac" |
| 3494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3496 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3497 | "$P_SRV debug_level=3 etm=1 \ |
| 3498 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3499 | "$P_CLI debug_level=3 etm=1" \ |
| 3500 | 0 \ |
| 3501 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3502 | -s "found encrypt then mac extension" \ |
| 3503 | -S "server hello, adding encrypt then mac extension" \ |
| 3504 | -C "found encrypt_then_mac extension" \ |
| 3505 | -C "using encrypt then mac" \ |
| 3506 | -S "using encrypt then mac" |
| 3507 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3509 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3510 | "$P_SRV debug_level=3 etm=1 \ |
| 3511 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3512 | "$P_CLI debug_level=3 etm=0" \ |
| 3513 | 0 \ |
| 3514 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3515 | -S "found encrypt then mac extension" \ |
| 3516 | -S "server hello, adding encrypt then mac extension" \ |
| 3517 | -C "found encrypt_then_mac extension" \ |
| 3518 | -C "using encrypt then mac" \ |
| 3519 | -S "using encrypt then mac" |
| 3520 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3521 | # Tests for Extended Master Secret extension |
| 3522 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3524 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3525 | run_test "Extended Master Secret: default" \ |
| 3526 | "$P_SRV debug_level=3" \ |
| 3527 | "$P_CLI debug_level=3" \ |
| 3528 | 0 \ |
| 3529 | -c "client hello, adding extended_master_secret extension" \ |
| 3530 | -s "found extended master secret extension" \ |
| 3531 | -s "server hello, adding extended master secret extension" \ |
| 3532 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3533 | -c "session hash for extended master secret" \ |
| 3534 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3535 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3537 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3538 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3539 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3540 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3541 | 0 \ |
| 3542 | -c "client hello, adding extended_master_secret extension" \ |
| 3543 | -s "found extended master secret extension" \ |
| 3544 | -S "server hello, adding extended master secret extension" \ |
| 3545 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3546 | -C "session hash for extended master secret" \ |
| 3547 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3548 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3550 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3551 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3552 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3553 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3554 | 0 \ |
| 3555 | -C "client hello, adding extended_master_secret extension" \ |
| 3556 | -S "found extended master secret extension" \ |
| 3557 | -S "server hello, adding extended master secret extension" \ |
| 3558 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3559 | -C "session hash for extended master secret" \ |
| 3560 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3561 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3562 | # Test sending and receiving empty application data records |
| 3563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3565 | run_test "Encrypt then MAC: empty application data record" \ |
| 3566 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3567 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 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: 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" \ |
| 3576 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3577 | 0 \ |
| 3578 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3579 | -c "0 bytes written in 1 fragments" |
| 3580 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3582 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3583 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3584 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3585 | 0 \ |
| 3586 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3587 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3588 | -c "0 bytes written in 1 fragments" |
| 3589 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3591 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3592 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3593 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3594 | 0 \ |
| 3595 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3596 | -c "0 bytes written in 1 fragments" |
| 3597 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3598 | # Tests for CBC 1/n-1 record splitting |
| 3599 | |
| 3600 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3601 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3602 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3603 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3604 | 0 \ |
| 3605 | -s "Read from client: 123 bytes read" \ |
| 3606 | -S "Read from client: 1 bytes read" \ |
| 3607 | -S "122 bytes read" |
| 3608 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3609 | # Tests for Session Tickets |
| 3610 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3612 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3613 | "$P_SRV debug_level=3 tickets=1" \ |
| 3614 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3615 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3616 | -c "client hello, adding session ticket extension" \ |
| 3617 | -s "found session ticket extension" \ |
| 3618 | -s "server hello, adding session ticket extension" \ |
| 3619 | -c "found session_ticket extension" \ |
| 3620 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3621 | -S "session successfully restored from cache" \ |
| 3622 | -s "session successfully restored from ticket" \ |
| 3623 | -s "a session has been resumed" \ |
| 3624 | -c "a session has been resumed" |
| 3625 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3627 | run_test "Session resume using tickets: manual rotation" \ |
| 3628 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3629 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3630 | 0 \ |
| 3631 | -c "client hello, adding session ticket extension" \ |
| 3632 | -s "found session ticket extension" \ |
| 3633 | -s "server hello, adding session ticket extension" \ |
| 3634 | -c "found session_ticket extension" \ |
| 3635 | -c "parse new session ticket" \ |
| 3636 | -S "session successfully restored from cache" \ |
| 3637 | -s "session successfully restored from ticket" \ |
| 3638 | -s "a session has been resumed" \ |
| 3639 | -c "a session has been resumed" |
| 3640 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3642 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3643 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3644 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3645 | 0 \ |
| 3646 | -c "client hello, adding session ticket extension" \ |
| 3647 | -s "found session ticket extension" \ |
| 3648 | -s "server hello, adding session ticket extension" \ |
| 3649 | -c "found session_ticket extension" \ |
| 3650 | -c "parse new session ticket" \ |
| 3651 | -S "session successfully restored from cache" \ |
| 3652 | -s "session successfully restored from ticket" \ |
| 3653 | -s "a session has been resumed" \ |
| 3654 | -c "a session has been resumed" |
| 3655 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3657 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3658 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 3659 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3660 | 0 \ |
| 3661 | -c "client hello, adding session ticket extension" \ |
| 3662 | -s "found session ticket extension" \ |
| 3663 | -s "server hello, adding session ticket extension" \ |
| 3664 | -c "found session_ticket extension" \ |
| 3665 | -c "parse new session ticket" \ |
| 3666 | -S "session successfully restored from cache" \ |
| 3667 | -S "session successfully restored from ticket" \ |
| 3668 | -S "a session has been resumed" \ |
| 3669 | -C "a session has been resumed" |
| 3670 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3672 | run_test "Session resume using tickets: session copy" \ |
| 3673 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3674 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3675 | 0 \ |
| 3676 | -c "client hello, adding session ticket extension" \ |
| 3677 | -s "found session ticket extension" \ |
| 3678 | -s "server hello, adding session ticket extension" \ |
| 3679 | -c "found session_ticket extension" \ |
| 3680 | -c "parse new session ticket" \ |
| 3681 | -S "session successfully restored from cache" \ |
| 3682 | -s "session successfully restored from ticket" \ |
| 3683 | -s "a session has been resumed" \ |
| 3684 | -c "a session has been resumed" |
| 3685 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3687 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3688 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3689 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3690 | 0 \ |
| 3691 | -c "client hello, adding session ticket extension" \ |
| 3692 | -c "found session_ticket extension" \ |
| 3693 | -c "parse new session ticket" \ |
| 3694 | -c "a session has been resumed" |
| 3695 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3697 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3698 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3699 | "( $O_CLI -sess_out $SESSION; \ |
| 3700 | $O_CLI -sess_in $SESSION; \ |
| 3701 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3702 | 0 \ |
| 3703 | -s "found session ticket extension" \ |
| 3704 | -s "server hello, adding session ticket extension" \ |
| 3705 | -S "session successfully restored from cache" \ |
| 3706 | -s "session successfully restored from ticket" \ |
| 3707 | -s "a session has been resumed" |
| 3708 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3710 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3711 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3712 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3713 | 0 \ |
| 3714 | -c "client hello, adding session ticket extension" \ |
| 3715 | -s "found session ticket extension" \ |
| 3716 | -s "server hello, adding session ticket extension" \ |
| 3717 | -c "found session_ticket extension" \ |
| 3718 | -c "parse new session ticket" \ |
| 3719 | -S "session successfully restored from cache" \ |
| 3720 | -s "session successfully restored from ticket" \ |
| 3721 | -s "a session has been resumed" \ |
| 3722 | -c "a session has been resumed" |
| 3723 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3725 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3726 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3727 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3728 | 0 \ |
| 3729 | -c "client hello, adding session ticket extension" \ |
| 3730 | -s "found session ticket extension" \ |
| 3731 | -s "server hello, adding session ticket extension" \ |
| 3732 | -c "found session_ticket extension" \ |
| 3733 | -c "parse new session ticket" \ |
| 3734 | -S "session successfully restored from cache" \ |
| 3735 | -s "session successfully restored from ticket" \ |
| 3736 | -s "a session has been resumed" \ |
| 3737 | -c "a session has been resumed" |
| 3738 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3739 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3740 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3741 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3742 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3743 | 0 \ |
| 3744 | -c "client hello, adding session ticket extension" \ |
| 3745 | -s "found session ticket extension" \ |
| 3746 | -s "server hello, adding session ticket extension" \ |
| 3747 | -c "found session_ticket extension" \ |
| 3748 | -c "parse new session ticket" \ |
| 3749 | -S "session successfully restored from cache" \ |
| 3750 | -s "session successfully restored from ticket" \ |
| 3751 | -s "a session has been resumed" \ |
| 3752 | -c "a session has been resumed" |
| 3753 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3754 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3755 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3756 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3757 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3758 | 0 \ |
| 3759 | -c "client hello, adding session ticket extension" \ |
| 3760 | -s "found session ticket extension" \ |
| 3761 | -s "server hello, adding session ticket extension" \ |
| 3762 | -c "found session_ticket extension" \ |
| 3763 | -c "parse new session ticket" \ |
| 3764 | -S "session successfully restored from cache" \ |
| 3765 | -s "session successfully restored from ticket" \ |
| 3766 | -s "a session has been resumed" \ |
| 3767 | -c "a session has been resumed" |
| 3768 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3770 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3771 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3772 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3773 | 0 \ |
| 3774 | -c "client hello, adding session ticket extension" \ |
| 3775 | -s "found session ticket extension" \ |
| 3776 | -s "server hello, adding session ticket extension" \ |
| 3777 | -c "found session_ticket extension" \ |
| 3778 | -c "parse new session ticket" \ |
| 3779 | -S "session successfully restored from cache" \ |
| 3780 | -s "session successfully restored from ticket" \ |
| 3781 | -s "a session has been resumed" \ |
| 3782 | -c "a session has been resumed" |
| 3783 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3785 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3786 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3787 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 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 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3800 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3801 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3802 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3803 | 0 \ |
| 3804 | -c "client hello, adding session ticket extension" \ |
| 3805 | -s "found session ticket extension" \ |
| 3806 | -s "server hello, adding session ticket extension" \ |
| 3807 | -c "found session_ticket extension" \ |
| 3808 | -c "parse new session ticket" \ |
| 3809 | -S "session successfully restored from cache" \ |
| 3810 | -s "session successfully restored from ticket" \ |
| 3811 | -s "a session has been resumed" \ |
| 3812 | -c "a session has been resumed" |
| 3813 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3815 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3816 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3817 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3818 | 0 \ |
| 3819 | -c "client hello, adding session ticket extension" \ |
| 3820 | -s "found session ticket extension" \ |
| 3821 | -s "server hello, adding session ticket extension" \ |
| 3822 | -c "found session_ticket extension" \ |
| 3823 | -c "parse new session ticket" \ |
| 3824 | -S "session successfully restored from cache" \ |
| 3825 | -s "session successfully restored from ticket" \ |
| 3826 | -s "a session has been resumed" \ |
| 3827 | -c "a session has been resumed" |
| 3828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3830 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3831 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3832 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3833 | 0 \ |
| 3834 | -c "client hello, adding session ticket extension" \ |
| 3835 | -s "found session ticket extension" \ |
| 3836 | -s "server hello, adding session ticket extension" \ |
| 3837 | -c "found session_ticket extension" \ |
| 3838 | -c "parse new session ticket" \ |
| 3839 | -S "session successfully restored from cache" \ |
| 3840 | -s "session successfully restored from ticket" \ |
| 3841 | -s "a session has been resumed" \ |
| 3842 | -c "a session has been resumed" |
| 3843 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3845 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3846 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3847 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3848 | 0 \ |
| 3849 | -c "client hello, adding session ticket extension" \ |
| 3850 | -s "found session ticket extension" \ |
| 3851 | -s "server hello, adding session ticket extension" \ |
| 3852 | -c "found session_ticket extension" \ |
| 3853 | -c "parse new session ticket" \ |
| 3854 | -S "session successfully restored from cache" \ |
| 3855 | -s "session successfully restored from ticket" \ |
| 3856 | -s "a session has been resumed" \ |
| 3857 | -c "a session has been resumed" |
| 3858 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3860 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3861 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3862 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3863 | 0 \ |
| 3864 | -c "client hello, adding session ticket extension" \ |
| 3865 | -s "found session ticket extension" \ |
| 3866 | -s "server hello, adding session ticket extension" \ |
| 3867 | -c "found session_ticket extension" \ |
| 3868 | -c "parse new session ticket" \ |
| 3869 | -S "session successfully restored from cache" \ |
| 3870 | -s "session successfully restored from ticket" \ |
| 3871 | -s "a session has been resumed" \ |
| 3872 | -c "a session has been resumed" |
| 3873 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3874 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3875 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3876 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3877 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3878 | 0 \ |
| 3879 | -c "client hello, adding session ticket extension" \ |
| 3880 | -s "found session ticket extension" \ |
| 3881 | -s "server hello, adding session ticket extension" \ |
| 3882 | -c "found session_ticket extension" \ |
| 3883 | -c "parse new session ticket" \ |
| 3884 | -S "session successfully restored from cache" \ |
| 3885 | -s "session successfully restored from ticket" \ |
| 3886 | -s "a session has been resumed" \ |
| 3887 | -c "a session has been resumed" |
| 3888 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3890 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3891 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3892 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3893 | 0 \ |
| 3894 | -c "client hello, adding session ticket extension" \ |
| 3895 | -s "found session ticket extension" \ |
| 3896 | -s "server hello, adding session ticket extension" \ |
| 3897 | -c "found session_ticket extension" \ |
| 3898 | -c "parse new session ticket" \ |
| 3899 | -S "session successfully restored from cache" \ |
| 3900 | -s "session successfully restored from ticket" \ |
| 3901 | -s "a session has been resumed" \ |
| 3902 | -c "a session has been resumed" |
| 3903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3905 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3906 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3907 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3908 | 0 \ |
| 3909 | -c "client hello, adding session ticket extension" \ |
| 3910 | -s "found session ticket extension" \ |
| 3911 | -s "server hello, adding session ticket extension" \ |
| 3912 | -c "found session_ticket extension" \ |
| 3913 | -c "parse new session ticket" \ |
| 3914 | -S "session successfully restored from cache" \ |
| 3915 | -s "session successfully restored from ticket" \ |
| 3916 | -s "a session has been resumed" \ |
| 3917 | -c "a session has been resumed" |
| 3918 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3920 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3921 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3922 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3923 | 0 \ |
| 3924 | -c "client hello, adding session ticket extension" \ |
| 3925 | -s "found session ticket extension" \ |
| 3926 | -s "server hello, adding session ticket extension" \ |
| 3927 | -c "found session_ticket extension" \ |
| 3928 | -c "parse new session ticket" \ |
| 3929 | -S "session successfully restored from cache" \ |
| 3930 | -s "session successfully restored from ticket" \ |
| 3931 | -s "a session has been resumed" \ |
| 3932 | -c "a session has been resumed" |
| 3933 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3934 | # Tests for Session Tickets with DTLS |
| 3935 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3937 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3938 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3939 | "$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] | 3940 | 0 \ |
| 3941 | -c "client hello, adding session ticket extension" \ |
| 3942 | -s "found session ticket extension" \ |
| 3943 | -s "server hello, adding session ticket extension" \ |
| 3944 | -c "found session_ticket extension" \ |
| 3945 | -c "parse new session ticket" \ |
| 3946 | -S "session successfully restored from cache" \ |
| 3947 | -s "session successfully restored from ticket" \ |
| 3948 | -s "a session has been resumed" \ |
| 3949 | -c "a session has been resumed" |
| 3950 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3952 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3953 | "$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] | 3954 | "$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] | 3955 | 0 \ |
| 3956 | -c "client hello, adding session ticket extension" \ |
| 3957 | -s "found session ticket extension" \ |
| 3958 | -s "server hello, adding session ticket extension" \ |
| 3959 | -c "found session_ticket extension" \ |
| 3960 | -c "parse new session ticket" \ |
| 3961 | -S "session successfully restored from cache" \ |
| 3962 | -s "session successfully restored from ticket" \ |
| 3963 | -s "a session has been resumed" \ |
| 3964 | -c "a session has been resumed" |
| 3965 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3967 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3968 | "$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] | 3969 | "$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] | 3970 | 0 \ |
| 3971 | -c "client hello, adding session ticket extension" \ |
| 3972 | -s "found session ticket extension" \ |
| 3973 | -s "server hello, adding session ticket extension" \ |
| 3974 | -c "found session_ticket extension" \ |
| 3975 | -c "parse new session ticket" \ |
| 3976 | -S "session successfully restored from cache" \ |
| 3977 | -S "session successfully restored from ticket" \ |
| 3978 | -S "a session has been resumed" \ |
| 3979 | -C "a session has been resumed" |
| 3980 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3982 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3983 | "$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] | 3984 | "$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] | 3985 | 0 \ |
| 3986 | -c "client hello, adding session ticket extension" \ |
| 3987 | -s "found session ticket extension" \ |
| 3988 | -s "server hello, adding session ticket extension" \ |
| 3989 | -c "found session_ticket extension" \ |
| 3990 | -c "parse new session ticket" \ |
| 3991 | -S "session successfully restored from cache" \ |
| 3992 | -s "session successfully restored from ticket" \ |
| 3993 | -s "a session has been resumed" \ |
| 3994 | -c "a session has been resumed" |
| 3995 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3997 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3998 | "$O_SRV -dtls" \ |
| 3999 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4000 | 0 \ |
| 4001 | -c "client hello, adding session ticket extension" \ |
| 4002 | -c "found session_ticket extension" \ |
| 4003 | -c "parse new session ticket" \ |
| 4004 | -c "a session has been resumed" |
| 4005 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4006 | # 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] | 4007 | # 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] | 4008 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4010 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4011 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4012 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4013 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4014 | rm -f $SESSION )" \ |
| 4015 | 0 \ |
| 4016 | -s "found session ticket extension" \ |
| 4017 | -s "server hello, adding session ticket extension" \ |
| 4018 | -S "session successfully restored from cache" \ |
| 4019 | -s "session successfully restored from ticket" \ |
| 4020 | -s "a session has been resumed" |
| 4021 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4022 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4023 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4025 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4026 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4027 | "$P_SRV debug_level=3 tickets=0" \ |
| 4028 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4029 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4030 | -c "client hello, adding session ticket extension" \ |
| 4031 | -s "found session ticket extension" \ |
| 4032 | -S "server hello, adding session ticket extension" \ |
| 4033 | -C "found session_ticket extension" \ |
| 4034 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4035 | -s "session successfully restored from cache" \ |
| 4036 | -S "session successfully restored from ticket" \ |
| 4037 | -s "a session has been resumed" \ |
| 4038 | -c "a session has been resumed" |
| 4039 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4041 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4042 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4043 | "$P_SRV debug_level=3 tickets=1" \ |
| 4044 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4045 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4046 | -C "client hello, adding session ticket extension" \ |
| 4047 | -S "found session ticket extension" \ |
| 4048 | -S "server hello, adding session ticket extension" \ |
| 4049 | -C "found session_ticket extension" \ |
| 4050 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4051 | -s "session successfully restored from cache" \ |
| 4052 | -S "session successfully restored from ticket" \ |
| 4053 | -s "a session has been resumed" \ |
| 4054 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4055 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4057 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4058 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4059 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 4060 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4061 | 0 \ |
| 4062 | -S "session successfully restored from cache" \ |
| 4063 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4064 | -S "a session has been resumed" \ |
| 4065 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4066 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4068 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4069 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4070 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 4071 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4072 | 0 \ |
| 4073 | -s "session successfully restored from cache" \ |
| 4074 | -S "session successfully restored from ticket" \ |
| 4075 | -s "a session has been resumed" \ |
| 4076 | -c "a session has been resumed" |
| 4077 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4079 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame^] | 4080 | run_test "Session resume using cache: cache removed" \ |
| 4081 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
| 4082 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
| 4083 | 0 \ |
| 4084 | -C "client hello, adding session ticket extension" \ |
| 4085 | -S "found session ticket extension" \ |
| 4086 | -S "server hello, adding session ticket extension" \ |
| 4087 | -C "found session_ticket extension" \ |
| 4088 | -C "parse new session ticket" \ |
| 4089 | -S "session successfully restored from cache" \ |
| 4090 | -S "session successfully restored from ticket" \ |
| 4091 | -S "a session has been resumed" \ |
| 4092 | -C "a session has been resumed" |
| 4093 | |
| 4094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4095 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4096 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4097 | "$P_SRV debug_level=3 tickets=0" \ |
| 4098 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4099 | 0 \ |
| 4100 | -s "session successfully restored from cache" \ |
| 4101 | -S "session successfully restored from ticket" \ |
| 4102 | -s "a session has been resumed" \ |
| 4103 | -c "a session has been resumed" |
| 4104 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4106 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4107 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4108 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4109 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4110 | 0 \ |
| 4111 | -S "session successfully restored from cache" \ |
| 4112 | -S "session successfully restored from ticket" \ |
| 4113 | -S "a session has been resumed" \ |
| 4114 | -C "a session has been resumed" |
| 4115 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4117 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4118 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4119 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4120 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4121 | 0 \ |
| 4122 | -s "session successfully restored from cache" \ |
| 4123 | -S "session successfully restored from ticket" \ |
| 4124 | -s "a session has been resumed" \ |
| 4125 | -c "a session has been resumed" |
| 4126 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4128 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4129 | run_test "Session resume using cache: session copy" \ |
| 4130 | "$P_SRV debug_level=3 tickets=0" \ |
| 4131 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 4132 | 0 \ |
| 4133 | -s "session successfully restored from cache" \ |
| 4134 | -S "session successfully restored from ticket" \ |
| 4135 | -s "a session has been resumed" \ |
| 4136 | -c "a session has been resumed" |
| 4137 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4139 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4140 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4141 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4142 | "( $O_CLI -sess_out $SESSION; \ |
| 4143 | $O_CLI -sess_in $SESSION; \ |
| 4144 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4145 | 0 \ |
| 4146 | -s "found session ticket extension" \ |
| 4147 | -S "server hello, adding session ticket extension" \ |
| 4148 | -s "session successfully restored from cache" \ |
| 4149 | -S "session successfully restored from ticket" \ |
| 4150 | -s "a session has been resumed" |
| 4151 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4153 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4154 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4155 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4156 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4157 | 0 \ |
| 4158 | -C "found session_ticket extension" \ |
| 4159 | -C "parse new session ticket" \ |
| 4160 | -c "a session has been resumed" |
| 4161 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4162 | # Tests for Session resume and extensions |
| 4163 | |
| 4164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4165 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4166 | run_test "Session resume and connection ID" \ |
| 4167 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4168 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4169 | 0 \ |
| 4170 | -c "Enable use of CID extension." \ |
| 4171 | -s "Enable use of CID extension." \ |
| 4172 | -c "client hello, adding CID extension" \ |
| 4173 | -s "found CID extension" \ |
| 4174 | -s "Use of CID extension negotiated" \ |
| 4175 | -s "server hello, adding CID extension" \ |
| 4176 | -c "found CID extension" \ |
| 4177 | -c "Use of CID extension negotiated" \ |
| 4178 | -s "Copy CIDs into SSL transform" \ |
| 4179 | -c "Copy CIDs into SSL transform" \ |
| 4180 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4181 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4182 | -s "Use of Connection ID has been negotiated" \ |
| 4183 | -c "Use of Connection ID has been negotiated" |
| 4184 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4185 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4186 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4188 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4189 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4190 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4191 | "$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] | 4192 | 0 \ |
| 4193 | -c "client hello, adding session ticket extension" \ |
| 4194 | -s "found session ticket extension" \ |
| 4195 | -S "server hello, adding session ticket extension" \ |
| 4196 | -C "found session_ticket extension" \ |
| 4197 | -C "parse new session ticket" \ |
| 4198 | -s "session successfully restored from cache" \ |
| 4199 | -S "session successfully restored from ticket" \ |
| 4200 | -s "a session has been resumed" \ |
| 4201 | -c "a session has been resumed" |
| 4202 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4204 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4205 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4206 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4207 | "$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] | 4208 | 0 \ |
| 4209 | -C "client hello, adding session ticket extension" \ |
| 4210 | -S "found session ticket extension" \ |
| 4211 | -S "server hello, adding session ticket extension" \ |
| 4212 | -C "found session_ticket extension" \ |
| 4213 | -C "parse new session ticket" \ |
| 4214 | -s "session successfully restored from cache" \ |
| 4215 | -S "session successfully restored from ticket" \ |
| 4216 | -s "a session has been resumed" \ |
| 4217 | -c "a session has been resumed" |
| 4218 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4220 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4221 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4222 | "$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] | 4223 | "$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] | 4224 | 0 \ |
| 4225 | -S "session successfully restored from cache" \ |
| 4226 | -S "session successfully restored from ticket" \ |
| 4227 | -S "a session has been resumed" \ |
| 4228 | -C "a session has been resumed" |
| 4229 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4231 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4232 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4233 | "$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] | 4234 | "$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] | 4235 | 0 \ |
| 4236 | -s "session successfully restored from cache" \ |
| 4237 | -S "session successfully restored from ticket" \ |
| 4238 | -s "a session has been resumed" \ |
| 4239 | -c "a session has been resumed" |
| 4240 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4241 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4242 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4243 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4244 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4245 | "$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] | 4246 | 0 \ |
| 4247 | -s "session successfully restored from cache" \ |
| 4248 | -S "session successfully restored from ticket" \ |
| 4249 | -s "a session has been resumed" \ |
| 4250 | -c "a session has been resumed" |
| 4251 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4253 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4254 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4255 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4256 | "$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] | 4257 | 0 \ |
| 4258 | -S "session successfully restored from cache" \ |
| 4259 | -S "session successfully restored from ticket" \ |
| 4260 | -S "a session has been resumed" \ |
| 4261 | -C "a session has been resumed" |
| 4262 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4264 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4265 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4266 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4267 | "$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] | 4268 | 0 \ |
| 4269 | -s "session successfully restored from cache" \ |
| 4270 | -S "session successfully restored from ticket" \ |
| 4271 | -s "a session has been resumed" \ |
| 4272 | -c "a session has been resumed" |
| 4273 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4276 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4277 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4278 | "$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] | 4279 | 0 \ |
| 4280 | -s "session successfully restored from cache" \ |
| 4281 | -S "session successfully restored from ticket" \ |
| 4282 | -s "a session has been resumed" \ |
| 4283 | -c "a session has been resumed" |
| 4284 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4285 | # 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] | 4286 | # 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] | 4287 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4289 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4290 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4291 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4292 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4293 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4294 | rm -f $SESSION )" \ |
| 4295 | 0 \ |
| 4296 | -s "found session ticket extension" \ |
| 4297 | -S "server hello, adding session ticket extension" \ |
| 4298 | -s "session successfully restored from cache" \ |
| 4299 | -S "session successfully restored from ticket" \ |
| 4300 | -s "a session has been resumed" |
| 4301 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4303 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4304 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4305 | "$O_SRV -dtls" \ |
| 4306 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4307 | 0 \ |
| 4308 | -C "found session_ticket extension" \ |
| 4309 | -C "parse new session ticket" \ |
| 4310 | -c "a session has been resumed" |
| 4311 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4312 | # Tests for Max Fragment Length extension |
| 4313 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4314 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4316 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4317 | "$P_SRV debug_level=3" \ |
| 4318 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4319 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4320 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4321 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4322 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4323 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4324 | -C "client hello, adding max_fragment_length extension" \ |
| 4325 | -S "found max fragment length extension" \ |
| 4326 | -S "server hello, max_fragment_length extension" \ |
| 4327 | -C "found max_fragment_length extension" |
| 4328 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4329 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4331 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4332 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4333 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4334 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4335 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4336 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4337 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4338 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4339 | -C "client hello, adding max_fragment_length extension" \ |
| 4340 | -S "found max fragment length extension" \ |
| 4341 | -S "server hello, max_fragment_length extension" \ |
| 4342 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4343 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4344 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4345 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4346 | |
| 4347 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4349 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4350 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4351 | "$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] | 4352 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4353 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4354 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4355 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4356 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [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 | -c "fragment larger than.*maximum " |
| 4362 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4363 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4364 | # (session fragment length will be 16384 regardless of mbedtls |
| 4365 | # content length configuration.) |
| 4366 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4367 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4369 | run_test "Max fragment length: disabled, larger message" \ |
| 4370 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4371 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4372 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4373 | -C "Maximum incoming record payload length is 16384" \ |
| 4374 | -C "Maximum outgoing record payload length is 16384" \ |
| 4375 | -S "Maximum incoming record payload length is 16384" \ |
| 4376 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4377 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4378 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4379 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4380 | |
| 4381 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4383 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4384 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4385 | "$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] | 4386 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4387 | -C "Maximum incoming record payload length is 16384" \ |
| 4388 | -C "Maximum outgoing record payload length is 16384" \ |
| 4389 | -S "Maximum incoming record payload length is 16384" \ |
| 4390 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4391 | -c "fragment larger than.*maximum " |
| 4392 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4393 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4394 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4396 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4397 | "$P_SRV debug_level=3" \ |
| 4398 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4399 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4400 | -c "Maximum incoming record payload length is 4096" \ |
| 4401 | -c "Maximum outgoing record payload length is 4096" \ |
| 4402 | -s "Maximum incoming record payload length is 4096" \ |
| 4403 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4404 | -c "client hello, adding max_fragment_length extension" \ |
| 4405 | -s "found max fragment length extension" \ |
| 4406 | -s "server hello, max_fragment_length extension" \ |
| 4407 | -c "found max_fragment_length extension" |
| 4408 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4409 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4410 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4412 | run_test "Max fragment length: client 512, server 1024" \ |
| 4413 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4414 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4415 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4416 | -c "Maximum incoming record payload length is 512" \ |
| 4417 | -c "Maximum outgoing record payload length is 512" \ |
| 4418 | -s "Maximum incoming record payload length is 512" \ |
| 4419 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4420 | -c "client hello, adding max_fragment_length extension" \ |
| 4421 | -s "found max fragment length extension" \ |
| 4422 | -s "server hello, max_fragment_length extension" \ |
| 4423 | -c "found max_fragment_length extension" |
| 4424 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4425 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4426 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4428 | run_test "Max fragment length: client 512, server 2048" \ |
| 4429 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4430 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4431 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4432 | -c "Maximum incoming record payload length is 512" \ |
| 4433 | -c "Maximum outgoing record payload length is 512" \ |
| 4434 | -s "Maximum incoming record payload length is 512" \ |
| 4435 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4436 | -c "client hello, adding max_fragment_length extension" \ |
| 4437 | -s "found max fragment length extension" \ |
| 4438 | -s "server hello, max_fragment_length extension" \ |
| 4439 | -c "found max_fragment_length extension" |
| 4440 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4441 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4442 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4444 | run_test "Max fragment length: client 512, server 4096" \ |
| 4445 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4446 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4447 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4448 | -c "Maximum incoming record payload length is 512" \ |
| 4449 | -c "Maximum outgoing record payload length is 512" \ |
| 4450 | -s "Maximum incoming record payload length is 512" \ |
| 4451 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4452 | -c "client hello, adding max_fragment_length extension" \ |
| 4453 | -s "found max fragment length extension" \ |
| 4454 | -s "server hello, max_fragment_length extension" \ |
| 4455 | -c "found max_fragment_length extension" |
| 4456 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4457 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4458 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4460 | run_test "Max fragment length: client 1024, server 512" \ |
| 4461 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4462 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4463 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4464 | -c "Maximum incoming record payload length is 1024" \ |
| 4465 | -c "Maximum outgoing record payload length is 1024" \ |
| 4466 | -s "Maximum incoming record payload length is 1024" \ |
| 4467 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4468 | -c "client hello, adding max_fragment_length extension" \ |
| 4469 | -s "found max fragment length extension" \ |
| 4470 | -s "server hello, max_fragment_length extension" \ |
| 4471 | -c "found max_fragment_length extension" |
| 4472 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4473 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4474 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4476 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4477 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4478 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4479 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4480 | -c "Maximum incoming record payload length is 1024" \ |
| 4481 | -c "Maximum outgoing record payload length is 1024" \ |
| 4482 | -s "Maximum incoming record payload length is 1024" \ |
| 4483 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4484 | -c "client hello, adding max_fragment_length extension" \ |
| 4485 | -s "found max fragment length extension" \ |
| 4486 | -s "server hello, max_fragment_length extension" \ |
| 4487 | -c "found max_fragment_length extension" |
| 4488 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4489 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4490 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4492 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4493 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4494 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4495 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4496 | -c "Maximum incoming record payload length is 1024" \ |
| 4497 | -c "Maximum outgoing record payload length is 1024" \ |
| 4498 | -s "Maximum incoming record payload length is 1024" \ |
| 4499 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4500 | -c "client hello, adding max_fragment_length extension" \ |
| 4501 | -s "found max fragment length extension" \ |
| 4502 | -s "server hello, max_fragment_length extension" \ |
| 4503 | -c "found max_fragment_length extension" |
| 4504 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4505 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4506 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4508 | run_test "Max fragment length: client 2048, server 512" \ |
| 4509 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4510 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4511 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4512 | -c "Maximum incoming record payload length is 2048" \ |
| 4513 | -c "Maximum outgoing record payload length is 2048" \ |
| 4514 | -s "Maximum incoming record payload length is 2048" \ |
| 4515 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4516 | -c "client hello, adding max_fragment_length extension" \ |
| 4517 | -s "found max fragment length extension" \ |
| 4518 | -s "server hello, max_fragment_length extension" \ |
| 4519 | -c "found max_fragment_length extension" |
| 4520 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4521 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4522 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4524 | run_test "Max fragment length: client 2048, server 1024" \ |
| 4525 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4526 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4527 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4528 | -c "Maximum incoming record payload length is 2048" \ |
| 4529 | -c "Maximum outgoing record payload length is 2048" \ |
| 4530 | -s "Maximum incoming record payload length is 2048" \ |
| 4531 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4532 | -c "client hello, adding max_fragment_length extension" \ |
| 4533 | -s "found max fragment length extension" \ |
| 4534 | -s "server hello, max_fragment_length extension" \ |
| 4535 | -c "found max_fragment_length extension" |
| 4536 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4537 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4538 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4540 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4541 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4542 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4543 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4544 | -c "Maximum incoming record payload length is 2048" \ |
| 4545 | -c "Maximum outgoing record payload length is 2048" \ |
| 4546 | -s "Maximum incoming record payload length is 2048" \ |
| 4547 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4548 | -c "client hello, adding max_fragment_length extension" \ |
| 4549 | -s "found max fragment length extension" \ |
| 4550 | -s "server hello, max_fragment_length extension" \ |
| 4551 | -c "found max_fragment_length extension" |
| 4552 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4553 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4554 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4556 | run_test "Max fragment length: client 4096, server 512" \ |
| 4557 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4558 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4559 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4560 | -c "Maximum incoming record payload length is 4096" \ |
| 4561 | -c "Maximum outgoing record payload length is 4096" \ |
| 4562 | -s "Maximum incoming record payload length is 4096" \ |
| 4563 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4564 | -c "client hello, adding max_fragment_length extension" \ |
| 4565 | -s "found max fragment length extension" \ |
| 4566 | -s "server hello, max_fragment_length extension" \ |
| 4567 | -c "found max_fragment_length extension" |
| 4568 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4569 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4570 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4572 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4573 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4574 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4575 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4576 | -c "Maximum incoming record payload length is 4096" \ |
| 4577 | -c "Maximum outgoing record payload length is 4096" \ |
| 4578 | -s "Maximum incoming record payload length is 4096" \ |
| 4579 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4585 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4586 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4588 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4589 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4590 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4591 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4592 | -c "Maximum incoming record payload length is 4096" \ |
| 4593 | -c "Maximum outgoing record payload length is 4096" \ |
| 4594 | -s "Maximum incoming record payload length is 4096" \ |
| 4595 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4596 | -c "client hello, adding max_fragment_length extension" \ |
| 4597 | -s "found max fragment length extension" \ |
| 4598 | -s "server hello, max_fragment_length extension" \ |
| 4599 | -c "found max_fragment_length extension" |
| 4600 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4601 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4602 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4604 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4605 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4606 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4607 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4608 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4609 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4610 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4611 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4612 | -C "client hello, adding max_fragment_length extension" \ |
| 4613 | -S "found max fragment length extension" \ |
| 4614 | -S "server hello, max_fragment_length extension" \ |
| 4615 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4616 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4617 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4618 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4619 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4621 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4622 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4623 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4624 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4625 | -c "Maximum incoming record payload length is 4096" \ |
| 4626 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4627 | -c "client hello, adding max_fragment_length extension" \ |
| 4628 | -c "found max_fragment_length extension" |
| 4629 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4630 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4631 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4633 | run_test "Max fragment length: client, message just fits" \ |
| 4634 | "$P_SRV debug_level=3" \ |
| 4635 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4636 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4637 | -c "Maximum incoming record payload length is 2048" \ |
| 4638 | -c "Maximum outgoing record payload length is 2048" \ |
| 4639 | -s "Maximum incoming record payload length is 2048" \ |
| 4640 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4641 | -c "client hello, adding max_fragment_length extension" \ |
| 4642 | -s "found max fragment length extension" \ |
| 4643 | -s "server hello, max_fragment_length extension" \ |
| 4644 | -c "found max_fragment_length extension" \ |
| 4645 | -c "2048 bytes written in 1 fragments" \ |
| 4646 | -s "2048 bytes read" |
| 4647 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4648 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4649 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4651 | run_test "Max fragment length: client, larger message" \ |
| 4652 | "$P_SRV debug_level=3" \ |
| 4653 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4654 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4655 | -c "Maximum incoming record payload length is 2048" \ |
| 4656 | -c "Maximum outgoing record payload length is 2048" \ |
| 4657 | -s "Maximum incoming record payload length is 2048" \ |
| 4658 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4659 | -c "client hello, adding max_fragment_length extension" \ |
| 4660 | -s "found max fragment length extension" \ |
| 4661 | -s "server hello, max_fragment_length extension" \ |
| 4662 | -c "found max_fragment_length extension" \ |
| 4663 | -c "2345 bytes written in 2 fragments" \ |
| 4664 | -s "2048 bytes read" \ |
| 4665 | -s "297 bytes read" |
| 4666 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4667 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4668 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4670 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4671 | "$P_SRV debug_level=3 dtls=1" \ |
| 4672 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4673 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4674 | -c "Maximum incoming record payload length is 2048" \ |
| 4675 | -c "Maximum outgoing record payload length is 2048" \ |
| 4676 | -s "Maximum incoming record payload length is 2048" \ |
| 4677 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4678 | -c "client hello, adding max_fragment_length extension" \ |
| 4679 | -s "found max fragment length extension" \ |
| 4680 | -s "server hello, max_fragment_length extension" \ |
| 4681 | -c "found max_fragment_length extension" \ |
| 4682 | -c "fragment larger than.*maximum" |
| 4683 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4684 | # Tests for Record Size Limit extension |
| 4685 | |
| 4686 | # gnutls feature tests: check if the record size limit extension is supported with TLS 1.2. |
| 4687 | requires_gnutls_record_size_limit |
| 4688 | run_test "Record Size Limit: Test gnutls record size limit feature" \ |
| 4689 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+CIPHER-ALL --disable-client-cert -d 4" \ |
| 4690 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2 -V -d 4" \ |
| 4691 | 0 \ |
| 4692 | -c "Preparing extension (Record Size Limit/28) for 'client hello'"\ |
| 4693 | -s "Parsing extension 'Record Size Limit/28' (2 bytes)" \ |
| 4694 | -s "Preparing extension (Record Size Limit/28) for 'TLS 1.2 server hello'" \ |
| 4695 | -c "Parsing extension 'Record Size Limit/28' (2 bytes)" \ |
| 4696 | -s "Version: TLS1.2" \ |
| 4697 | -c "Version: TLS1.2" |
| 4698 | |
| 4699 | # gnutls feature tests: check if the record size limit extension is supported with TLS 1.3. |
| 4700 | requires_gnutls_tls1_3 |
| 4701 | requires_gnutls_record_size_limit |
| 4702 | run_test "Record Size Limit: TLS 1.3: Test gnutls record size limit feature" \ |
| 4703 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL --disable-client-cert -d 4" \ |
| 4704 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \ |
| 4705 | 0 \ |
| 4706 | -c "Preparing extension (Record Size Limit/28) for 'client hello'"\ |
| 4707 | -s "Parsing extension 'Record Size Limit/28' (2 bytes)" \ |
| 4708 | -s "Preparing extension (Record Size Limit/28) for 'encrypted extensions'" \ |
| 4709 | -c "Parsing extension 'Record Size Limit/28' (2 bytes)" \ |
| 4710 | -s "Version: TLS1.3" \ |
| 4711 | -c "Version: TLS1.3" |
| 4712 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4713 | # Tests for renegotiation |
| 4714 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4715 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4717 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4718 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4719 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4720 | 0 \ |
| 4721 | -C "client hello, adding renegotiation extension" \ |
| 4722 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4723 | -S "found renegotiation extension" \ |
| 4724 | -s "server hello, secure renegotiation extension" \ |
| 4725 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4726 | -C "=> renegotiate" \ |
| 4727 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4728 | -S "write hello request" |
| 4729 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4730 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4732 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4733 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4734 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4735 | 0 \ |
| 4736 | -c "client hello, adding renegotiation extension" \ |
| 4737 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4738 | -s "found renegotiation extension" \ |
| 4739 | -s "server hello, secure renegotiation extension" \ |
| 4740 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4741 | -c "=> renegotiate" \ |
| 4742 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4743 | -S "write hello request" |
| 4744 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4745 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4747 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4748 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4749 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4750 | 0 \ |
| 4751 | -c "client hello, adding renegotiation extension" \ |
| 4752 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4753 | -s "found renegotiation extension" \ |
| 4754 | -s "server hello, secure renegotiation extension" \ |
| 4755 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4756 | -c "=> renegotiate" \ |
| 4757 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4758 | -s "write hello request" |
| 4759 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4760 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4761 | # 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] | 4762 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4763 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4765 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4766 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4767 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4768 | 0 \ |
| 4769 | -c "client hello, adding renegotiation extension" \ |
| 4770 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4771 | -s "found renegotiation extension" \ |
| 4772 | -s "server hello, secure renegotiation extension" \ |
| 4773 | -c "found renegotiation extension" \ |
| 4774 | -c "=> renegotiate" \ |
| 4775 | -s "=> renegotiate" \ |
| 4776 | -S "write hello request" \ |
| 4777 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4778 | |
| 4779 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4780 | # 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] | 4781 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4782 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4784 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4785 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4786 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4787 | 0 \ |
| 4788 | -c "client hello, adding renegotiation extension" \ |
| 4789 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4790 | -s "found renegotiation extension" \ |
| 4791 | -s "server hello, secure renegotiation extension" \ |
| 4792 | -c "found renegotiation extension" \ |
| 4793 | -c "=> renegotiate" \ |
| 4794 | -s "=> renegotiate" \ |
| 4795 | -s "write hello request" \ |
| 4796 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4797 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4798 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4800 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4801 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4802 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4803 | 0 \ |
| 4804 | -c "client hello, adding renegotiation extension" \ |
| 4805 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4806 | -s "found renegotiation extension" \ |
| 4807 | -s "server hello, secure renegotiation extension" \ |
| 4808 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4809 | -c "=> renegotiate" \ |
| 4810 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4811 | -s "write hello request" |
| 4812 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4813 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4814 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4815 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4817 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4818 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4819 | "$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" \ |
| 4820 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4821 | -c "Maximum incoming record payload length is 2048" \ |
| 4822 | -c "Maximum outgoing record payload length is 2048" \ |
| 4823 | -s "Maximum incoming record payload length is 2048" \ |
| 4824 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4825 | -c "client hello, adding max_fragment_length extension" \ |
| 4826 | -s "found max fragment length extension" \ |
| 4827 | -s "server hello, max_fragment_length extension" \ |
| 4828 | -c "found max_fragment_length extension" \ |
| 4829 | -c "client hello, adding renegotiation extension" \ |
| 4830 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4831 | -s "found renegotiation extension" \ |
| 4832 | -s "server hello, secure renegotiation extension" \ |
| 4833 | -c "found renegotiation extension" \ |
| 4834 | -c "=> renegotiate" \ |
| 4835 | -s "=> renegotiate" \ |
| 4836 | -s "write hello request" |
| 4837 | |
| 4838 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4840 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4841 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4842 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4843 | 1 \ |
| 4844 | -c "client hello, adding renegotiation extension" \ |
| 4845 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4846 | -S "found renegotiation extension" \ |
| 4847 | -s "server hello, secure renegotiation extension" \ |
| 4848 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4849 | -c "=> renegotiate" \ |
| 4850 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4851 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4852 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4853 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4854 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4855 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4856 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4857 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4858 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4859 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4860 | 0 \ |
| 4861 | -C "client hello, adding renegotiation extension" \ |
| 4862 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4863 | -S "found renegotiation extension" \ |
| 4864 | -s "server hello, secure renegotiation extension" \ |
| 4865 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4866 | -C "=> renegotiate" \ |
| 4867 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4868 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4869 | -S "SSL - An unexpected message was received from our peer" \ |
| 4870 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4871 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4872 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4874 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4875 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4876 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4877 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [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 | -C "=> renegotiate" \ |
| 4885 | -S "=> renegotiate" \ |
| 4886 | -s "write hello request" \ |
| 4887 | -S "SSL - An unexpected message was received from our peer" \ |
| 4888 | -S "failed" |
| 4889 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4890 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4891 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4893 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4894 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4895 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4896 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4897 | 0 \ |
| 4898 | -C "client hello, adding renegotiation extension" \ |
| 4899 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4900 | -S "found renegotiation extension" \ |
| 4901 | -s "server hello, secure renegotiation extension" \ |
| 4902 | -c "found renegotiation extension" \ |
| 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 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4911 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4912 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4913 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4914 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4915 | 0 \ |
| 4916 | -C "client hello, adding renegotiation extension" \ |
| 4917 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4918 | -S "found renegotiation extension" \ |
| 4919 | -s "server hello, secure renegotiation extension" \ |
| 4920 | -c "found renegotiation extension" \ |
| 4921 | -C "=> renegotiate" \ |
| 4922 | -S "=> renegotiate" \ |
| 4923 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4924 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4925 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4926 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4928 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4929 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4930 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4931 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4932 | 0 \ |
| 4933 | -c "client hello, adding renegotiation extension" \ |
| 4934 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4935 | -s "found renegotiation extension" \ |
| 4936 | -s "server hello, secure renegotiation extension" \ |
| 4937 | -c "found renegotiation extension" \ |
| 4938 | -c "=> renegotiate" \ |
| 4939 | -s "=> renegotiate" \ |
| 4940 | -s "write hello request" \ |
| 4941 | -S "SSL - An unexpected message was received from our peer" \ |
| 4942 | -S "failed" |
| 4943 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4944 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4946 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4947 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4948 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4949 | 0 \ |
| 4950 | -C "client hello, adding renegotiation extension" \ |
| 4951 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4952 | -S "found renegotiation extension" \ |
| 4953 | -s "server hello, secure renegotiation extension" \ |
| 4954 | -c "found renegotiation extension" \ |
| 4955 | -S "record counter limit reached: renegotiate" \ |
| 4956 | -C "=> renegotiate" \ |
| 4957 | -S "=> renegotiate" \ |
| 4958 | -S "write hello request" \ |
| 4959 | -S "SSL - An unexpected message was received from our peer" \ |
| 4960 | -S "failed" |
| 4961 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4962 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4963 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4965 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4966 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4967 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4968 | 0 \ |
| 4969 | -c "client hello, adding renegotiation extension" \ |
| 4970 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4971 | -s "found renegotiation extension" \ |
| 4972 | -s "server hello, secure renegotiation extension" \ |
| 4973 | -c "found renegotiation extension" \ |
| 4974 | -s "record counter limit reached: renegotiate" \ |
| 4975 | -c "=> renegotiate" \ |
| 4976 | -s "=> renegotiate" \ |
| 4977 | -s "write hello request" \ |
| 4978 | -S "SSL - An unexpected message was received from our peer" \ |
| 4979 | -S "failed" |
| 4980 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4981 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4983 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4984 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4985 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4986 | 0 \ |
| 4987 | -c "client hello, adding renegotiation extension" \ |
| 4988 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4989 | -s "found renegotiation extension" \ |
| 4990 | -s "server hello, secure renegotiation extension" \ |
| 4991 | -c "found renegotiation extension" \ |
| 4992 | -s "record counter limit reached: renegotiate" \ |
| 4993 | -c "=> renegotiate" \ |
| 4994 | -s "=> renegotiate" \ |
| 4995 | -s "write hello request" \ |
| 4996 | -S "SSL - An unexpected message was received from our peer" \ |
| 4997 | -S "failed" |
| 4998 | |
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 | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5001 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5002 | "$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5003 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5004 | 0 \ |
| 5005 | -C "client hello, adding renegotiation extension" \ |
| 5006 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5007 | -S "found renegotiation extension" \ |
| 5008 | -s "server hello, secure renegotiation extension" \ |
| 5009 | -c "found renegotiation extension" \ |
| 5010 | -S "record counter limit reached: renegotiate" \ |
| 5011 | -C "=> renegotiate" \ |
| 5012 | -S "=> renegotiate" \ |
| 5013 | -S "write hello request" \ |
| 5014 | -S "SSL - An unexpected message was received from our peer" \ |
| 5015 | -S "failed" |
| 5016 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5017 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5019 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5020 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5021 | "$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 5022 | 0 \ |
| 5023 | -c "client hello, adding renegotiation extension" \ |
| 5024 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5025 | -s "found renegotiation extension" \ |
| 5026 | -s "server hello, secure renegotiation extension" \ |
| 5027 | -c "found renegotiation extension" \ |
| 5028 | -c "=> renegotiate" \ |
| 5029 | -s "=> renegotiate" \ |
| 5030 | -S "write hello request" |
| 5031 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5032 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5034 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5035 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5036 | "$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] | 5037 | 0 \ |
| 5038 | -c "client hello, adding renegotiation extension" \ |
| 5039 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5040 | -s "found renegotiation extension" \ |
| 5041 | -s "server hello, secure renegotiation extension" \ |
| 5042 | -c "found renegotiation extension" \ |
| 5043 | -c "=> renegotiate" \ |
| 5044 | -s "=> renegotiate" \ |
| 5045 | -s "write hello request" |
| 5046 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5047 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5049 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5050 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5051 | "$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] | 5052 | 0 \ |
| 5053 | -c "client hello, adding renegotiation extension" \ |
| 5054 | -c "found renegotiation extension" \ |
| 5055 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5056 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5057 | -C "error" \ |
| 5058 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5059 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5060 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5061 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5063 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5064 | "$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] | 5065 | "$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] | 5066 | 0 \ |
| 5067 | -c "client hello, adding renegotiation extension" \ |
| 5068 | -c "found renegotiation extension" \ |
| 5069 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5070 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5071 | -C "error" \ |
| 5072 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5073 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5074 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5075 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5077 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5078 | "$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] | 5079 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5080 | 1 \ |
| 5081 | -c "client hello, adding renegotiation extension" \ |
| 5082 | -C "found renegotiation extension" \ |
| 5083 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5084 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5085 | -c "error" \ |
| 5086 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5087 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [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 | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5091 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5092 | "$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] | 5093 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5094 | allow_legacy=0" \ |
| 5095 | 1 \ |
| 5096 | -c "client hello, adding renegotiation extension" \ |
| 5097 | -C "found renegotiation extension" \ |
| 5098 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5099 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5100 | -c "error" \ |
| 5101 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5102 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5103 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5104 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
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 "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5107 | "$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] | 5108 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5109 | allow_legacy=1" \ |
| 5110 | 0 \ |
| 5111 | -c "client hello, adding renegotiation extension" \ |
| 5112 | -C "found renegotiation extension" \ |
| 5113 | -c "=> renegotiate" \ |
| 5114 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5115 | -C "error" \ |
| 5116 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5117 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5118 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5120 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5121 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5122 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5123 | 0 \ |
| 5124 | -c "client hello, adding renegotiation extension" \ |
| 5125 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5126 | -s "found renegotiation extension" \ |
| 5127 | -s "server hello, secure renegotiation extension" \ |
| 5128 | -c "found renegotiation extension" \ |
| 5129 | -c "=> renegotiate" \ |
| 5130 | -s "=> renegotiate" \ |
| 5131 | -S "write hello request" |
| 5132 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5133 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5135 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5136 | "$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] | 5137 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5138 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5139 | 0 \ |
| 5140 | -c "client hello, adding renegotiation extension" \ |
| 5141 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5142 | -s "found renegotiation extension" \ |
| 5143 | -s "server hello, secure renegotiation extension" \ |
| 5144 | -c "found renegotiation extension" \ |
| 5145 | -c "=> renegotiate" \ |
| 5146 | -s "=> renegotiate" \ |
| 5147 | -s "write hello request" |
| 5148 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5149 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5151 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5152 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5153 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5154 | 0 \ |
| 5155 | -c "client hello, adding renegotiation extension" \ |
| 5156 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5157 | -s "found renegotiation extension" \ |
| 5158 | -s "server hello, secure renegotiation extension" \ |
| 5159 | -s "record counter limit reached: renegotiate" \ |
| 5160 | -c "=> renegotiate" \ |
| 5161 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5162 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5163 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5164 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5165 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5167 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5168 | "$G_SRV -u --mtu 4096" \ |
| 5169 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5170 | 0 \ |
| 5171 | -c "client hello, adding renegotiation extension" \ |
| 5172 | -c "found renegotiation extension" \ |
| 5173 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5174 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5175 | -C "error" \ |
| 5176 | -s "Extra-header:" |
| 5177 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5178 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5179 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5180 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5182 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5183 | "$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] | 5184 | "$P_CLI debug_level=3" \ |
| 5185 | 0 \ |
| 5186 | -c "found renegotiation extension" \ |
| 5187 | -C "error" \ |
| 5188 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5189 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5190 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5192 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5193 | "$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] | 5194 | "$P_CLI debug_level=3" \ |
| 5195 | 0 \ |
| 5196 | -C "found renegotiation extension" \ |
| 5197 | -C "error" \ |
| 5198 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5199 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5200 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5202 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5203 | "$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] | 5204 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5205 | 1 \ |
| 5206 | -C "found renegotiation extension" \ |
| 5207 | -c "error" \ |
| 5208 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5209 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5210 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5212 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5213 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5214 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5215 | 0 \ |
| 5216 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5217 | -s "server hello, secure renegotiation extension" |
| 5218 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5219 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5221 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5222 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5223 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5224 | 0 \ |
| 5225 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5226 | -S "server hello, secure renegotiation extension" |
| 5227 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5228 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5230 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5231 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5232 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5233 | 1 \ |
| 5234 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5235 | -S "server hello, secure renegotiation extension" |
| 5236 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5237 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5238 | |
| 5239 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5241 | run_test "DER format: no trailing bytes" \ |
| 5242 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5243 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5244 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5245 | 0 \ |
| 5246 | -c "Handshake was completed" \ |
| 5247 | |
| 5248 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5249 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5250 | run_test "DER format: with a trailing zero byte" \ |
| 5251 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5252 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5253 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5254 | 0 \ |
| 5255 | -c "Handshake was completed" \ |
| 5256 | |
| 5257 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5259 | run_test "DER format: with a trailing random byte" \ |
| 5260 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5261 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5262 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5263 | 0 \ |
| 5264 | -c "Handshake was completed" \ |
| 5265 | |
| 5266 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5268 | run_test "DER format: with 2 trailing random bytes" \ |
| 5269 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5270 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5271 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5272 | 0 \ |
| 5273 | -c "Handshake was completed" \ |
| 5274 | |
| 5275 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5277 | run_test "DER format: with 4 trailing random bytes" \ |
| 5278 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5279 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5280 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5281 | 0 \ |
| 5282 | -c "Handshake was completed" \ |
| 5283 | |
| 5284 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5286 | run_test "DER format: with 8 trailing random bytes" \ |
| 5287 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5288 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5289 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5290 | 0 \ |
| 5291 | -c "Handshake was completed" \ |
| 5292 | |
| 5293 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5295 | run_test "DER format: with 9 trailing random bytes" \ |
| 5296 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5297 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5298 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5299 | 0 \ |
| 5300 | -c "Handshake was completed" \ |
| 5301 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5302 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5303 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5304 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5305 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5306 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5307 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5308 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5309 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5310 | 1 \ |
| 5311 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5312 | -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] | 5313 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5314 | -c "X509 - Certificate verification failed" |
| 5315 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5317 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5318 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5319 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5320 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5321 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5322 | 0 \ |
| 5323 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5324 | -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] | 5325 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5326 | -C "X509 - Certificate verification failed" |
| 5327 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5329 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5330 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5331 | "$P_SRV" \ |
| 5332 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5333 | 0 \ |
| 5334 | -c "x509_verify_cert() returned" \ |
| 5335 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5336 | -c "! Certificate verification flags"\ |
| 5337 | -C "! mbedtls_ssl_handshake returned" \ |
| 5338 | -C "X509 - Certificate verification failed" \ |
| 5339 | -C "SSL - No CA Chain is set, but required to operate" |
| 5340 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5341 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5342 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5343 | "$P_SRV" \ |
| 5344 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5345 | 1 \ |
| 5346 | -c "x509_verify_cert() returned" \ |
| 5347 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5348 | -c "! Certificate verification flags"\ |
| 5349 | -c "! mbedtls_ssl_handshake returned" \ |
| 5350 | -c "SSL - No CA Chain is set, but required to operate" |
| 5351 | |
| 5352 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5353 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5354 | # the client informs the server about the supported curves - it does, though, in the |
| 5355 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5356 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5357 | # different means to have the server ignoring the client's supported curve list. |
| 5358 | |
| 5359 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5361 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5362 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5363 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5364 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5365 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5366 | 1 \ |
| 5367 | -c "bad certificate (EC key curve)"\ |
| 5368 | -c "! Certificate verification flags"\ |
| 5369 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5370 | |
| 5371 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5373 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5374 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5375 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5376 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5377 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5378 | 1 \ |
| 5379 | -c "bad certificate (EC key curve)"\ |
| 5380 | -c "! Certificate verification flags"\ |
| 5381 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5382 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5384 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5385 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5386 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5387 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5388 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5389 | 0 \ |
| 5390 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5391 | -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] | 5392 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5393 | -C "X509 - Certificate verification failed" |
| 5394 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5396 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5397 | run_test "Authentication: client SHA256, server required" \ |
| 5398 | "$P_SRV auth_mode=required" \ |
| 5399 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5400 | key_file=data_files/server6.key \ |
| 5401 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5402 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5403 | -c "Supported Signature Algorithm found: 04 " \ |
| 5404 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5405 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5407 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5408 | run_test "Authentication: client SHA384, server required" \ |
| 5409 | "$P_SRV auth_mode=required" \ |
| 5410 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5411 | key_file=data_files/server6.key \ |
| 5412 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5413 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5414 | -c "Supported Signature Algorithm found: 04 " \ |
| 5415 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5416 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5417 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5418 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5419 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5420 | "$P_CLI debug_level=3 crt_file=none \ |
| 5421 | key_file=data_files/server5.key" \ |
| 5422 | 1 \ |
| 5423 | -S "skip write certificate request" \ |
| 5424 | -C "skip parse certificate request" \ |
| 5425 | -c "got a certificate request" \ |
| 5426 | -c "= write certificate$" \ |
| 5427 | -C "skip write certificate$" \ |
| 5428 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5429 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5430 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5431 | -s "No client certification received from the client, but required by the authentication mode" |
| 5432 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5433 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5434 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5435 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5436 | "$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] | 5437 | key_file=data_files/server5.key" \ |
| 5438 | 1 \ |
| 5439 | -S "skip write certificate request" \ |
| 5440 | -C "skip parse certificate request" \ |
| 5441 | -c "got a certificate request" \ |
| 5442 | -C "skip write certificate" \ |
| 5443 | -C "skip write certificate verify" \ |
| 5444 | -S "skip parse certificate verify" \ |
| 5445 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5446 | -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] | 5447 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5448 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5449 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5450 | # We don't check that the client receives the alert because it might |
| 5451 | # detect that its write end of the connection is closed and abort |
| 5452 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5453 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5454 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5455 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5456 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5457 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5458 | key_file=data_files/server5.key" \ |
| 5459 | 0 \ |
| 5460 | -S "skip write certificate request" \ |
| 5461 | -C "skip parse certificate request" \ |
| 5462 | -c "got a certificate request" \ |
| 5463 | -C "skip write certificate" \ |
| 5464 | -C "skip write certificate verify" \ |
| 5465 | -S "skip parse certificate verify" \ |
| 5466 | -S "x509_verify_cert() returned" \ |
| 5467 | -S "! The certificate is not correctly signed" \ |
| 5468 | -S "X509 - Certificate verification failed" |
| 5469 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5470 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5471 | run_test "Authentication: client cert not trusted, server required" \ |
| 5472 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5473 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5474 | key_file=data_files/server5.key" \ |
| 5475 | 1 \ |
| 5476 | -S "skip write certificate request" \ |
| 5477 | -C "skip parse certificate request" \ |
| 5478 | -c "got a certificate request" \ |
| 5479 | -C "skip write certificate" \ |
| 5480 | -C "skip write certificate verify" \ |
| 5481 | -S "skip parse certificate verify" \ |
| 5482 | -s "x509_verify_cert() returned" \ |
| 5483 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5484 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5485 | -s "X509 - Certificate verification failed" |
| 5486 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5487 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5488 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5489 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5490 | "$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] | 5491 | key_file=data_files/server5.key" \ |
| 5492 | 0 \ |
| 5493 | -S "skip write certificate request" \ |
| 5494 | -C "skip parse certificate request" \ |
| 5495 | -c "got a certificate request" \ |
| 5496 | -C "skip write certificate" \ |
| 5497 | -C "skip write certificate verify" \ |
| 5498 | -S "skip parse certificate verify" \ |
| 5499 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5500 | -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] | 5501 | -S "! mbedtls_ssl_handshake returned" \ |
| 5502 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5503 | -S "X509 - Certificate verification failed" |
| 5504 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5505 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5506 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5507 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5508 | "$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] | 5509 | key_file=data_files/server5.key" \ |
| 5510 | 0 \ |
| 5511 | -s "skip write certificate request" \ |
| 5512 | -C "skip parse certificate request" \ |
| 5513 | -c "got no certificate request" \ |
| 5514 | -c "skip write certificate" \ |
| 5515 | -c "skip write certificate verify" \ |
| 5516 | -s "skip parse certificate verify" \ |
| 5517 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5518 | -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] | 5519 | -S "! mbedtls_ssl_handshake returned" \ |
| 5520 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5521 | -S "X509 - Certificate verification failed" |
| 5522 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5523 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5524 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5525 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5526 | "$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] | 5527 | 0 \ |
| 5528 | -S "skip write certificate request" \ |
| 5529 | -C "skip parse certificate request" \ |
| 5530 | -c "got a certificate request" \ |
| 5531 | -C "skip write certificate$" \ |
| 5532 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5533 | -c "skip write certificate verify" \ |
| 5534 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5535 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5536 | -S "! mbedtls_ssl_handshake returned" \ |
| 5537 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5538 | -S "X509 - Certificate verification failed" |
| 5539 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5541 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5542 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5543 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5544 | "$O_CLI" \ |
| 5545 | 0 \ |
| 5546 | -S "skip write certificate request" \ |
| 5547 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5548 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5549 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5550 | -S "X509 - Certificate verification failed" |
| 5551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5553 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5554 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5555 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5556 | "$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] | 5557 | 0 \ |
| 5558 | -C "skip parse certificate request" \ |
| 5559 | -c "got a certificate request" \ |
| 5560 | -C "skip write certificate$" \ |
| 5561 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5562 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5565 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5566 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5567 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5568 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5569 | 1 \ |
| 5570 | -C "skip parse certificate request" \ |
| 5571 | -c "got a certificate request" \ |
| 5572 | -C "skip write certificate$" \ |
| 5573 | -c "skip write certificate verify" \ |
| 5574 | -c "! mbedtls_ssl_handshake returned" |
| 5575 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5576 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5577 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5578 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5579 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5580 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5581 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5582 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5583 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5584 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5585 | # 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] | 5586 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5587 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5588 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5589 | run_test "Authentication: server max_int chain, client default" \ |
| 5590 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5591 | key_file=data_files/dir-maxpath/09.key" \ |
| 5592 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5593 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5594 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5595 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5596 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5597 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5598 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5599 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5600 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5601 | key_file=data_files/dir-maxpath/10.key" \ |
| 5602 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5603 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5604 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5605 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5606 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5607 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5609 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5610 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5611 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5612 | key_file=data_files/dir-maxpath/10.key" \ |
| 5613 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5614 | auth_mode=optional" \ |
| 5615 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5616 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5617 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5618 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5619 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5621 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5622 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5623 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5624 | key_file=data_files/dir-maxpath/10.key" \ |
| 5625 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5626 | auth_mode=none" \ |
| 5627 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5628 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5629 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5630 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5631 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5632 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5633 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5634 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5635 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5636 | key_file=data_files/dir-maxpath/10.key" \ |
| 5637 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5638 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5639 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5640 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5641 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5642 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5643 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5644 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5645 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5646 | key_file=data_files/dir-maxpath/10.key" \ |
| 5647 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5648 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5649 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5650 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5651 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5652 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5653 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5654 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5655 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5656 | key_file=data_files/dir-maxpath/10.key" \ |
| 5657 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5658 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5659 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5660 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5661 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5662 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5663 | run_test "Authentication: client max_int chain, server required" \ |
| 5664 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5665 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5666 | key_file=data_files/dir-maxpath/09.key" \ |
| 5667 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5668 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5669 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5670 | # Tests for CA list in CertificateRequest messages |
| 5671 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5673 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5674 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5675 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5676 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5677 | key_file=data_files/server6.key" \ |
| 5678 | 0 \ |
| 5679 | -s "requested DN" |
| 5680 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5682 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5683 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5684 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5685 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5686 | key_file=data_files/server6.key" \ |
| 5687 | 0 \ |
| 5688 | -S "requested DN" |
| 5689 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5691 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5692 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5693 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5694 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5695 | key_file=data_files/server5.key" \ |
| 5696 | 1 \ |
| 5697 | -S "requested DN" \ |
| 5698 | -s "x509_verify_cert() returned" \ |
| 5699 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5700 | -s "! mbedtls_ssl_handshake returned" \ |
| 5701 | -c "! mbedtls_ssl_handshake returned" \ |
| 5702 | -s "X509 - Certificate verification failed" |
| 5703 | |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5705 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5706 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5707 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5708 | crt_file2=data_files/server1.crt \ |
| 5709 | key_file2=data_files/server1.key" \ |
| 5710 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5711 | crt_file=data_files/server6.crt \ |
| 5712 | key_file=data_files/server6.key" \ |
| 5713 | 0 \ |
| 5714 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5715 | |
| 5716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5717 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5718 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5719 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5720 | crt_file2=data_files/server2.crt \ |
| 5721 | key_file2=data_files/server2.key" \ |
| 5722 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5723 | crt_file=data_files/server6.crt \ |
| 5724 | key_file=data_files/server6.key" \ |
| 5725 | 0 \ |
| 5726 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5727 | |
| 5728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5729 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5730 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5731 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5732 | crt_file2=data_files/server1.crt \ |
| 5733 | key_file2=data_files/server1.key" \ |
| 5734 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5735 | crt_file=data_files/server6.crt \ |
| 5736 | key_file=data_files/server6.key" \ |
| 5737 | 0 \ |
| 5738 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5739 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5740 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5741 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5742 | |
| 5743 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5745 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5746 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5747 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5748 | key_file=data_files/server5.key" \ |
| 5749 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5750 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5751 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5752 | -c "x509_verify_cert() returned" \ |
| 5753 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5754 | -c "! mbedtls_ssl_handshake returned" \ |
| 5755 | -c "X509 - Certificate verification failed" |
| 5756 | |
| 5757 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5759 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5760 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5761 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5762 | key_file=data_files/server5.key" \ |
| 5763 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5764 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5765 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5766 | -c "x509_verify_cert() returned" \ |
| 5767 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5768 | -C "! mbedtls_ssl_handshake returned" \ |
| 5769 | -C "X509 - Certificate verification failed" |
| 5770 | |
| 5771 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5772 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5773 | # the client informs the server about the supported curves - it does, though, in the |
| 5774 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5775 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5776 | # different means to have the server ignoring the client's supported curve list. |
| 5777 | |
| 5778 | requires_config_enabled MBEDTLS_ECP_C |
| 5779 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5781 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5782 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5783 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5784 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5785 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5786 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5787 | -c "use CA callback for X.509 CRT verification" \ |
| 5788 | -c "bad certificate (EC key curve)" \ |
| 5789 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5790 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5791 | |
| 5792 | requires_config_enabled MBEDTLS_ECP_C |
| 5793 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5795 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5796 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5797 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5798 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5799 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5800 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5801 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5802 | -c "bad certificate (EC key curve)"\ |
| 5803 | -c "! Certificate verification flags"\ |
| 5804 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5805 | |
| 5806 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5808 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5809 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5810 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5811 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5812 | key_file=data_files/server6.key \ |
| 5813 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5814 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5815 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5816 | -c "Supported Signature Algorithm found: 04 " \ |
| 5817 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5818 | |
| 5819 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5821 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5822 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5823 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5824 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5825 | key_file=data_files/server6.key \ |
| 5826 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5827 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5828 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5829 | -c "Supported Signature Algorithm found: 04 " \ |
| 5830 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5831 | |
| 5832 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5834 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5835 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5836 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5837 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5838 | key_file=data_files/server5.key" \ |
| 5839 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5840 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5841 | -S "skip write certificate request" \ |
| 5842 | -C "skip parse certificate request" \ |
| 5843 | -c "got a certificate request" \ |
| 5844 | -C "skip write certificate" \ |
| 5845 | -C "skip write certificate verify" \ |
| 5846 | -S "skip parse certificate verify" \ |
| 5847 | -s "x509_verify_cert() returned" \ |
| 5848 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5849 | -s "! mbedtls_ssl_handshake returned" \ |
| 5850 | -s "send alert level=2 message=48" \ |
| 5851 | -c "! mbedtls_ssl_handshake returned" \ |
| 5852 | -s "X509 - Certificate verification failed" |
| 5853 | # We don't check that the client receives the alert because it might |
| 5854 | # detect that its write end of the connection is closed and abort |
| 5855 | # before reading the alert message. |
| 5856 | |
| 5857 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5859 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5860 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5861 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5862 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5863 | key_file=data_files/server5.key" \ |
| 5864 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5865 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5866 | -S "skip write certificate request" \ |
| 5867 | -C "skip parse certificate request" \ |
| 5868 | -c "got a certificate request" \ |
| 5869 | -C "skip write certificate" \ |
| 5870 | -C "skip write certificate verify" \ |
| 5871 | -S "skip parse certificate verify" \ |
| 5872 | -s "x509_verify_cert() returned" \ |
| 5873 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5874 | -s "! mbedtls_ssl_handshake returned" \ |
| 5875 | -c "! mbedtls_ssl_handshake returned" \ |
| 5876 | -s "X509 - Certificate verification failed" |
| 5877 | |
| 5878 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5880 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5881 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5882 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5883 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5884 | key_file=data_files/server5.key" \ |
| 5885 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5886 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5887 | -S "skip write certificate request" \ |
| 5888 | -C "skip parse certificate request" \ |
| 5889 | -c "got a certificate request" \ |
| 5890 | -C "skip write certificate" \ |
| 5891 | -C "skip write certificate verify" \ |
| 5892 | -S "skip parse certificate verify" \ |
| 5893 | -s "x509_verify_cert() returned" \ |
| 5894 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5895 | -S "! mbedtls_ssl_handshake returned" \ |
| 5896 | -C "! mbedtls_ssl_handshake returned" \ |
| 5897 | -S "X509 - Certificate verification failed" |
| 5898 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5899 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5900 | requires_full_size_output_buffer |
| 5901 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5903 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5904 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5905 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5906 | key_file=data_files/dir-maxpath/09.key" \ |
| 5907 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5908 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5909 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5910 | -C "X509 - A fatal error occurred" |
| 5911 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5912 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5913 | requires_full_size_output_buffer |
| 5914 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5916 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5917 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5918 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5919 | key_file=data_files/dir-maxpath/10.key" \ |
| 5920 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5921 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5922 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5923 | -c "X509 - A fatal error occurred" |
| 5924 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5925 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5926 | requires_full_size_output_buffer |
| 5927 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5929 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5930 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5931 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5932 | key_file=data_files/dir-maxpath/10.key" \ |
| 5933 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5934 | debug_level=3 auth_mode=optional" \ |
| 5935 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5936 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5937 | -c "X509 - A fatal error occurred" |
| 5938 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5939 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5940 | requires_full_size_output_buffer |
| 5941 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5943 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5944 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5945 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5946 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5947 | key_file=data_files/dir-maxpath/10.key" \ |
| 5948 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5949 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5950 | -s "X509 - A fatal error occurred" |
| 5951 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5952 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5953 | requires_full_size_output_buffer |
| 5954 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5956 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5957 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5958 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5959 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5960 | key_file=data_files/dir-maxpath/10.key" \ |
| 5961 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5962 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5963 | -s "X509 - A fatal error occurred" |
| 5964 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5965 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5966 | requires_full_size_output_buffer |
| 5967 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5969 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5970 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5971 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5972 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5973 | key_file=data_files/dir-maxpath/09.key" \ |
| 5974 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5975 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5976 | -S "X509 - A fatal error occurred" |
| 5977 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5978 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5979 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5980 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5981 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5982 | "$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] | 5983 | key_file=data_files/server5.key \ |
| 5984 | crt_file2=data_files/server5-sha1.crt \ |
| 5985 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5986 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5987 | 0 \ |
| 5988 | -c "signed using.*ECDSA with SHA256" \ |
| 5989 | -C "signed using.*ECDSA with SHA1" |
| 5990 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5991 | # tests for SNI |
| 5992 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5993 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5994 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5995 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5996 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5997 | 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] | 5998 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5999 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6000 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6001 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6002 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6003 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6004 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6005 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6006 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6007 | 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] | 6008 | 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] | 6009 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6010 | 0 \ |
| 6011 | -s "parse ServerName extension" \ |
| 6012 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6013 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6014 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6015 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6016 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6017 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6018 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6019 | 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] | 6020 | 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] | 6021 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6022 | 0 \ |
| 6023 | -s "parse ServerName extension" \ |
| 6024 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6025 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6026 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6027 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6028 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6029 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6030 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6031 | 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] | 6032 | 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] | 6033 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6034 | 1 \ |
| 6035 | -s "parse ServerName extension" \ |
| 6036 | -s "ssl_sni_wrapper() returned" \ |
| 6037 | -s "mbedtls_ssl_handshake returned" \ |
| 6038 | -c "mbedtls_ssl_handshake returned" \ |
| 6039 | -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] | 6040 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6041 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6042 | run_test "SNI: client auth no override: optional" \ |
| 6043 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6044 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6045 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6046 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6047 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6048 | -S "skip write certificate request" \ |
| 6049 | -C "skip parse certificate request" \ |
| 6050 | -c "got a certificate request" \ |
| 6051 | -C "skip write certificate" \ |
| 6052 | -C "skip write certificate verify" \ |
| 6053 | -S "skip parse certificate verify" |
| 6054 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6055 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6056 | run_test "SNI: client auth override: none -> optional" \ |
| 6057 | "$P_SRV debug_level=3 auth_mode=none \ |
| 6058 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6059 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6060 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6061 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6062 | -S "skip write certificate request" \ |
| 6063 | -C "skip parse certificate request" \ |
| 6064 | -c "got a certificate request" \ |
| 6065 | -C "skip write certificate" \ |
| 6066 | -C "skip write certificate verify" \ |
| 6067 | -S "skip parse certificate verify" |
| 6068 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6069 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6070 | run_test "SNI: client auth override: optional -> none" \ |
| 6071 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6072 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6073 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6074 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6075 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6076 | -s "skip write certificate request" \ |
| 6077 | -C "skip parse certificate request" \ |
| 6078 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6079 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6080 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6081 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6082 | run_test "SNI: CA no override" \ |
| 6083 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6084 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6085 | ca_file=data_files/test-ca.crt \ |
| 6086 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6087 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6088 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6089 | 1 \ |
| 6090 | -S "skip write certificate request" \ |
| 6091 | -C "skip parse certificate request" \ |
| 6092 | -c "got a certificate request" \ |
| 6093 | -C "skip write certificate" \ |
| 6094 | -C "skip write certificate verify" \ |
| 6095 | -S "skip parse certificate verify" \ |
| 6096 | -s "x509_verify_cert() returned" \ |
| 6097 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6098 | -S "The certificate has been revoked (is on a CRL)" |
| 6099 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6100 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6101 | run_test "SNI: CA override" \ |
| 6102 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6103 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6104 | ca_file=data_files/test-ca.crt \ |
| 6105 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6106 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6107 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6108 | 0 \ |
| 6109 | -S "skip write certificate request" \ |
| 6110 | -C "skip parse certificate request" \ |
| 6111 | -c "got a certificate request" \ |
| 6112 | -C "skip write certificate" \ |
| 6113 | -C "skip write certificate verify" \ |
| 6114 | -S "skip parse certificate verify" \ |
| 6115 | -S "x509_verify_cert() returned" \ |
| 6116 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6117 | -S "The certificate has been revoked (is on a CRL)" |
| 6118 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6119 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6120 | run_test "SNI: CA override with CRL" \ |
| 6121 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6122 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6123 | ca_file=data_files/test-ca.crt \ |
| 6124 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6125 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6126 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6127 | 1 \ |
| 6128 | -S "skip write certificate request" \ |
| 6129 | -C "skip parse certificate request" \ |
| 6130 | -c "got a certificate request" \ |
| 6131 | -C "skip write certificate" \ |
| 6132 | -C "skip write certificate verify" \ |
| 6133 | -S "skip parse certificate verify" \ |
| 6134 | -s "x509_verify_cert() returned" \ |
| 6135 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6136 | -s "The certificate has been revoked (is on a CRL)" |
| 6137 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6138 | # Tests for SNI and DTLS |
| 6139 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6140 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6142 | run_test "SNI: DTLS, no SNI callback" \ |
| 6143 | "$P_SRV debug_level=3 dtls=1 \ |
| 6144 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6145 | "$P_CLI server_name=localhost dtls=1" \ |
| 6146 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6147 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6148 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6149 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6150 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6152 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6153 | "$P_SRV debug_level=3 dtls=1 \ |
| 6154 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6155 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6156 | "$P_CLI server_name=localhost dtls=1" \ |
| 6157 | 0 \ |
| 6158 | -s "parse ServerName extension" \ |
| 6159 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6160 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6161 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6162 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6164 | run_test "SNI: DTLS, matching cert 2" \ |
| 6165 | "$P_SRV debug_level=3 dtls=1 \ |
| 6166 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6167 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6168 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6169 | 0 \ |
| 6170 | -s "parse ServerName extension" \ |
| 6171 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6172 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6173 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6175 | run_test "SNI: DTLS, no matching cert" \ |
| 6176 | "$P_SRV debug_level=3 dtls=1 \ |
| 6177 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6178 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6179 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6180 | 1 \ |
| 6181 | -s "parse ServerName extension" \ |
| 6182 | -s "ssl_sni_wrapper() returned" \ |
| 6183 | -s "mbedtls_ssl_handshake returned" \ |
| 6184 | -c "mbedtls_ssl_handshake returned" \ |
| 6185 | -c "SSL - A fatal alert message was received from our peer" |
| 6186 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6188 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6189 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6190 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6191 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6192 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6193 | 0 \ |
| 6194 | -S "skip write certificate request" \ |
| 6195 | -C "skip parse certificate request" \ |
| 6196 | -c "got a certificate request" \ |
| 6197 | -C "skip write certificate" \ |
| 6198 | -C "skip write certificate verify" \ |
| 6199 | -S "skip parse certificate verify" |
| 6200 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6202 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6203 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6204 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6205 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6206 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6207 | 0 \ |
| 6208 | -S "skip write certificate request" \ |
| 6209 | -C "skip parse certificate request" \ |
| 6210 | -c "got a certificate request" \ |
| 6211 | -C "skip write certificate" \ |
| 6212 | -C "skip write certificate verify" \ |
| 6213 | -S "skip parse certificate verify" |
| 6214 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6216 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6217 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6218 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6219 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6220 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6221 | 0 \ |
| 6222 | -s "skip write certificate request" \ |
| 6223 | -C "skip parse certificate request" \ |
| 6224 | -c "got no certificate request" \ |
| 6225 | -c "skip write certificate" \ |
| 6226 | -c "skip write certificate verify" \ |
| 6227 | -s "skip parse certificate verify" |
| 6228 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6230 | run_test "SNI: DTLS, CA no override" \ |
| 6231 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6232 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6233 | ca_file=data_files/test-ca.crt \ |
| 6234 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6235 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6236 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6237 | 1 \ |
| 6238 | -S "skip write certificate request" \ |
| 6239 | -C "skip parse certificate request" \ |
| 6240 | -c "got a certificate request" \ |
| 6241 | -C "skip write certificate" \ |
| 6242 | -C "skip write certificate verify" \ |
| 6243 | -S "skip parse certificate verify" \ |
| 6244 | -s "x509_verify_cert() returned" \ |
| 6245 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6246 | -S "The certificate has been revoked (is on a CRL)" |
| 6247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6249 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6250 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6251 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6252 | ca_file=data_files/test-ca.crt \ |
| 6253 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6254 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6255 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6256 | 0 \ |
| 6257 | -S "skip write certificate request" \ |
| 6258 | -C "skip parse certificate request" \ |
| 6259 | -c "got a certificate request" \ |
| 6260 | -C "skip write certificate" \ |
| 6261 | -C "skip write certificate verify" \ |
| 6262 | -S "skip parse certificate verify" \ |
| 6263 | -S "x509_verify_cert() returned" \ |
| 6264 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6265 | -S "The certificate has been revoked (is on a CRL)" |
| 6266 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6268 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6269 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6270 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6271 | ca_file=data_files/test-ca.crt \ |
| 6272 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6273 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6274 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6275 | 1 \ |
| 6276 | -S "skip write certificate request" \ |
| 6277 | -C "skip parse certificate request" \ |
| 6278 | -c "got a certificate request" \ |
| 6279 | -C "skip write certificate" \ |
| 6280 | -C "skip write certificate verify" \ |
| 6281 | -S "skip parse certificate verify" \ |
| 6282 | -s "x509_verify_cert() returned" \ |
| 6283 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6284 | -s "The certificate has been revoked (is on a CRL)" |
| 6285 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6286 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6287 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6288 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6289 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6290 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6291 | "$P_CLI nbio=2 tickets=0" \ |
| 6292 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6293 | -S "mbedtls_ssl_handshake returned" \ |
| 6294 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6295 | -c "Read from server: .* bytes read" |
| 6296 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6297 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6298 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6299 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6300 | "$P_CLI nbio=2 tickets=0" \ |
| 6301 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6302 | -S "mbedtls_ssl_handshake returned" \ |
| 6303 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6304 | -c "Read from server: .* bytes read" |
| 6305 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6307 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6308 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6309 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6310 | "$P_CLI nbio=2 tickets=1" \ |
| 6311 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6312 | -S "mbedtls_ssl_handshake returned" \ |
| 6313 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6314 | -c "Read from server: .* bytes read" |
| 6315 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6317 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6318 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6319 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6320 | "$P_CLI nbio=2 tickets=1" \ |
| 6321 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6322 | -S "mbedtls_ssl_handshake returned" \ |
| 6323 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 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 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6327 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6328 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6329 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6330 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6331 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6332 | -S "mbedtls_ssl_handshake returned" \ |
| 6333 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6334 | -c "Read from server: .* bytes read" |
| 6335 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6337 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6338 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6339 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6340 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6341 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6342 | -S "mbedtls_ssl_handshake returned" \ |
| 6343 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6344 | -c "Read from server: .* bytes read" |
| 6345 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6347 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6348 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6349 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6350 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 6351 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6352 | -S "mbedtls_ssl_handshake returned" \ |
| 6353 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6354 | -c "Read from server: .* bytes read" |
| 6355 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6356 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6357 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6358 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6359 | run_test "Event-driven I/O: basic handshake" \ |
| 6360 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6361 | "$P_CLI event=1 tickets=0" \ |
| 6362 | 0 \ |
| 6363 | -S "mbedtls_ssl_handshake returned" \ |
| 6364 | -C "mbedtls_ssl_handshake returned" \ |
| 6365 | -c "Read from server: .* bytes read" |
| 6366 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6367 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6368 | run_test "Event-driven I/O: client auth" \ |
| 6369 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6370 | "$P_CLI event=1 tickets=0" \ |
| 6371 | 0 \ |
| 6372 | -S "mbedtls_ssl_handshake returned" \ |
| 6373 | -C "mbedtls_ssl_handshake returned" \ |
| 6374 | -c "Read from server: .* bytes read" |
| 6375 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6377 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6378 | run_test "Event-driven I/O: ticket" \ |
| 6379 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6380 | "$P_CLI event=1 tickets=1" \ |
| 6381 | 0 \ |
| 6382 | -S "mbedtls_ssl_handshake returned" \ |
| 6383 | -C "mbedtls_ssl_handshake returned" \ |
| 6384 | -c "Read from server: .* bytes read" |
| 6385 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6387 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6388 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6389 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6390 | "$P_CLI event=1 tickets=1" \ |
| 6391 | 0 \ |
| 6392 | -S "mbedtls_ssl_handshake returned" \ |
| 6393 | -C "mbedtls_ssl_handshake returned" \ |
| 6394 | -c "Read from server: .* bytes read" |
| 6395 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6397 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6398 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 6399 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6400 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6401 | 0 \ |
| 6402 | -S "mbedtls_ssl_handshake returned" \ |
| 6403 | -C "mbedtls_ssl_handshake returned" \ |
| 6404 | -c "Read from server: .* bytes read" |
| 6405 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6407 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6408 | run_test "Event-driven I/O: ticket + resume" \ |
| 6409 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6410 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6411 | 0 \ |
| 6412 | -S "mbedtls_ssl_handshake returned" \ |
| 6413 | -C "mbedtls_ssl_handshake returned" \ |
| 6414 | -c "Read from server: .* bytes read" |
| 6415 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6417 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6418 | run_test "Event-driven I/O: session-id resume" \ |
| 6419 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6420 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 6421 | 0 \ |
| 6422 | -S "mbedtls_ssl_handshake returned" \ |
| 6423 | -C "mbedtls_ssl_handshake returned" \ |
| 6424 | -c "Read from server: .* bytes read" |
| 6425 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6427 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6428 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6429 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6430 | 0 \ |
| 6431 | -c "Read from server: .* bytes read" |
| 6432 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6434 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6435 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6436 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6437 | 0 \ |
| 6438 | -c "Read from server: .* bytes read" |
| 6439 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6441 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6442 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6443 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6444 | 0 \ |
| 6445 | -c "Read from server: .* bytes read" |
| 6446 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6448 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6449 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6450 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6451 | 0 \ |
| 6452 | -c "Read from server: .* bytes read" |
| 6453 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6455 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6456 | "$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] | 6457 | "$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] | 6458 | 0 \ |
| 6459 | -c "Read from server: .* bytes read" |
| 6460 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6462 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6463 | "$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] | 6464 | "$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] | 6465 | 0 \ |
| 6466 | -c "Read from server: .* bytes read" |
| 6467 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6469 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6470 | "$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] | 6471 | "$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] | 6472 | 0 \ |
| 6473 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6474 | |
| 6475 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6476 | # During session resumption, the client will send its ApplicationData record |
| 6477 | # within the same datagram as the Finished messages. In this situation, the |
| 6478 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6479 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6481 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6482 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6483 | "$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] | 6484 | "$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] | 6485 | 0 \ |
| 6486 | -c "Read from server: .* bytes read" |
| 6487 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6488 | # Tests for version negotiation |
| 6489 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6491 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6492 | "$P_SRV" \ |
| 6493 | "$P_CLI" \ |
| 6494 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6495 | -S "mbedtls_ssl_handshake returned" \ |
| 6496 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6497 | -s "Protocol is TLSv1.2" \ |
| 6498 | -c "Protocol is TLSv1.2" |
| 6499 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6501 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6502 | "$P_SRV" \ |
| 6503 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6504 | 1 \ |
| 6505 | -s "Handshake protocol not within min/max boundaries" \ |
| 6506 | -c "Error in protocol version" \ |
| 6507 | -S "Protocol is TLSv1.0" \ |
| 6508 | -C "Handshake was completed" |
| 6509 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6511 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6512 | "$P_SRV" \ |
| 6513 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6514 | 1 \ |
| 6515 | -s "Handshake protocol not within min/max boundaries" \ |
| 6516 | -c "Error in protocol version" \ |
| 6517 | -S "Protocol is TLSv1.1" \ |
| 6518 | -C "Handshake was completed" |
| 6519 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6521 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6522 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6523 | "$P_CLI" \ |
| 6524 | 1 \ |
| 6525 | -s "Error in protocol version" \ |
| 6526 | -c "Handshake protocol not within min/max boundaries" \ |
| 6527 | -S "Version: TLS1.0" \ |
| 6528 | -C "Protocol is TLSv1.0" |
| 6529 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6531 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6532 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6533 | "$P_CLI" \ |
| 6534 | 1 \ |
| 6535 | -s "Error in protocol version" \ |
| 6536 | -c "Handshake protocol not within min/max boundaries" \ |
| 6537 | -S "Version: TLS1.1" \ |
| 6538 | -C "Protocol is TLSv1.1" |
| 6539 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6540 | # Tests for ALPN extension |
| 6541 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6542 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6543 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6544 | "$P_SRV debug_level=3" \ |
| 6545 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6546 | 0 \ |
| 6547 | -C "client hello, adding alpn extension" \ |
| 6548 | -S "found alpn extension" \ |
| 6549 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6550 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6551 | -C "found alpn extension " \ |
| 6552 | -C "Application Layer Protocol is" \ |
| 6553 | -S "Application Layer Protocol is" |
| 6554 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6555 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6556 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6557 | "$P_SRV debug_level=3" \ |
| 6558 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6559 | 0 \ |
| 6560 | -c "client hello, adding alpn extension" \ |
| 6561 | -s "found alpn extension" \ |
| 6562 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6563 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6564 | -C "found alpn extension " \ |
| 6565 | -c "Application Layer Protocol is (none)" \ |
| 6566 | -S "Application Layer Protocol is" |
| 6567 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6568 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6569 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6570 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6571 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6572 | 0 \ |
| 6573 | -C "client hello, adding alpn extension" \ |
| 6574 | -S "found alpn extension" \ |
| 6575 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6576 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6577 | -C "found alpn extension " \ |
| 6578 | -C "Application Layer Protocol is" \ |
| 6579 | -s "Application Layer Protocol is (none)" |
| 6580 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6581 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6582 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6583 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6584 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6585 | 0 \ |
| 6586 | -c "client hello, adding alpn extension" \ |
| 6587 | -s "found alpn extension" \ |
| 6588 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6589 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6590 | -c "found alpn extension" \ |
| 6591 | -c "Application Layer Protocol is abc" \ |
| 6592 | -s "Application Layer Protocol is abc" |
| 6593 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6594 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6595 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6596 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6597 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6598 | 0 \ |
| 6599 | -c "client hello, adding alpn extension" \ |
| 6600 | -s "found alpn extension" \ |
| 6601 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6602 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6603 | -c "found alpn extension" \ |
| 6604 | -c "Application Layer Protocol is abc" \ |
| 6605 | -s "Application Layer Protocol is abc" |
| 6606 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6607 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6608 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6609 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6610 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6611 | 0 \ |
| 6612 | -c "client hello, adding alpn extension" \ |
| 6613 | -s "found alpn extension" \ |
| 6614 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6615 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6616 | -c "found alpn extension" \ |
| 6617 | -c "Application Layer Protocol is 1234" \ |
| 6618 | -s "Application Layer Protocol is 1234" |
| 6619 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6620 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6621 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6622 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6623 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6624 | 1 \ |
| 6625 | -c "client hello, adding alpn extension" \ |
| 6626 | -s "found alpn extension" \ |
| 6627 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6628 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6629 | -C "found alpn extension" \ |
| 6630 | -C "Application Layer Protocol is 1234" \ |
| 6631 | -S "Application Layer Protocol is 1234" |
| 6632 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6633 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6634 | # Tests for keyUsage in leaf certificates, part 1: |
| 6635 | # server-side certificate/suite selection |
| 6636 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6638 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6639 | "$P_SRV key_file=data_files/server2.key \ |
| 6640 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6641 | "$P_CLI" \ |
| 6642 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6643 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6644 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6646 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6647 | "$P_SRV key_file=data_files/server2.key \ |
| 6648 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6649 | "$P_CLI" \ |
| 6650 | 0 \ |
| 6651 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6652 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6654 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6655 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6656 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6657 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6658 | 1 \ |
| 6659 | -C "Ciphersuite is " |
| 6660 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6662 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6663 | "$P_SRV key_file=data_files/server5.key \ |
| 6664 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6665 | "$P_CLI" \ |
| 6666 | 0 \ |
| 6667 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6668 | |
| 6669 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6671 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6672 | "$P_SRV key_file=data_files/server5.key \ |
| 6673 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6674 | "$P_CLI" \ |
| 6675 | 0 \ |
| 6676 | -c "Ciphersuite is TLS-ECDH-" |
| 6677 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6679 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6680 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6681 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6682 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6683 | 1 \ |
| 6684 | -C "Ciphersuite is " |
| 6685 | |
| 6686 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6687 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6688 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6690 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6691 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6692 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6693 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6694 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6695 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6696 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6697 | -C "Processing of the Certificate handshake message failed" \ |
| 6698 | -c "Ciphersuite is TLS-" |
| 6699 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6701 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6702 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6703 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6704 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6705 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6706 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6707 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6708 | -C "Processing of the Certificate handshake message failed" \ |
| 6709 | -c "Ciphersuite is TLS-" |
| 6710 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6712 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6713 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6714 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6715 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6716 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6717 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6718 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6719 | -C "Processing of the Certificate handshake message failed" \ |
| 6720 | -c "Ciphersuite is TLS-" |
| 6721 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6723 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6724 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6725 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6726 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6727 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6728 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6729 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6730 | -c "Processing of the Certificate handshake message failed" \ |
| 6731 | -C "Ciphersuite is TLS-" |
| 6732 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6734 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6735 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6736 | -cert data_files/server2.ku-ke.crt" \ |
| 6737 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6738 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6739 | 0 \ |
| 6740 | -c "bad certificate (usage extensions)" \ |
| 6741 | -C "Processing of the Certificate handshake message failed" \ |
| 6742 | -c "Ciphersuite is TLS-" \ |
| 6743 | -c "! Usage does not match the keyUsage extension" |
| 6744 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6746 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6747 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6748 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6749 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6750 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6751 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6752 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6753 | -C "Processing of the Certificate handshake message failed" \ |
| 6754 | -c "Ciphersuite is TLS-" |
| 6755 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6757 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6758 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6759 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6760 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6761 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6762 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6763 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6764 | -c "Processing of the Certificate handshake message failed" \ |
| 6765 | -C "Ciphersuite is TLS-" |
| 6766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6768 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6769 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6770 | -cert data_files/server2.ku-ds.crt" \ |
| 6771 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6772 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6773 | 0 \ |
| 6774 | -c "bad certificate (usage extensions)" \ |
| 6775 | -C "Processing of the Certificate handshake message failed" \ |
| 6776 | -c "Ciphersuite is TLS-" \ |
| 6777 | -c "! Usage does not match the keyUsage extension" |
| 6778 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6779 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6780 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6781 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6782 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6783 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6784 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6785 | "$P_CLI debug_level=3" \ |
| 6786 | 0 \ |
| 6787 | -C "bad certificate (usage extensions)" \ |
| 6788 | -C "Processing of the Certificate handshake message failed" \ |
| 6789 | -c "Ciphersuite is" |
| 6790 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6791 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6792 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6793 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6794 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6795 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6796 | -cert data_files/server2.ku-ke.crt" \ |
| 6797 | "$P_CLI debug_level=1" \ |
| 6798 | 1 \ |
| 6799 | -c "bad certificate (usage extensions)" \ |
| 6800 | -c "Processing of the Certificate handshake message failed" \ |
| 6801 | -C "Ciphersuite is" |
| 6802 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6803 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6804 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6805 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6806 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6807 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6808 | -cert data_files/server2.ku-ka.crt" \ |
| 6809 | "$P_CLI debug_level=1" \ |
| 6810 | 1 \ |
| 6811 | -c "bad certificate (usage extensions)" \ |
| 6812 | -c "Processing of the Certificate handshake message failed" \ |
| 6813 | -C "Ciphersuite is" |
| 6814 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6815 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6816 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6817 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6818 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6819 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6820 | -cert data_files/server5.ku-ds.crt" \ |
| 6821 | "$P_CLI debug_level=3" \ |
| 6822 | 0 \ |
| 6823 | -C "bad certificate (usage extensions)" \ |
| 6824 | -C "Processing of the Certificate handshake message failed" \ |
| 6825 | -c "Ciphersuite is" |
| 6826 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6827 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6828 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6829 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6830 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6831 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6832 | -cert data_files/server5.ku-ke.crt" \ |
| 6833 | "$P_CLI debug_level=1" \ |
| 6834 | 1 \ |
| 6835 | -c "bad certificate (usage extensions)" \ |
| 6836 | -c "Processing of the Certificate handshake message failed" \ |
| 6837 | -C "Ciphersuite is" |
| 6838 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6839 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6840 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6841 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6842 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6843 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6844 | -cert data_files/server5.ku-ka.crt" \ |
| 6845 | "$P_CLI debug_level=1" \ |
| 6846 | 1 \ |
| 6847 | -c "bad certificate (usage extensions)" \ |
| 6848 | -c "Processing of the Certificate handshake message failed" \ |
| 6849 | -C "Ciphersuite is" |
| 6850 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6851 | # Tests for keyUsage in leaf certificates, part 3: |
| 6852 | # server-side checking of client cert |
| 6853 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6855 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6856 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6857 | "$O_CLI -key data_files/server2.key \ |
| 6858 | -cert data_files/server2.ku-ds.crt" \ |
| 6859 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6860 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6861 | -S "bad certificate (usage extensions)" \ |
| 6862 | -S "Processing of the Certificate handshake message failed" |
| 6863 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6865 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6866 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6867 | "$O_CLI -key data_files/server2.key \ |
| 6868 | -cert data_files/server2.ku-ke.crt" \ |
| 6869 | 0 \ |
| 6870 | -s "bad certificate (usage extensions)" \ |
| 6871 | -S "Processing of the Certificate handshake message failed" |
| 6872 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6874 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6875 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6876 | "$O_CLI -key data_files/server2.key \ |
| 6877 | -cert data_files/server2.ku-ke.crt" \ |
| 6878 | 1 \ |
| 6879 | -s "bad certificate (usage extensions)" \ |
| 6880 | -s "Processing of the Certificate handshake message failed" |
| 6881 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6883 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6884 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6885 | "$O_CLI -key data_files/server5.key \ |
| 6886 | -cert data_files/server5.ku-ds.crt" \ |
| 6887 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6888 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6889 | -S "bad certificate (usage extensions)" \ |
| 6890 | -S "Processing of the Certificate handshake message failed" |
| 6891 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6893 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6894 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6895 | "$O_CLI -key data_files/server5.key \ |
| 6896 | -cert data_files/server5.ku-ka.crt" \ |
| 6897 | 0 \ |
| 6898 | -s "bad certificate (usage extensions)" \ |
| 6899 | -S "Processing of the Certificate handshake message failed" |
| 6900 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6901 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6902 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6903 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6904 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6905 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6906 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6907 | -cert data_files/server2.ku-ds.crt" \ |
| 6908 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6909 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6910 | -S "bad certificate (usage extensions)" \ |
| 6911 | -S "Processing of the Certificate handshake message failed" |
| 6912 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6913 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6914 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6915 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6916 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6917 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6918 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6919 | -cert data_files/server2.ku-ke.crt" \ |
| 6920 | 0 \ |
| 6921 | -s "bad certificate (usage extensions)" \ |
| 6922 | -S "Processing of the Certificate handshake message failed" |
| 6923 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6924 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6925 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6926 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6927 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6928 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6929 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6930 | -cert data_files/server5.ku-ds.crt" \ |
| 6931 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6932 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6933 | -S "bad certificate (usage extensions)" \ |
| 6934 | -S "Processing of the Certificate handshake message failed" |
| 6935 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6936 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6937 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6938 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6939 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6940 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6941 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6942 | -cert data_files/server5.ku-ka.crt" \ |
| 6943 | 0 \ |
| 6944 | -s "bad certificate (usage extensions)" \ |
| 6945 | -S "Processing of the Certificate handshake message failed" |
| 6946 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6947 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6948 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6950 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6951 | "$P_SRV key_file=data_files/server5.key \ |
| 6952 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6953 | "$P_CLI" \ |
| 6954 | 0 |
| 6955 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6957 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6958 | "$P_SRV key_file=data_files/server5.key \ |
| 6959 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6960 | "$P_CLI" \ |
| 6961 | 0 |
| 6962 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6964 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6965 | "$P_SRV key_file=data_files/server5.key \ |
| 6966 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6967 | "$P_CLI" \ |
| 6968 | 0 |
| 6969 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6971 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6972 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6973 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6974 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6975 | 1 |
| 6976 | |
| 6977 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6978 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6980 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6981 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6982 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6983 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6984 | 0 \ |
| 6985 | -C "bad certificate (usage extensions)" \ |
| 6986 | -C "Processing of the Certificate handshake message failed" \ |
| 6987 | -c "Ciphersuite is TLS-" |
| 6988 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6990 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6991 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6992 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6993 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6994 | 0 \ |
| 6995 | -C "bad certificate (usage extensions)" \ |
| 6996 | -C "Processing of the Certificate handshake message failed" \ |
| 6997 | -c "Ciphersuite is TLS-" |
| 6998 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7000 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7001 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7002 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7003 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7004 | 0 \ |
| 7005 | -C "bad certificate (usage extensions)" \ |
| 7006 | -C "Processing of the Certificate handshake message failed" \ |
| 7007 | -c "Ciphersuite is TLS-" |
| 7008 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7010 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7011 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7012 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7013 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7014 | 1 \ |
| 7015 | -c "bad certificate (usage extensions)" \ |
| 7016 | -c "Processing of the Certificate handshake message failed" \ |
| 7017 | -C "Ciphersuite is TLS-" |
| 7018 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7019 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7020 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7021 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7022 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 7023 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7024 | -cert data_files/server5.eku-srv.crt" \ |
| 7025 | "$P_CLI debug_level=1" \ |
| 7026 | 0 \ |
| 7027 | -C "bad certificate (usage extensions)" \ |
| 7028 | -C "Processing of the Certificate handshake message failed" \ |
| 7029 | -c "Ciphersuite is" |
| 7030 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7031 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7032 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7033 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7034 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 7035 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7036 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7037 | "$P_CLI debug_level=1" \ |
| 7038 | 0 \ |
| 7039 | -C "bad certificate (usage extensions)" \ |
| 7040 | -C "Processing of the Certificate handshake message failed" \ |
| 7041 | -c "Ciphersuite is" |
| 7042 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7043 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7044 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7045 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7046 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 7047 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7048 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7049 | "$P_CLI debug_level=1" \ |
| 7050 | 0 \ |
| 7051 | -C "bad certificate (usage extensions)" \ |
| 7052 | -C "Processing of the Certificate handshake message failed" \ |
| 7053 | -c "Ciphersuite is" |
| 7054 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7055 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7056 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7057 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7058 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 7059 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7060 | -cert data_files/server5.eku-cs.crt" \ |
| 7061 | "$P_CLI debug_level=1" \ |
| 7062 | 1 \ |
| 7063 | -c "bad certificate (usage extensions)" \ |
| 7064 | -c "Processing of the Certificate handshake message failed" \ |
| 7065 | -C "Ciphersuite is" |
| 7066 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7067 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 7068 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7070 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7071 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7072 | "$O_CLI -key data_files/server5.key \ |
| 7073 | -cert data_files/server5.eku-cli.crt" \ |
| 7074 | 0 \ |
| 7075 | -S "bad certificate (usage extensions)" \ |
| 7076 | -S "Processing of the Certificate handshake message failed" |
| 7077 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7079 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7080 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7081 | "$O_CLI -key data_files/server5.key \ |
| 7082 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7083 | 0 \ |
| 7084 | -S "bad certificate (usage extensions)" \ |
| 7085 | -S "Processing of the Certificate handshake message failed" |
| 7086 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7088 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7089 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7090 | "$O_CLI -key data_files/server5.key \ |
| 7091 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7092 | 0 \ |
| 7093 | -S "bad certificate (usage extensions)" \ |
| 7094 | -S "Processing of the Certificate handshake message failed" |
| 7095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7097 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7098 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7099 | "$O_CLI -key data_files/server5.key \ |
| 7100 | -cert data_files/server5.eku-cs.crt" \ |
| 7101 | 0 \ |
| 7102 | -s "bad certificate (usage extensions)" \ |
| 7103 | -S "Processing of the Certificate handshake message failed" |
| 7104 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7106 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7107 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7108 | "$O_CLI -key data_files/server5.key \ |
| 7109 | -cert data_files/server5.eku-cs.crt" \ |
| 7110 | 1 \ |
| 7111 | -s "bad certificate (usage extensions)" \ |
| 7112 | -s "Processing of the Certificate handshake message failed" |
| 7113 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7114 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7115 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7116 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7117 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7118 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7119 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7120 | -cert data_files/server5.eku-cli.crt" \ |
| 7121 | 0 \ |
| 7122 | -S "bad certificate (usage extensions)" \ |
| 7123 | -S "Processing of the Certificate handshake message failed" |
| 7124 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7125 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7126 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7127 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7128 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7129 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7130 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7131 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7132 | 0 \ |
| 7133 | -S "bad certificate (usage extensions)" \ |
| 7134 | -S "Processing of the Certificate handshake message failed" |
| 7135 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7136 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7137 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7138 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7139 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7140 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7141 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7142 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7143 | 0 \ |
| 7144 | -S "bad certificate (usage extensions)" \ |
| 7145 | -S "Processing of the Certificate handshake message failed" |
| 7146 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7147 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7148 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7149 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7150 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7151 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7152 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7153 | -cert data_files/server5.eku-cs.crt" \ |
| 7154 | 0 \ |
| 7155 | -s "bad certificate (usage extensions)" \ |
| 7156 | -S "Processing of the Certificate handshake message failed" |
| 7157 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7158 | # Tests for DHM parameters loading |
| 7159 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7161 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7162 | "$P_SRV" \ |
| 7163 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7164 | debug_level=3" \ |
| 7165 | 0 \ |
| 7166 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7167 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7168 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7170 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7171 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7172 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7173 | debug_level=3" \ |
| 7174 | 0 \ |
| 7175 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 7176 | -c "value of 'DHM: G ' (2 bits)" |
| 7177 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7178 | # Tests for DHM client-side size checking |
| 7179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7181 | run_test "DHM size: server default, client default, OK" \ |
| 7182 | "$P_SRV" \ |
| 7183 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7184 | debug_level=1" \ |
| 7185 | 0 \ |
| 7186 | -C "DHM prime too short:" |
| 7187 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7189 | run_test "DHM size: server default, client 2048, OK" \ |
| 7190 | "$P_SRV" \ |
| 7191 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7192 | debug_level=1 dhmlen=2048" \ |
| 7193 | 0 \ |
| 7194 | -C "DHM prime too short:" |
| 7195 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7196 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7197 | run_test "DHM size: server 1024, client default, OK" \ |
| 7198 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7199 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7200 | debug_level=1" \ |
| 7201 | 0 \ |
| 7202 | -C "DHM prime too short:" |
| 7203 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7205 | run_test "DHM size: server 999, client 999, OK" \ |
| 7206 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7207 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7208 | debug_level=1 dhmlen=999" \ |
| 7209 | 0 \ |
| 7210 | -C "DHM prime too short:" |
| 7211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7213 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 7214 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7215 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7216 | debug_level=1 dhmlen=1000" \ |
| 7217 | 0 \ |
| 7218 | -C "DHM prime too short:" |
| 7219 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7221 | run_test "DHM size: server 1000, client default, rejected" \ |
| 7222 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7223 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7224 | debug_level=1" \ |
| 7225 | 1 \ |
| 7226 | -c "DHM prime too short:" |
| 7227 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7229 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7230 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7231 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7232 | debug_level=1 dhmlen=1001" \ |
| 7233 | 1 \ |
| 7234 | -c "DHM prime too short:" |
| 7235 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7237 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7238 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7239 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7240 | debug_level=1 dhmlen=1000" \ |
| 7241 | 1 \ |
| 7242 | -c "DHM prime too short:" |
| 7243 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7244 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7245 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7246 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7247 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7248 | debug_level=1 dhmlen=999" \ |
| 7249 | 1 \ |
| 7250 | -c "DHM prime too short:" |
| 7251 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7253 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7254 | "$P_SRV" \ |
| 7255 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7256 | debug_level=1 dhmlen=2049" \ |
| 7257 | 1 \ |
| 7258 | -c "DHM prime too short:" |
| 7259 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7260 | # Tests for PSK callback |
| 7261 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7263 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7264 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7265 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7266 | psk_identity=foo psk=abc123" \ |
| 7267 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7268 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7269 | -S "SSL - Unknown identity received" \ |
| 7270 | -S "SSL - Verification of the message MAC failed" |
| 7271 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7272 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7274 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7275 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7276 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7277 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7278 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7279 | -C "session hash for extended master secret"\ |
| 7280 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7281 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7282 | -S "SSL - Unknown identity received" \ |
| 7283 | -S "SSL - Verification of the message MAC failed" |
| 7284 | |
| 7285 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7287 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7288 | "$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] | 7289 | "$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] | 7290 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7291 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7292 | -C "session hash for extended master secret"\ |
| 7293 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7294 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7295 | -S "SSL - Unknown identity received" \ |
| 7296 | -S "SSL - Verification of the message MAC failed" |
| 7297 | |
| 7298 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7300 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7301 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7302 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7303 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7304 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7305 | -c "session hash for extended master secret"\ |
| 7306 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7307 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7308 | -S "SSL - Unknown identity received" \ |
| 7309 | -S "SSL - Verification of the message MAC failed" |
| 7310 | |
| 7311 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7313 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7314 | "$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] | 7315 | "$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] | 7316 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7317 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7318 | -c "session hash for extended master secret"\ |
| 7319 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7320 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7321 | -S "SSL - Unknown identity received" \ |
| 7322 | -S "SSL - Verification of the message MAC failed" |
| 7323 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7324 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7326 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7327 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7328 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7329 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7330 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7331 | -C "session hash for extended master secret"\ |
| 7332 | -S "session hash for extended master secret"\ |
| 7333 | -S "SSL - The handshake negotiation failed" \ |
| 7334 | -S "SSL - Unknown identity received" \ |
| 7335 | -S "SSL - Verification of the message MAC failed" |
| 7336 | |
| 7337 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7339 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7340 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7341 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7342 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7343 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7344 | -C "session hash for extended master secret"\ |
| 7345 | -S "session hash for extended master secret"\ |
| 7346 | -S "SSL - The handshake negotiation failed" \ |
| 7347 | -S "SSL - Unknown identity received" \ |
| 7348 | -S "SSL - Verification of the message MAC failed" |
| 7349 | |
| 7350 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7352 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7353 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7354 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7355 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7356 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7357 | -c "session hash for extended master secret"\ |
| 7358 | -s "session hash for extended master secret"\ |
| 7359 | -S "SSL - The handshake negotiation failed" \ |
| 7360 | -S "SSL - Unknown identity received" \ |
| 7361 | -S "SSL - Verification of the message MAC failed" |
| 7362 | |
| 7363 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7365 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7366 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7367 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7368 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7369 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7370 | -c "session hash for extended master secret"\ |
| 7371 | -s "session hash for extended master secret"\ |
| 7372 | -S "SSL - The handshake negotiation failed" \ |
| 7373 | -S "SSL - Unknown identity received" \ |
| 7374 | -S "SSL - Verification of the message MAC failed" |
| 7375 | |
| 7376 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7378 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7379 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7380 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7381 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7382 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7383 | -C "session hash for extended master secret"\ |
| 7384 | -S "session hash for extended master secret"\ |
| 7385 | -S "SSL - The handshake negotiation failed" \ |
| 7386 | -S "SSL - Unknown identity received" \ |
| 7387 | -S "SSL - Verification of the message MAC failed" |
| 7388 | |
| 7389 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7391 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7392 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7393 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7394 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7395 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7396 | -C "session hash for extended master secret"\ |
| 7397 | -S "session hash for extended master secret"\ |
| 7398 | -S "SSL - The handshake negotiation failed" \ |
| 7399 | -S "SSL - Unknown identity received" \ |
| 7400 | -S "SSL - Verification of the message MAC failed" |
| 7401 | |
| 7402 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7404 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7405 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7406 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7407 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7408 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7409 | -c "session hash for extended master secret"\ |
| 7410 | -s "session hash for extended master secret"\ |
| 7411 | -S "SSL - The handshake negotiation failed" \ |
| 7412 | -S "SSL - Unknown identity received" \ |
| 7413 | -S "SSL - Verification of the message MAC failed" |
| 7414 | |
| 7415 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7417 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7418 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7419 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7420 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7421 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7422 | -c "session hash for extended master secret"\ |
| 7423 | -s "session hash for extended master secret"\ |
| 7424 | -S "SSL - The handshake negotiation failed" \ |
| 7425 | -S "SSL - Unknown identity received" \ |
| 7426 | -S "SSL - Verification of the message MAC failed" |
| 7427 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7428 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7430 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7431 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7432 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7433 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7434 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7435 | -C "session hash for extended master secret"\ |
| 7436 | -S "session hash for extended master secret"\ |
| 7437 | -S "SSL - The handshake negotiation failed" \ |
| 7438 | -S "SSL - Unknown identity received" \ |
| 7439 | -S "SSL - Verification of the message MAC failed" |
| 7440 | |
| 7441 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7443 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7444 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7445 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7446 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7447 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7448 | -C "session hash for extended master secret"\ |
| 7449 | -S "session hash for extended master secret"\ |
| 7450 | -S "SSL - The handshake negotiation failed" \ |
| 7451 | -S "SSL - Unknown identity received" \ |
| 7452 | -S "SSL - Verification of the message MAC failed" |
| 7453 | |
| 7454 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7456 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7457 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7458 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7459 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7460 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7461 | -c "session hash for extended master secret"\ |
| 7462 | -s "session hash for extended master secret"\ |
| 7463 | -S "SSL - The handshake negotiation failed" \ |
| 7464 | -S "SSL - Unknown identity received" \ |
| 7465 | -S "SSL - Verification of the message MAC failed" |
| 7466 | |
| 7467 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7469 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7470 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7471 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7472 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7473 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7474 | -c "session hash for extended master secret"\ |
| 7475 | -s "session hash for extended master secret"\ |
| 7476 | -S "SSL - The handshake negotiation failed" \ |
| 7477 | -S "SSL - Unknown identity received" \ |
| 7478 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7479 | |
| 7480 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7482 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7483 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7484 | "$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] | 7485 | psk_identity=foo psk=abc123" \ |
| 7486 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7487 | -C "session hash for extended master secret"\ |
| 7488 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7489 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7490 | -S "SSL - Unknown identity received" \ |
| 7491 | -S "SSL - Verification of the message MAC failed" |
| 7492 | |
| 7493 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7495 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7496 | "$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" \ |
| 7497 | "$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] | 7498 | psk_identity=foo psk=abc123" \ |
| 7499 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7500 | -C "session hash for extended master secret"\ |
| 7501 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7502 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7503 | -S "SSL - Unknown identity received" \ |
| 7504 | -S "SSL - Verification of the message MAC failed" |
| 7505 | |
| 7506 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7508 | 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] | 7509 | "$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] | 7510 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7511 | "$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] | 7512 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7513 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7514 | -c "session hash for extended master secret"\ |
| 7515 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7516 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7517 | -S "SSL - Unknown identity received" \ |
| 7518 | -S "SSL - Verification of the message MAC failed" |
| 7519 | |
| 7520 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7522 | 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] | 7523 | "$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] | 7524 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7525 | "$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] | 7526 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7527 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7528 | -c "session hash for extended master secret"\ |
| 7529 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7530 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7531 | -S "SSL - Unknown identity received" \ |
| 7532 | -S "SSL - Verification of the message MAC failed" |
| 7533 | |
| 7534 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7536 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7537 | "$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" \ |
| 7538 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7539 | psk_identity=foo psk=abc123" \ |
| 7540 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7541 | -C "session hash for extended master secret"\ |
| 7542 | -S "session hash for extended master secret"\ |
| 7543 | -S "SSL - The handshake negotiation failed" \ |
| 7544 | -S "SSL - Unknown identity received" \ |
| 7545 | -S "SSL - Verification of the message MAC failed" |
| 7546 | |
| 7547 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7549 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7550 | "$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" \ |
| 7551 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7552 | psk_identity=foo psk=abc123" \ |
| 7553 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7554 | -C "session hash for extended master secret"\ |
| 7555 | -S "session hash for extended master secret"\ |
| 7556 | -S "SSL - The handshake negotiation failed" \ |
| 7557 | -S "SSL - Unknown identity received" \ |
| 7558 | -S "SSL - Verification of the message MAC failed" |
| 7559 | |
| 7560 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7562 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7563 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7564 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7565 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7566 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7567 | 0 \ |
| 7568 | -c "session hash for extended master secret"\ |
| 7569 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7570 | -S "SSL - The handshake negotiation failed" \ |
| 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 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7576 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7577 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7578 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7579 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7580 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7581 | 0 \ |
| 7582 | -c "session hash for extended master secret"\ |
| 7583 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7584 | -S "SSL - The handshake negotiation failed" \ |
| 7585 | -S "SSL - Unknown identity received" \ |
| 7586 | -S "SSL - Verification of the message MAC failed" |
| 7587 | |
| 7588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7590 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7591 | "$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" \ |
| 7592 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7593 | psk_identity=foo psk=abc123" \ |
| 7594 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7595 | -C "session hash for extended master secret"\ |
| 7596 | -S "session hash for extended master secret"\ |
| 7597 | -S "SSL - The handshake negotiation failed" \ |
| 7598 | -S "SSL - Unknown identity received" \ |
| 7599 | -S "SSL - Verification of the message MAC failed" |
| 7600 | |
| 7601 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7603 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7604 | "$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" \ |
| 7605 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7606 | psk_identity=foo psk=abc123" \ |
| 7607 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7608 | -C "session hash for extended master secret"\ |
| 7609 | -S "session hash for extended master secret"\ |
| 7610 | -S "SSL - The handshake negotiation failed" \ |
| 7611 | -S "SSL - Unknown identity received" \ |
| 7612 | -S "SSL - Verification of the message MAC failed" |
| 7613 | |
| 7614 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7616 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7617 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7618 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7619 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7620 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7621 | 0 \ |
| 7622 | -c "session hash for extended master secret"\ |
| 7623 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7624 | -S "SSL - The handshake negotiation failed" \ |
| 7625 | -S "SSL - Unknown identity received" \ |
| 7626 | -S "SSL - Verification of the message MAC failed" |
| 7627 | |
| 7628 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7630 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7631 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7632 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7633 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7634 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7635 | 0 \ |
| 7636 | -c "session hash for extended master secret"\ |
| 7637 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7638 | -S "SSL - The handshake negotiation failed" \ |
| 7639 | -S "SSL - Unknown identity received" \ |
| 7640 | -S "SSL - Verification of the message MAC failed" |
| 7641 | |
| 7642 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7644 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7645 | "$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" \ |
| 7646 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7647 | psk_identity=foo psk=abc123" \ |
| 7648 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7649 | -C "session hash for extended master secret"\ |
| 7650 | -S "session hash for extended master secret"\ |
| 7651 | -S "SSL - The handshake negotiation failed" \ |
| 7652 | -S "SSL - Unknown identity received" \ |
| 7653 | -S "SSL - Verification of the message MAC failed" |
| 7654 | |
| 7655 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7657 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7658 | "$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" \ |
| 7659 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7660 | psk_identity=foo psk=abc123" \ |
| 7661 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7662 | -C "session hash for extended master secret"\ |
| 7663 | -S "session hash for extended master secret"\ |
| 7664 | -S "SSL - The handshake negotiation failed" \ |
| 7665 | -S "SSL - Unknown identity received" \ |
| 7666 | -S "SSL - Verification of the message MAC failed" |
| 7667 | |
| 7668 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7670 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7671 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7672 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7673 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7674 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7675 | 0 \ |
| 7676 | -c "session hash for extended master secret"\ |
| 7677 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7678 | -S "SSL - The handshake negotiation failed" \ |
| 7679 | -S "SSL - Unknown identity received" \ |
| 7680 | -S "SSL - Verification of the message MAC failed" |
| 7681 | |
| 7682 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7684 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7685 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7686 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7687 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7688 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7689 | 0 \ |
| 7690 | -c "session hash for extended master secret"\ |
| 7691 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7692 | -S "SSL - The handshake negotiation failed" \ |
| 7693 | -S "SSL - Unknown identity received" \ |
| 7694 | -S "SSL - Verification of the message MAC failed" |
| 7695 | |
| 7696 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7698 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7699 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7700 | "$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] | 7701 | psk_identity=def psk=beef" \ |
| 7702 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7703 | -C "session hash for extended master secret"\ |
| 7704 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7705 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7706 | -S "SSL - Unknown identity received" \ |
| 7707 | -S "SSL - Verification of the message MAC failed" |
| 7708 | |
| 7709 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7711 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7712 | "$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" \ |
| 7713 | "$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] | 7714 | psk_identity=def psk=beef" \ |
| 7715 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7716 | -C "session hash for extended master secret"\ |
| 7717 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7718 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7719 | -S "SSL - Unknown identity received" \ |
| 7720 | -S "SSL - Verification of the message MAC failed" |
| 7721 | |
| 7722 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7724 | 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] | 7725 | "$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] | 7726 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7727 | "$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] | 7728 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7729 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7730 | -c "session hash for extended master secret"\ |
| 7731 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7732 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7733 | -S "SSL - Unknown identity received" \ |
| 7734 | -S "SSL - Verification of the message MAC failed" |
| 7735 | |
| 7736 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7738 | 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] | 7739 | "$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] | 7740 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7741 | "$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] | 7742 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7743 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7744 | -c "session hash for extended master secret"\ |
| 7745 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7746 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7747 | -S "SSL - Unknown identity received" \ |
| 7748 | -S "SSL - Verification of the message MAC failed" |
| 7749 | |
| 7750 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7752 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7753 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 7754 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7755 | psk_identity=def psk=beef" \ |
| 7756 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7757 | -C "session hash for extended master secret"\ |
| 7758 | -S "session hash for extended master secret"\ |
| 7759 | -S "SSL - The handshake negotiation failed" \ |
| 7760 | -S "SSL - Unknown identity received" \ |
| 7761 | -S "SSL - Verification of the message MAC failed" |
| 7762 | |
| 7763 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7765 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7766 | "$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" \ |
| 7767 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7768 | psk_identity=def psk=beef" \ |
| 7769 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7770 | -C "session hash for extended master secret"\ |
| 7771 | -S "session hash for extended master secret"\ |
| 7772 | -S "SSL - The handshake negotiation failed" \ |
| 7773 | -S "SSL - Unknown identity received" \ |
| 7774 | -S "SSL - Verification of the message MAC failed" |
| 7775 | |
| 7776 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7778 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7779 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7780 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7781 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7782 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7783 | 0 \ |
| 7784 | -c "session hash for extended master secret"\ |
| 7785 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7786 | -S "SSL - The handshake negotiation failed" \ |
| 7787 | -S "SSL - Unknown identity received" \ |
| 7788 | -S "SSL - Verification of the message MAC failed" |
| 7789 | |
| 7790 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7792 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7793 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7794 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7795 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7796 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7797 | 0 \ |
| 7798 | -c "session hash for extended master secret"\ |
| 7799 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7800 | -S "SSL - The handshake negotiation failed" \ |
| 7801 | -S "SSL - Unknown identity received" \ |
| 7802 | -S "SSL - Verification of the message MAC failed" |
| 7803 | |
| 7804 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7806 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7807 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7808 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7809 | psk_identity=def psk=beef" \ |
| 7810 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7811 | -C "session hash for extended master secret"\ |
| 7812 | -S "session hash for extended master secret"\ |
| 7813 | -S "SSL - The handshake negotiation failed" \ |
| 7814 | -S "SSL - Unknown identity received" \ |
| 7815 | -S "SSL - Verification of the message MAC failed" |
| 7816 | |
| 7817 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7819 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7820 | "$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" \ |
| 7821 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7822 | psk_identity=def psk=beef" \ |
| 7823 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7824 | -C "session hash for extended master secret"\ |
| 7825 | -S "session hash for extended master secret"\ |
| 7826 | -S "SSL - The handshake negotiation failed" \ |
| 7827 | -S "SSL - Unknown identity received" \ |
| 7828 | -S "SSL - Verification of the message MAC failed" |
| 7829 | |
| 7830 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7832 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7833 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7834 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7835 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7836 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7837 | 0 \ |
| 7838 | -c "session hash for extended master secret"\ |
| 7839 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7840 | -S "SSL - The handshake negotiation failed" \ |
| 7841 | -S "SSL - Unknown identity received" \ |
| 7842 | -S "SSL - Verification of the message MAC failed" |
| 7843 | |
| 7844 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7846 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7847 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7848 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7849 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7850 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7851 | 0 \ |
| 7852 | -c "session hash for extended master secret"\ |
| 7853 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7854 | -S "SSL - The handshake negotiation failed" \ |
| 7855 | -S "SSL - Unknown identity received" \ |
| 7856 | -S "SSL - Verification of the message MAC failed" |
| 7857 | |
| 7858 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7860 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7861 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7862 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7863 | psk_identity=def psk=beef" \ |
| 7864 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7865 | -C "session hash for extended master secret"\ |
| 7866 | -S "session hash for extended master secret"\ |
| 7867 | -S "SSL - The handshake negotiation failed" \ |
| 7868 | -S "SSL - Unknown identity received" \ |
| 7869 | -S "SSL - Verification of the message MAC failed" |
| 7870 | |
| 7871 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7873 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7874 | "$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" \ |
| 7875 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7876 | psk_identity=def psk=beef" \ |
| 7877 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7878 | -C "session hash for extended master secret"\ |
| 7879 | -S "session hash for extended master secret"\ |
| 7880 | -S "SSL - The handshake negotiation failed" \ |
| 7881 | -S "SSL - Unknown identity received" \ |
| 7882 | -S "SSL - Verification of the message MAC failed" |
| 7883 | |
| 7884 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7886 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7887 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7888 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7889 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7890 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7891 | 0 \ |
| 7892 | -c "session hash for extended master secret"\ |
| 7893 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7894 | -S "SSL - The handshake negotiation failed" \ |
| 7895 | -S "SSL - Unknown identity received" \ |
| 7896 | -S "SSL - Verification of the message MAC failed" |
| 7897 | |
| 7898 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7900 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7901 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7902 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7903 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7904 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7905 | 0 \ |
| 7906 | -c "session hash for extended master secret"\ |
| 7907 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7908 | -S "SSL - The handshake negotiation failed" \ |
| 7909 | -S "SSL - Unknown identity received" \ |
| 7910 | -S "SSL - Verification of the message MAC failed" |
| 7911 | |
| 7912 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7914 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7915 | "$P_SRV extended_ms=0 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7916 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7917 | psk_identity=def psk=beef" \ |
| 7918 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7919 | -C "session hash for extended master secret"\ |
| 7920 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7921 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7922 | -S "SSL - Unknown identity received" \ |
| 7923 | -S "SSL - Verification of the message MAC failed" |
| 7924 | |
| 7925 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7927 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7928 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7929 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7930 | psk_identity=def psk=beef" \ |
| 7931 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7932 | -C "session hash for extended master secret"\ |
| 7933 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7934 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7935 | -S "SSL - Unknown identity received" \ |
| 7936 | -S "SSL - Verification of the message MAC failed" |
| 7937 | |
| 7938 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7940 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7941 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7942 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7943 | psk_identity=def psk=beef" \ |
| 7944 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7945 | -C "session hash for extended master secret"\ |
| 7946 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7947 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7948 | -S "SSL - Unknown identity received" \ |
| 7949 | -S "SSL - Verification of the message MAC failed" |
| 7950 | |
| 7951 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7953 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7954 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7955 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7956 | psk_identity=def psk=beef" \ |
| 7957 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7958 | -C "session hash for extended master secret"\ |
| 7959 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7960 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7961 | -S "SSL - Unknown identity received" \ |
| 7962 | -S "SSL - Verification of the message MAC failed" |
| 7963 | |
| 7964 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7966 | 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] | 7967 | "$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" \ |
| 7968 | "$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] | 7969 | psk_identity=def psk=beef" \ |
| 7970 | 1 \ |
| 7971 | -s "SSL - Verification of the message MAC failed" |
| 7972 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7974 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7975 | "$P_SRV" \ |
| 7976 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7977 | psk_identity=foo psk=abc123" \ |
| 7978 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7979 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7980 | -S "SSL - Unknown identity received" \ |
| 7981 | -S "SSL - Verification of the message MAC failed" |
| 7982 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7984 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7985 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7986 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7987 | psk_identity=foo psk=abc123" \ |
| 7988 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7989 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7990 | -s "SSL - Unknown identity received" \ |
| 7991 | -S "SSL - Verification of the message MAC failed" |
| 7992 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7994 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7995 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7996 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7997 | psk_identity=abc psk=dead" \ |
| 7998 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7999 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8000 | -S "SSL - Unknown identity received" \ |
| 8001 | -S "SSL - Verification of the message MAC failed" |
| 8002 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8004 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8005 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8006 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8007 | psk_identity=def psk=beef" \ |
| 8008 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8009 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8010 | -S "SSL - Unknown identity received" \ |
| 8011 | -S "SSL - Verification of the message MAC failed" |
| 8012 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8014 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8015 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8016 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8017 | psk_identity=ghi psk=beef" \ |
| 8018 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8019 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8020 | -s "SSL - Unknown identity received" \ |
| 8021 | -S "SSL - Verification of the message MAC failed" |
| 8022 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8024 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8025 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8026 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8027 | psk_identity=abc psk=beef" \ |
| 8028 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8029 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8030 | -S "SSL - Unknown identity received" \ |
| 8031 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8032 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8033 | # Tests for EC J-PAKE |
| 8034 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8035 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8037 | run_test "ECJPAKE: client not configured" \ |
| 8038 | "$P_SRV debug_level=3" \ |
| 8039 | "$P_CLI debug_level=3" \ |
| 8040 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 8041 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8042 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8043 | -S "found ecjpake kkpp extension" \ |
| 8044 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8045 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8046 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8047 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8048 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8049 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8050 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8052 | run_test "ECJPAKE: server not configured" \ |
| 8053 | "$P_SRV debug_level=3" \ |
| 8054 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8055 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8056 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8057 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8058 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8059 | -s "found ecjpake kkpp extension" \ |
| 8060 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8061 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8062 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8063 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8064 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8065 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8066 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8067 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8068 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8070 | run_test "ECJPAKE: working, TLS" \ |
| 8071 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8072 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8073 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 8074 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8075 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8076 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8077 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8078 | -s "found ecjpake kkpp extension" \ |
| 8079 | -S "skip ecjpake kkpp extension" \ |
| 8080 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8081 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8082 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8083 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8084 | -S "SSL - Verification of the message MAC failed" |
| 8085 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8086 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 8087 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8089 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8090 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8091 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8092 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8093 | 0 \ |
| 8094 | -c "add ciphersuite: c0ff" \ |
| 8095 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 8096 | -c "using opaque password" \ |
| 8097 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8098 | -C "re-using cached ecjpake parameters" \ |
| 8099 | -s "found ecjpake kkpp extension" \ |
| 8100 | -S "skip ecjpake kkpp extension" \ |
| 8101 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8102 | -s "server hello, ecjpake kkpp extension" \ |
| 8103 | -c "found ecjpake_kkpp extension" \ |
| 8104 | -S "SSL - The handshake negotiation failed" \ |
| 8105 | -S "SSL - Verification of the message MAC failed" |
| 8106 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8107 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8108 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8109 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8110 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8112 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8113 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8114 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8115 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8116 | 0 \ |
| 8117 | -c "add ciphersuite: c0ff" \ |
| 8118 | -c "adding ecjpake_kkpp extension" \ |
| 8119 | -c "using opaque password" \ |
| 8120 | -S "using opaque password" \ |
| 8121 | -C "re-using cached ecjpake parameters" \ |
| 8122 | -s "found ecjpake kkpp extension" \ |
| 8123 | -S "skip ecjpake kkpp extension" \ |
| 8124 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8125 | -s "server hello, ecjpake kkpp extension" \ |
| 8126 | -c "found ecjpake_kkpp extension" \ |
| 8127 | -S "SSL - The handshake negotiation failed" \ |
| 8128 | -S "SSL - Verification of the message MAC failed" |
| 8129 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8130 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8131 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8132 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8133 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8135 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8136 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8137 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 8138 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8139 | 0 \ |
| 8140 | -c "add ciphersuite: c0ff" \ |
| 8141 | -c "adding ecjpake_kkpp extension" \ |
| 8142 | -C "using opaque password" \ |
| 8143 | -s "using opaque password" \ |
| 8144 | -C "re-using cached ecjpake parameters" \ |
| 8145 | -s "found ecjpake kkpp extension" \ |
| 8146 | -S "skip ecjpake kkpp extension" \ |
| 8147 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8148 | -s "server hello, ecjpake kkpp extension" \ |
| 8149 | -c "found ecjpake_kkpp extension" \ |
| 8150 | -S "SSL - The handshake negotiation failed" \ |
| 8151 | -S "SSL - Verification of the message MAC failed" |
| 8152 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8153 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8154 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8156 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 8157 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8158 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 8159 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8160 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8161 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8162 | -s "SSL - Verification of the message MAC failed" |
| 8163 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8164 | server_needs_more_time 1 |
| 8165 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8166 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8168 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 8169 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8170 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 8171 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8172 | 1 \ |
| 8173 | -c "using opaque password" \ |
| 8174 | -s "using opaque password" \ |
| 8175 | -C "re-using cached ecjpake parameters" \ |
| 8176 | -s "SSL - Verification of the message MAC failed" |
| 8177 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8178 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8180 | run_test "ECJPAKE: working, DTLS" \ |
| 8181 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8182 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8183 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8184 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8185 | -c "re-using cached ecjpake parameters" \ |
| 8186 | -S "SSL - Verification of the message MAC failed" |
| 8187 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8188 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8190 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 8191 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 8192 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8193 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8194 | 0 \ |
| 8195 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8196 | -S "SSL - Verification of the message MAC failed" |
| 8197 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8198 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8199 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8201 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 8202 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8203 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 8204 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8205 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8206 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8207 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8208 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8209 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8210 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8212 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8213 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8214 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8215 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8216 | 0 |
| 8217 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8218 | # Test for ClientHello without extensions |
| 8219 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8220 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8222 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 8223 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8224 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8225 | 0 \ |
| 8226 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8227 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8228 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8229 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8230 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8232 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8233 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8234 | "$P_CLI request_size=100" \ |
| 8235 | 0 \ |
| 8236 | -s "Read from client: 100 bytes read$" |
| 8237 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8239 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8240 | "$P_SRV buffer_size=100" \ |
| 8241 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8242 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8243 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8244 | |
| 8245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8246 | requires_max_content_len 200 |
| 8247 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8248 | "$P_SRV buffer_size=100" \ |
| 8249 | "$P_CLI request_size=200" \ |
| 8250 | 0 \ |
| 8251 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8252 | |
| 8253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8254 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 8255 | "$P_SRV buffer_size=100" \ |
| 8256 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8257 | 0 \ |
| 8258 | -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] | 8259 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8260 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8261 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8262 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8263 | "$P_SRV force_version=tls12" \ |
| 8264 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8265 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8266 | 0 \ |
| 8267 | -s "Read from client: 1 bytes read" |
| 8268 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8269 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8270 | "$P_SRV force_version=tls12" \ |
| 8271 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8272 | 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] | 8273 | 0 \ |
| 8274 | -s "Read from client: 1 bytes read" |
| 8275 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8276 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8277 | "$P_SRV force_version=tls12" \ |
| 8278 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8279 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8280 | 0 \ |
| 8281 | -s "Read from client: 1 bytes read" |
| 8282 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8283 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8284 | "$P_SRV force_version=tls12" \ |
| 8285 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8286 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8287 | 0 \ |
| 8288 | -s "Read from client: 1 bytes read" |
| 8289 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8290 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8291 | "$P_SRV force_version=tls12" \ |
| 8292 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8293 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8294 | 0 \ |
| 8295 | -s "Read from client: 1 bytes read" |
| 8296 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8297 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8298 | run_test "Small client packet TLS 1.3 AEAD" \ |
| 8299 | "$P_SRV force_version=tls13" \ |
| 8300 | "$P_CLI request_size=1 \ |
| 8301 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8302 | 0 \ |
| 8303 | -s "Read from client: 1 bytes read" |
| 8304 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8305 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8306 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
| 8307 | "$P_SRV force_version=tls13" \ |
| 8308 | "$P_CLI request_size=1 \ |
| 8309 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8310 | 0 \ |
| 8311 | -s "Read from client: 1 bytes read" |
| 8312 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8313 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8314 | |
| 8315 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8316 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8317 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8318 | "$P_CLI dtls=1 request_size=1 \ |
| 8319 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8320 | 0 \ |
| 8321 | -s "Read from client: 1 bytes read" |
| 8322 | |
| 8323 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8324 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8325 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8326 | "$P_CLI dtls=1 request_size=1 \ |
| 8327 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8328 | 0 \ |
| 8329 | -s "Read from client: 1 bytes read" |
| 8330 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8331 | # Tests for small server packets |
| 8332 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8333 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8334 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8335 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8336 | 0 \ |
| 8337 | -c "Read from server: 1 bytes read" |
| 8338 | |
| 8339 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8340 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8341 | "$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] | 8342 | 0 \ |
| 8343 | -c "Read from server: 1 bytes read" |
| 8344 | |
| 8345 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8346 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8347 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8348 | 0 \ |
| 8349 | -c "Read from server: 1 bytes read" |
| 8350 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8351 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8352 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8353 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8354 | 0 \ |
| 8355 | -c "Read from server: 1 bytes read" |
| 8356 | |
| 8357 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8358 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8359 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8360 | 0 \ |
| 8361 | -c "Read from server: 1 bytes read" |
| 8362 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8363 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8364 | run_test "Small server packet TLS 1.3 AEAD" \ |
| 8365 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8366 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8367 | 0 \ |
| 8368 | -c "Read from server: 1 bytes read" |
| 8369 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8370 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8371 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
| 8372 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8373 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8374 | 0 \ |
| 8375 | -c "Read from server: 1 bytes read" |
| 8376 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8377 | # Tests for small server packets in DTLS |
| 8378 | |
| 8379 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8380 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8381 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8382 | "$P_CLI dtls=1 \ |
| 8383 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8384 | 0 \ |
| 8385 | -c "Read from server: 1 bytes read" |
| 8386 | |
| 8387 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8388 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8389 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8390 | "$P_CLI dtls=1 \ |
| 8391 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8392 | 0 \ |
| 8393 | -c "Read from server: 1 bytes read" |
| 8394 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8395 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8396 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8397 | # How many fragments do we expect to write $1 bytes? |
| 8398 | fragments_for_write() { |
| 8399 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8400 | } |
| 8401 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8402 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8403 | "$P_SRV force_version=tls12" \ |
| 8404 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8405 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8406 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8407 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8408 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8409 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8410 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8411 | "$P_SRV force_version=tls12" \ |
| 8412 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8413 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8414 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8415 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8416 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8417 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8418 | "$P_SRV force_version=tls12" \ |
| 8419 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8420 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8421 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8422 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8423 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8424 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8425 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8426 | "$P_SRV force_version=tls12" \ |
| 8427 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8428 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8429 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8430 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8431 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8432 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8433 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8434 | "$P_SRV force_version=tls12" \ |
| 8435 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8436 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8437 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8438 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8439 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8440 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8441 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8442 | run_test "Large client packet TLS 1.3 AEAD" \ |
| 8443 | "$P_SRV force_version=tls13" \ |
| 8444 | "$P_CLI request_size=16384 \ |
| 8445 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8446 | 0 \ |
| 8447 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8448 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8449 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8450 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8451 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
| 8452 | "$P_SRV force_version=tls13" \ |
| 8453 | "$P_CLI request_size=16384 \ |
| 8454 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8455 | 0 \ |
| 8456 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8457 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8458 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8459 | # 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] | 8460 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8461 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8462 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8463 | 0 \ |
| 8464 | -c "Read from server: 16384 bytes read" |
| 8465 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8466 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8467 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8468 | "$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] | 8469 | 0 \ |
| 8470 | -s "16384 bytes written in 1 fragments" \ |
| 8471 | -c "Read from server: 16384 bytes read" |
| 8472 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8473 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8474 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8475 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8476 | 0 \ |
| 8477 | -c "Read from server: 16384 bytes read" |
| 8478 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8479 | 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] | 8480 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8481 | "$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] | 8482 | 0 \ |
| 8483 | -s "16384 bytes written in 1 fragments" \ |
| 8484 | -c "Read from server: 16384 bytes read" |
| 8485 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8486 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8487 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8488 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8489 | 0 \ |
| 8490 | -c "Read from server: 16384 bytes read" |
| 8491 | |
| 8492 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8493 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8494 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8495 | 0 \ |
| 8496 | -c "Read from server: 16384 bytes read" |
| 8497 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8498 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8499 | run_test "Large server packet TLS 1.3 AEAD" \ |
| 8500 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8501 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8502 | 0 \ |
| 8503 | -c "Read from server: 16384 bytes read" |
| 8504 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8505 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8506 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
| 8507 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8508 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8509 | 0 \ |
| 8510 | -c "Read from server: 16384 bytes read" |
| 8511 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8512 | # Tests for restartable ECC |
| 8513 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8514 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8515 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8516 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8517 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8519 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8520 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8521 | "$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] | 8522 | 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] | 8523 | debug_level=1" \ |
| 8524 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8525 | -C "x509_verify_cert.*4b00" \ |
| 8526 | -C "mbedtls_pk_verify.*4b00" \ |
| 8527 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8528 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8529 | |
| 8530 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8531 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8533 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8534 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8535 | "$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] | 8536 | 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] | 8537 | debug_level=1 ec_max_ops=0" \ |
| 8538 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8539 | -C "x509_verify_cert.*4b00" \ |
| 8540 | -C "mbedtls_pk_verify.*4b00" \ |
| 8541 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8542 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8543 | |
| 8544 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8545 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8547 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8548 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8549 | "$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] | 8550 | 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] | 8551 | debug_level=1 ec_max_ops=65535" \ |
| 8552 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8553 | -C "x509_verify_cert.*4b00" \ |
| 8554 | -C "mbedtls_pk_verify.*4b00" \ |
| 8555 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8556 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8557 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8558 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8559 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8560 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8562 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8563 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8564 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8565 | "$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] | 8566 | 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] | 8567 | debug_level=1 ec_max_ops=1000" \ |
| 8568 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8569 | -c "x509_verify_cert.*4b00" \ |
| 8570 | -c "mbedtls_pk_verify.*4b00" \ |
| 8571 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8572 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8573 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8574 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8575 | # everything except ECDH (where TLS calls PSA directly). |
| 8576 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8577 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8579 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8580 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
| 8581 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 8582 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8583 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8584 | debug_level=1 ec_max_ops=1000" \ |
| 8585 | 0 \ |
| 8586 | -c "x509_verify_cert.*4b00" \ |
| 8587 | -c "mbedtls_pk_verify.*4b00" \ |
| 8588 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8589 | -c "mbedtls_pk_sign.*4b00" |
| 8590 | |
| 8591 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 8592 | # 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] | 8593 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8594 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8596 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8597 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8598 | crt_file=data_files/server5-badsign.crt \ |
| 8599 | key_file=data_files/server5.key" \ |
| 8600 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8601 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8602 | debug_level=1 ec_max_ops=1000" \ |
| 8603 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8604 | -c "x509_verify_cert.*4b00" \ |
| 8605 | -C "mbedtls_pk_verify.*4b00" \ |
| 8606 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8607 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8608 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8609 | -c "! mbedtls_ssl_handshake returned" \ |
| 8610 | -c "X509 - Certificate verification failed" |
| 8611 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8612 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8613 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8614 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8616 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8617 | 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] | 8618 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8619 | crt_file=data_files/server5-badsign.crt \ |
| 8620 | key_file=data_files/server5.key" \ |
| 8621 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8622 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8623 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8624 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8625 | -c "x509_verify_cert.*4b00" \ |
| 8626 | -c "mbedtls_pk_verify.*4b00" \ |
| 8627 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8628 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8629 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8630 | -C "! mbedtls_ssl_handshake returned" \ |
| 8631 | -C "X509 - Certificate verification failed" |
| 8632 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8633 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8634 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8635 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8636 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8638 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8639 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (USE_PSA)" \ |
| 8640 | "$P_SRV curves=secp256r1 auth_mode=required \ |
| 8641 | crt_file=data_files/server5-badsign.crt \ |
| 8642 | key_file=data_files/server5.key" \ |
| 8643 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8644 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8645 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8646 | 0 \ |
| 8647 | -c "x509_verify_cert.*4b00" \ |
| 8648 | -c "mbedtls_pk_verify.*4b00" \ |
| 8649 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8650 | -c "mbedtls_pk_sign.*4b00" \ |
| 8651 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8652 | -C "! mbedtls_ssl_handshake returned" \ |
| 8653 | -C "X509 - Certificate verification failed" |
| 8654 | |
| 8655 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8656 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8657 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8659 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8660 | 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] | 8661 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8662 | crt_file=data_files/server5-badsign.crt \ |
| 8663 | key_file=data_files/server5.key" \ |
| 8664 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8665 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8666 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8667 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8668 | -C "x509_verify_cert.*4b00" \ |
| 8669 | -c "mbedtls_pk_verify.*4b00" \ |
| 8670 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8671 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8672 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8673 | -C "! mbedtls_ssl_handshake returned" \ |
| 8674 | -C "X509 - Certificate verification failed" |
| 8675 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8676 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8677 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8678 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8679 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8681 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8682 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (USE_PSA)" \ |
| 8683 | "$P_SRV curves=secp256r1 auth_mode=required \ |
| 8684 | crt_file=data_files/server5-badsign.crt \ |
| 8685 | key_file=data_files/server5.key" \ |
| 8686 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8687 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8688 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8689 | 0 \ |
| 8690 | -C "x509_verify_cert.*4b00" \ |
| 8691 | -c "mbedtls_pk_verify.*4b00" \ |
| 8692 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8693 | -c "mbedtls_pk_sign.*4b00" \ |
| 8694 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8695 | -C "! mbedtls_ssl_handshake returned" \ |
| 8696 | -C "X509 - Certificate verification failed" |
| 8697 | |
| 8698 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8699 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8700 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8702 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8703 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8704 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8705 | "$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] | 8706 | 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] | 8707 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8708 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8709 | -c "x509_verify_cert.*4b00" \ |
| 8710 | -c "mbedtls_pk_verify.*4b00" \ |
| 8711 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8712 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8713 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8714 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8715 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8716 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8717 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8719 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8720 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
| 8721 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
| 8722 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8723 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8724 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8725 | 0 \ |
| 8726 | -c "x509_verify_cert.*4b00" \ |
| 8727 | -c "mbedtls_pk_verify.*4b00" \ |
| 8728 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8729 | -c "mbedtls_pk_sign.*4b00" |
| 8730 | |
| 8731 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8732 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8733 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8735 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8736 | 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] | 8737 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8738 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8739 | debug_level=1 ec_max_ops=1000" \ |
| 8740 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8741 | -c "x509_verify_cert.*4b00" \ |
| 8742 | -c "mbedtls_pk_verify.*4b00" \ |
| 8743 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8744 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8745 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8746 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8747 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8748 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8749 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8750 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8752 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8753 | run_test "EC restart: TLS, max_ops=1000 no client auth (USE_PSA)" \ |
| 8754 | "$P_SRV curves=secp256r1" \ |
| 8755 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8756 | debug_level=1 ec_max_ops=1000" \ |
| 8757 | 0 \ |
| 8758 | -c "x509_verify_cert.*4b00" \ |
| 8759 | -c "mbedtls_pk_verify.*4b00" \ |
| 8760 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8761 | -C "mbedtls_pk_sign.*4b00" |
| 8762 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8763 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 8764 | # restartable behaviour at all (not even client auth). |
| 8765 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 8766 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8767 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8768 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 8769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8770 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
| 8771 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 8772 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
| 8773 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8774 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8775 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8776 | -C "x509_verify_cert.*4b00" \ |
| 8777 | -C "mbedtls_pk_verify.*4b00" \ |
| 8778 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8779 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8780 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8781 | # Tests of asynchronous private key support in SSL |
| 8782 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8783 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8785 | run_test "SSL async private: sign, delay=0" \ |
| 8786 | "$P_SRV \ |
| 8787 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8788 | "$P_CLI" \ |
| 8789 | 0 \ |
| 8790 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8791 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8792 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8793 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8795 | run_test "SSL async private: sign, delay=1" \ |
| 8796 | "$P_SRV \ |
| 8797 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8798 | "$P_CLI" \ |
| 8799 | 0 \ |
| 8800 | -s "Async sign callback: using key slot " \ |
| 8801 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8802 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8803 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8804 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8806 | run_test "SSL async private: sign, delay=2" \ |
| 8807 | "$P_SRV \ |
| 8808 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8809 | "$P_CLI" \ |
| 8810 | 0 \ |
| 8811 | -s "Async sign callback: using key slot " \ |
| 8812 | -U "Async sign callback: using key slot " \ |
| 8813 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8814 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8815 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8816 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8817 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8818 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8820 | run_test "SSL async private: sign, SNI" \ |
| 8821 | "$P_SRV debug_level=3 \ |
| 8822 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8823 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8824 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8825 | "$P_CLI server_name=polarssl.example" \ |
| 8826 | 0 \ |
| 8827 | -s "Async sign callback: using key slot " \ |
| 8828 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8829 | -s "parse ServerName extension" \ |
| 8830 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8831 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8832 | |
| 8833 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8835 | run_test "SSL async private: decrypt, delay=0" \ |
| 8836 | "$P_SRV \ |
| 8837 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8838 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8839 | 0 \ |
| 8840 | -s "Async decrypt callback: using key slot " \ |
| 8841 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8842 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8843 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8845 | run_test "SSL async private: decrypt, delay=1" \ |
| 8846 | "$P_SRV \ |
| 8847 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8848 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8849 | 0 \ |
| 8850 | -s "Async decrypt callback: using key slot " \ |
| 8851 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8852 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8853 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8854 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8856 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8857 | "$P_SRV psk=abc123 \ |
| 8858 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8859 | "$P_CLI psk=abc123 \ |
| 8860 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8861 | 0 \ |
| 8862 | -s "Async decrypt callback: using key slot " \ |
| 8863 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8864 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8865 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8867 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8868 | "$P_SRV psk=abc123 \ |
| 8869 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8870 | "$P_CLI psk=abc123 \ |
| 8871 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8872 | 0 \ |
| 8873 | -s "Async decrypt callback: using key slot " \ |
| 8874 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8875 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8876 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8877 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8879 | run_test "SSL async private: sign callback not present" \ |
| 8880 | "$P_SRV \ |
| 8881 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8882 | "$P_CLI; [ \$? -eq 1 ] && |
| 8883 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8884 | 0 \ |
| 8885 | -S "Async sign callback" \ |
| 8886 | -s "! mbedtls_ssl_handshake returned" \ |
| 8887 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8888 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8889 | -s "Successful connection" |
| 8890 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8891 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8893 | run_test "SSL async private: decrypt callback not present" \ |
| 8894 | "$P_SRV debug_level=1 \ |
| 8895 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8896 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 8897 | [ \$? -eq 1 ] && $P_CLI" \ |
| 8898 | 0 \ |
| 8899 | -S "Async decrypt callback" \ |
| 8900 | -s "! mbedtls_ssl_handshake returned" \ |
| 8901 | -s "got no RSA private key" \ |
| 8902 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8903 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8904 | |
| 8905 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8906 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8908 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8909 | "$P_SRV \ |
| 8910 | async_operations=s async_private_delay1=1 \ |
| 8911 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8912 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8913 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8914 | 0 \ |
| 8915 | -s "Async sign callback: using key slot 0," \ |
| 8916 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8917 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8918 | |
| 8919 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8920 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8922 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8923 | "$P_SRV \ |
| 8924 | async_operations=s async_private_delay2=1 \ |
| 8925 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8926 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8927 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8928 | 0 \ |
| 8929 | -s "Async sign callback: using key slot 0," \ |
| 8930 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8931 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8932 | |
| 8933 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8934 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8935 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8936 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8937 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8938 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8939 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8940 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8941 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8942 | 0 \ |
| 8943 | -s "Async sign callback: using key slot 1," \ |
| 8944 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8945 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8946 | |
| 8947 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8948 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8950 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8951 | "$P_SRV \ |
| 8952 | async_operations=s async_private_delay1=1 \ |
| 8953 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8954 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8955 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8956 | 0 \ |
| 8957 | -s "Async sign callback: no key matches this certificate." |
| 8958 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8959 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8961 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8962 | "$P_SRV \ |
| 8963 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8964 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8965 | "$P_CLI" \ |
| 8966 | 1 \ |
| 8967 | -s "Async sign callback: injected error" \ |
| 8968 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8969 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8970 | -s "! mbedtls_ssl_handshake returned" |
| 8971 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8972 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8974 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8975 | "$P_SRV \ |
| 8976 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8977 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8978 | "$P_CLI" \ |
| 8979 | 1 \ |
| 8980 | -s "Async sign callback: using key slot " \ |
| 8981 | -S "Async resume" \ |
| 8982 | -s "Async cancel" |
| 8983 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8984 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8986 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8987 | "$P_SRV \ |
| 8988 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8989 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8990 | "$P_CLI" \ |
| 8991 | 1 \ |
| 8992 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8993 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8994 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8995 | -s "! mbedtls_ssl_handshake returned" |
| 8996 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8997 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8999 | run_test "SSL async private: decrypt, error in start" \ |
| 9000 | "$P_SRV \ |
| 9001 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9002 | async_private_error=1" \ |
| 9003 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9004 | 1 \ |
| 9005 | -s "Async decrypt callback: injected error" \ |
| 9006 | -S "Async resume" \ |
| 9007 | -S "Async cancel" \ |
| 9008 | -s "! mbedtls_ssl_handshake returned" |
| 9009 | |
| 9010 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9012 | run_test "SSL async private: decrypt, cancel after start" \ |
| 9013 | "$P_SRV \ |
| 9014 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9015 | async_private_error=2" \ |
| 9016 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9017 | 1 \ |
| 9018 | -s "Async decrypt callback: using key slot " \ |
| 9019 | -S "Async resume" \ |
| 9020 | -s "Async cancel" |
| 9021 | |
| 9022 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9024 | run_test "SSL async private: decrypt, error in resume" \ |
| 9025 | "$P_SRV \ |
| 9026 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9027 | async_private_error=3" \ |
| 9028 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9029 | 1 \ |
| 9030 | -s "Async decrypt callback: using key slot " \ |
| 9031 | -s "Async resume callback: decrypt done but injected error" \ |
| 9032 | -S "Async cancel" \ |
| 9033 | -s "! mbedtls_ssl_handshake returned" |
| 9034 | |
| 9035 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9037 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9038 | "$P_SRV \ |
| 9039 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9040 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9041 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9042 | 0 \ |
| 9043 | -s "Async cancel" \ |
| 9044 | -s "! mbedtls_ssl_handshake returned" \ |
| 9045 | -s "Async resume" \ |
| 9046 | -s "Successful connection" |
| 9047 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9048 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9050 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9051 | "$P_SRV \ |
| 9052 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9053 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9054 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9055 | 0 \ |
| 9056 | -s "! mbedtls_ssl_handshake returned" \ |
| 9057 | -s "Async resume" \ |
| 9058 | -s "Successful connection" |
| 9059 | |
| 9060 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9061 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9063 | 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] | 9064 | "$P_SRV \ |
| 9065 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 9066 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9067 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9068 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9069 | [ \$? -eq 1 ] && |
| 9070 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9071 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 9072 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9073 | -S "Async resume" \ |
| 9074 | -s "Async cancel" \ |
| 9075 | -s "! mbedtls_ssl_handshake returned" \ |
| 9076 | -s "Async sign callback: no key matches this certificate." \ |
| 9077 | -s "Successful connection" |
| 9078 | |
| 9079 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9080 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9082 | 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] | 9083 | "$P_SRV \ |
| 9084 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 9085 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9086 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9087 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9088 | [ \$? -eq 1 ] && |
| 9089 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9090 | 0 \ |
| 9091 | -s "Async resume" \ |
| 9092 | -s "! mbedtls_ssl_handshake returned" \ |
| 9093 | -s "Async sign callback: no key matches this certificate." \ |
| 9094 | -s "Successful connection" |
| 9095 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9096 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9097 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9099 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9100 | "$P_SRV \ |
| 9101 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9102 | exchanges=2 renegotiation=1" \ |
| 9103 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9104 | 0 \ |
| 9105 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9106 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9107 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9108 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9109 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9111 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9112 | "$P_SRV \ |
| 9113 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9114 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9115 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 9116 | 0 \ |
| 9117 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9118 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9119 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9120 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9121 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9123 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9124 | "$P_SRV \ |
| 9125 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9126 | exchanges=2 renegotiation=1" \ |
| 9127 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 9128 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9129 | 0 \ |
| 9130 | -s "Async decrypt callback: using key slot " \ |
| 9131 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9132 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9133 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9134 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9136 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9137 | "$P_SRV \ |
| 9138 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9139 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9140 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 9141 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9142 | 0 \ |
| 9143 | -s "Async decrypt callback: using key slot " \ |
| 9144 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9145 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9146 | # Tests for ECC extensions (rfc 4492) |
| 9147 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9148 | requires_config_enabled MBEDTLS_AES_C |
| 9149 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9150 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9151 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9153 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 9154 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9155 | "$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] | 9156 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9157 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9158 | -C "client hello, adding supported_point_formats extension" \ |
| 9159 | -S "found supported elliptic curves extension" \ |
| 9160 | -S "found supported point formats extension" |
| 9161 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9162 | requires_config_enabled MBEDTLS_AES_C |
| 9163 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9164 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9165 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9167 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9168 | "$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] | 9169 | "$P_CLI debug_level=3" \ |
| 9170 | 0 \ |
| 9171 | -C "found supported_point_formats extension" \ |
| 9172 | -S "server hello, supported_point_formats extension" |
| 9173 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9174 | requires_config_enabled MBEDTLS_AES_C |
| 9175 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9176 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9177 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9179 | run_test "Force an ECC ciphersuite in the client side" \ |
| 9180 | "$P_SRV debug_level=3" \ |
| 9181 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9182 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9183 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9184 | -c "client hello, adding supported_point_formats extension" \ |
| 9185 | -s "found supported elliptic curves extension" \ |
| 9186 | -s "found supported point formats extension" |
| 9187 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9188 | requires_config_enabled MBEDTLS_AES_C |
| 9189 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9190 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9191 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9193 | run_test "Force an ECC ciphersuite in the server side" \ |
| 9194 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9195 | "$P_CLI debug_level=3" \ |
| 9196 | 0 \ |
| 9197 | -c "found supported_point_formats extension" \ |
| 9198 | -s "server hello, supported_point_formats extension" |
| 9199 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9200 | # Tests for DTLS HelloVerifyRequest |
| 9201 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9203 | run_test "DTLS cookie: enabled" \ |
| 9204 | "$P_SRV dtls=1 debug_level=2" \ |
| 9205 | "$P_CLI dtls=1 debug_level=2" \ |
| 9206 | 0 \ |
| 9207 | -s "cookie verification failed" \ |
| 9208 | -s "cookie verification passed" \ |
| 9209 | -S "cookie verification skipped" \ |
| 9210 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9211 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9212 | -S "SSL - The requested feature is not available" |
| 9213 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9215 | run_test "DTLS cookie: disabled" \ |
| 9216 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 9217 | "$P_CLI dtls=1 debug_level=2" \ |
| 9218 | 0 \ |
| 9219 | -S "cookie verification failed" \ |
| 9220 | -S "cookie verification passed" \ |
| 9221 | -s "cookie verification skipped" \ |
| 9222 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9223 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9224 | -S "SSL - The requested feature is not available" |
| 9225 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9227 | run_test "DTLS cookie: default (failing)" \ |
| 9228 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 9229 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 9230 | 1 \ |
| 9231 | -s "cookie verification failed" \ |
| 9232 | -S "cookie verification passed" \ |
| 9233 | -S "cookie verification skipped" \ |
| 9234 | -C "received hello verify request" \ |
| 9235 | -S "hello verification requested" \ |
| 9236 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9237 | |
| 9238 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9240 | run_test "DTLS cookie: enabled, IPv6" \ |
| 9241 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 9242 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 9243 | 0 \ |
| 9244 | -s "cookie verification failed" \ |
| 9245 | -s "cookie verification passed" \ |
| 9246 | -S "cookie verification skipped" \ |
| 9247 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9248 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9249 | -S "SSL - The requested feature is not available" |
| 9250 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9252 | run_test "DTLS cookie: enabled, nbio" \ |
| 9253 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 9254 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9255 | 0 \ |
| 9256 | -s "cookie verification failed" \ |
| 9257 | -s "cookie verification passed" \ |
| 9258 | -S "cookie verification skipped" \ |
| 9259 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9260 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9261 | -S "SSL - The requested feature is not available" |
| 9262 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9263 | # Tests for client reconnecting from the same port with DTLS |
| 9264 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9265 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9267 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9268 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9269 | "$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] | 9270 | 0 \ |
| 9271 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9272 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9273 | -S "Client initiated reconnection from same port" |
| 9274 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9275 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9277 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9278 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9279 | "$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] | 9280 | 0 \ |
| 9281 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9282 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9283 | -s "Client initiated reconnection from same port" |
| 9284 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9285 | 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] | 9286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9287 | 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] | 9288 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 9289 | "$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] | 9290 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9291 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9292 | -s "Client initiated reconnection from same port" |
| 9293 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9294 | 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] | 9295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9296 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 9297 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 9298 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 9299 | 0 \ |
| 9300 | -S "The operation timed out" \ |
| 9301 | -s "Client initiated reconnection from same port" |
| 9302 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9304 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 9305 | "$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] | 9306 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 9307 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9308 | -s "The operation timed out" \ |
| 9309 | -S "Client initiated reconnection from same port" |
| 9310 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9312 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 9313 | -p "$P_PXY inject_clihlo=1" \ |
| 9314 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 9315 | "$P_CLI dtls=1 exchanges=2" \ |
| 9316 | 0 \ |
| 9317 | -s "possible client reconnect from the same port" \ |
| 9318 | -S "Client initiated reconnection from same port" |
| 9319 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9320 | # Tests for various cases of client authentication with DTLS |
| 9321 | # (focused on handshake flows and message parsing) |
| 9322 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9324 | run_test "DTLS client auth: required" \ |
| 9325 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9326 | "$P_CLI dtls=1" \ |
| 9327 | 0 \ |
| 9328 | -s "Verifying peer X.509 certificate... ok" |
| 9329 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9331 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9332 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9333 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9334 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9335 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9336 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9338 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9339 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9340 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9341 | 0 \ |
| 9342 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9343 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9344 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9346 | run_test "DTLS wrong PSK: badmac alert" \ |
| 9347 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 9348 | "$P_CLI dtls=1 psk=abc124" \ |
| 9349 | 1 \ |
| 9350 | -s "SSL - Verification of the message MAC failed" \ |
| 9351 | -c "SSL - A fatal alert message was received from our peer" |
| 9352 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9353 | # Tests for receiving fragmented handshake messages with DTLS |
| 9354 | |
| 9355 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9357 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9358 | "$G_SRV -u --mtu 2048 -a" \ |
| 9359 | "$P_CLI dtls=1 debug_level=2" \ |
| 9360 | 0 \ |
| 9361 | -C "found fragmented DTLS handshake message" \ |
| 9362 | -C "error" |
| 9363 | |
| 9364 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9366 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9367 | "$G_SRV -u --mtu 512" \ |
| 9368 | "$P_CLI dtls=1 debug_level=2" \ |
| 9369 | 0 \ |
| 9370 | -c "found fragmented DTLS handshake message" \ |
| 9371 | -C "error" |
| 9372 | |
| 9373 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9375 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9376 | "$G_SRV -u --mtu 128" \ |
| 9377 | "$P_CLI dtls=1 debug_level=2" \ |
| 9378 | 0 \ |
| 9379 | -c "found fragmented DTLS handshake message" \ |
| 9380 | -C "error" |
| 9381 | |
| 9382 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9384 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9385 | "$G_SRV -u --mtu 128" \ |
| 9386 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9387 | 0 \ |
| 9388 | -c "found fragmented DTLS handshake message" \ |
| 9389 | -C "error" |
| 9390 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9391 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9392 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9394 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9395 | "$G_SRV -u --mtu 256" \ |
| 9396 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9397 | 0 \ |
| 9398 | -c "found fragmented DTLS handshake message" \ |
| 9399 | -c "client hello, adding renegotiation extension" \ |
| 9400 | -c "found renegotiation extension" \ |
| 9401 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9402 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9403 | -C "error" \ |
| 9404 | -s "Extra-header:" |
| 9405 | |
| 9406 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9407 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9409 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9410 | "$G_SRV -u --mtu 256" \ |
| 9411 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9412 | 0 \ |
| 9413 | -c "found fragmented DTLS handshake message" \ |
| 9414 | -c "client hello, adding renegotiation extension" \ |
| 9415 | -c "found renegotiation extension" \ |
| 9416 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9417 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9418 | -C "error" \ |
| 9419 | -s "Extra-header:" |
| 9420 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9422 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9423 | "$O_SRV -dtls -mtu 2048" \ |
| 9424 | "$P_CLI dtls=1 debug_level=2" \ |
| 9425 | 0 \ |
| 9426 | -C "found fragmented DTLS handshake message" \ |
| 9427 | -C "error" |
| 9428 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9430 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 9431 | "$O_SRV -dtls -mtu 768" \ |
| 9432 | "$P_CLI dtls=1 debug_level=2" \ |
| 9433 | 0 \ |
| 9434 | -c "found fragmented DTLS handshake message" \ |
| 9435 | -C "error" |
| 9436 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9438 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9439 | "$O_SRV -dtls -mtu 256" \ |
| 9440 | "$P_CLI dtls=1 debug_level=2" \ |
| 9441 | 0 \ |
| 9442 | -c "found fragmented DTLS handshake message" \ |
| 9443 | -C "error" |
| 9444 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9446 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9447 | "$O_SRV -dtls -mtu 256" \ |
| 9448 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9449 | 0 \ |
| 9450 | -c "found fragmented DTLS handshake message" \ |
| 9451 | -C "error" |
| 9452 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9453 | # Tests for sending fragmented handshake messages with DTLS |
| 9454 | # |
| 9455 | # Use client auth when we need the client to send large messages, |
| 9456 | # and use large cert chains on both sides too (the long chains we have all use |
| 9457 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9458 | # Sizes reached (UDP payload): |
| 9459 | # - 2037B for server certificate |
| 9460 | # - 1542B for client certificate |
| 9461 | # - 1013B for newsessionticket |
| 9462 | # - all others below 512B |
| 9463 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9464 | |
| 9465 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9466 | requires_config_enabled MBEDTLS_RSA_C |
| 9467 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9468 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9469 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9471 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9472 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9473 | crt_file=data_files/server7_int-ca.crt \ |
| 9474 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9475 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9476 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9477 | "$P_CLI dtls=1 debug_level=2 \ |
| 9478 | crt_file=data_files/server8_int-ca2.crt \ |
| 9479 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9480 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9481 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9482 | 0 \ |
| 9483 | -S "found fragmented DTLS handshake message" \ |
| 9484 | -C "found fragmented DTLS handshake message" \ |
| 9485 | -C "error" |
| 9486 | |
| 9487 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9488 | requires_config_enabled MBEDTLS_RSA_C |
| 9489 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9490 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9491 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9493 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9494 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9495 | crt_file=data_files/server7_int-ca.crt \ |
| 9496 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9497 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9498 | max_frag_len=1024" \ |
| 9499 | "$P_CLI dtls=1 debug_level=2 \ |
| 9500 | crt_file=data_files/server8_int-ca2.crt \ |
| 9501 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9502 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9503 | max_frag_len=2048" \ |
| 9504 | 0 \ |
| 9505 | -S "found fragmented DTLS handshake message" \ |
| 9506 | -c "found fragmented DTLS handshake message" \ |
| 9507 | -C "error" |
| 9508 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9509 | # With the MFL extension, the server has no way of forcing |
| 9510 | # the client to not exceed a certain MTU; hence, the following |
| 9511 | # test can't be replicated with an MTU proxy such as the one |
| 9512 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9513 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9514 | requires_config_enabled MBEDTLS_RSA_C |
| 9515 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9516 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9517 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9519 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9520 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9521 | crt_file=data_files/server7_int-ca.crt \ |
| 9522 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9523 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9524 | max_frag_len=512" \ |
| 9525 | "$P_CLI dtls=1 debug_level=2 \ |
| 9526 | crt_file=data_files/server8_int-ca2.crt \ |
| 9527 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9528 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9529 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9530 | 0 \ |
| 9531 | -S "found fragmented DTLS handshake message" \ |
| 9532 | -c "found fragmented DTLS handshake message" \ |
| 9533 | -C "error" |
| 9534 | |
| 9535 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9536 | requires_config_enabled MBEDTLS_RSA_C |
| 9537 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9538 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9539 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9541 | 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] | 9542 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9543 | crt_file=data_files/server7_int-ca.crt \ |
| 9544 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9545 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9546 | max_frag_len=2048" \ |
| 9547 | "$P_CLI dtls=1 debug_level=2 \ |
| 9548 | crt_file=data_files/server8_int-ca2.crt \ |
| 9549 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9550 | hs_timeout=2500-60000 \ |
| 9551 | max_frag_len=1024" \ |
| 9552 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9553 | -S "found fragmented DTLS handshake message" \ |
| 9554 | -c "found fragmented DTLS handshake message" \ |
| 9555 | -C "error" |
| 9556 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9557 | # While not required by the standard defining the MFL extension |
| 9558 | # (according to which it only applies to records, not to datagrams), |
| 9559 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9560 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9561 | # to the peer. |
| 9562 | # The next test checks that no datagrams significantly larger than the |
| 9563 | # negotiated MFL are sent. |
| 9564 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9565 | requires_config_enabled MBEDTLS_RSA_C |
| 9566 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9567 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9568 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9570 | 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] | 9571 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9572 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9573 | crt_file=data_files/server7_int-ca.crt \ |
| 9574 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9575 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9576 | max_frag_len=2048" \ |
| 9577 | "$P_CLI dtls=1 debug_level=2 \ |
| 9578 | crt_file=data_files/server8_int-ca2.crt \ |
| 9579 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9580 | hs_timeout=2500-60000 \ |
| 9581 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9582 | 0 \ |
| 9583 | -S "found fragmented DTLS handshake message" \ |
| 9584 | -c "found fragmented DTLS handshake message" \ |
| 9585 | -C "error" |
| 9586 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9587 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9588 | requires_config_enabled MBEDTLS_RSA_C |
| 9589 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9590 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9591 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9593 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9594 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9595 | crt_file=data_files/server7_int-ca.crt \ |
| 9596 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9597 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9598 | max_frag_len=2048" \ |
| 9599 | "$P_CLI dtls=1 debug_level=2 \ |
| 9600 | crt_file=data_files/server8_int-ca2.crt \ |
| 9601 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9602 | hs_timeout=2500-60000 \ |
| 9603 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9604 | 0 \ |
| 9605 | -s "found fragmented DTLS handshake message" \ |
| 9606 | -c "found fragmented DTLS handshake message" \ |
| 9607 | -C "error" |
| 9608 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9609 | # While not required by the standard defining the MFL extension |
| 9610 | # (according to which it only applies to records, not to datagrams), |
| 9611 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9612 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9613 | # to the peer. |
| 9614 | # The next test checks that no datagrams significantly larger than the |
| 9615 | # negotiated MFL are sent. |
| 9616 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9617 | requires_config_enabled MBEDTLS_RSA_C |
| 9618 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9619 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9620 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9622 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9623 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9624 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9625 | crt_file=data_files/server7_int-ca.crt \ |
| 9626 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9627 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9628 | max_frag_len=2048" \ |
| 9629 | "$P_CLI dtls=1 debug_level=2 \ |
| 9630 | crt_file=data_files/server8_int-ca2.crt \ |
| 9631 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9632 | hs_timeout=2500-60000 \ |
| 9633 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9634 | 0 \ |
| 9635 | -s "found fragmented DTLS handshake message" \ |
| 9636 | -c "found fragmented DTLS handshake message" \ |
| 9637 | -C "error" |
| 9638 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9639 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9640 | requires_config_enabled MBEDTLS_RSA_C |
| 9641 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9642 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9644 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9645 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9646 | crt_file=data_files/server7_int-ca.crt \ |
| 9647 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9648 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9649 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9650 | "$P_CLI dtls=1 debug_level=2 \ |
| 9651 | crt_file=data_files/server8_int-ca2.crt \ |
| 9652 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9653 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9654 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9655 | 0 \ |
| 9656 | -S "found fragmented DTLS handshake message" \ |
| 9657 | -C "found fragmented DTLS handshake message" \ |
| 9658 | -C "error" |
| 9659 | |
| 9660 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9661 | requires_config_enabled MBEDTLS_RSA_C |
| 9662 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9663 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9665 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9666 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9667 | crt_file=data_files/server7_int-ca.crt \ |
| 9668 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9669 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9670 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9671 | "$P_CLI dtls=1 debug_level=2 \ |
| 9672 | crt_file=data_files/server8_int-ca2.crt \ |
| 9673 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9674 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9675 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9676 | 0 \ |
| 9677 | -s "found fragmented DTLS handshake message" \ |
| 9678 | -C "found fragmented DTLS handshake message" \ |
| 9679 | -C "error" |
| 9680 | |
| 9681 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9682 | requires_config_enabled MBEDTLS_RSA_C |
| 9683 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9684 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9686 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9687 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9688 | crt_file=data_files/server7_int-ca.crt \ |
| 9689 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9690 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9691 | mtu=512" \ |
| 9692 | "$P_CLI dtls=1 debug_level=2 \ |
| 9693 | crt_file=data_files/server8_int-ca2.crt \ |
| 9694 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9695 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9696 | mtu=2048" \ |
| 9697 | 0 \ |
| 9698 | -S "found fragmented DTLS handshake message" \ |
| 9699 | -c "found fragmented DTLS handshake message" \ |
| 9700 | -C "error" |
| 9701 | |
| 9702 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9703 | requires_config_enabled MBEDTLS_RSA_C |
| 9704 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9705 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9707 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9708 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9709 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9710 | crt_file=data_files/server7_int-ca.crt \ |
| 9711 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9712 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9713 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9714 | "$P_CLI dtls=1 debug_level=2 \ |
| 9715 | crt_file=data_files/server8_int-ca2.crt \ |
| 9716 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9717 | hs_timeout=2500-60000 \ |
| 9718 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9719 | 0 \ |
| 9720 | -s "found fragmented DTLS handshake message" \ |
| 9721 | -c "found fragmented DTLS handshake message" \ |
| 9722 | -C "error" |
| 9723 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9724 | # 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] | 9725 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9726 | requires_config_enabled MBEDTLS_RSA_C |
| 9727 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9728 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9729 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9730 | requires_config_enabled MBEDTLS_AES_C |
| 9731 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9732 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9734 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9735 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9736 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9737 | crt_file=data_files/server7_int-ca.crt \ |
| 9738 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9739 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9740 | mtu=512" \ |
| 9741 | "$P_CLI dtls=1 debug_level=2 \ |
| 9742 | crt_file=data_files/server8_int-ca2.crt \ |
| 9743 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9744 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9745 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9746 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9747 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9748 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9749 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9750 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9751 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9752 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9753 | # 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] | 9754 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9755 | # retransmissions, but in some cases (like both the server and client using |
| 9756 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9757 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9758 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9759 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9760 | requires_config_enabled MBEDTLS_RSA_C |
| 9761 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9762 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9763 | requires_config_enabled MBEDTLS_AES_C |
| 9764 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9765 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9767 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9768 | -p "$P_PXY mtu=508" \ |
| 9769 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9770 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9771 | key_file=data_files/server7.key \ |
| 9772 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9773 | "$P_CLI dtls=1 debug_level=2 \ |
| 9774 | crt_file=data_files/server8_int-ca2.crt \ |
| 9775 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9776 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9777 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9778 | 0 \ |
| 9779 | -s "found fragmented DTLS handshake message" \ |
| 9780 | -c "found fragmented DTLS handshake message" \ |
| 9781 | -C "error" |
| 9782 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9783 | # 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] | 9784 | only_with_valgrind |
| 9785 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9786 | requires_config_enabled MBEDTLS_RSA_C |
| 9787 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9788 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9789 | requires_config_enabled MBEDTLS_AES_C |
| 9790 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9791 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9793 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9794 | -p "$P_PXY mtu=508" \ |
| 9795 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9796 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9797 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9798 | hs_timeout=250-10000" \ |
| 9799 | "$P_CLI dtls=1 debug_level=2 \ |
| 9800 | crt_file=data_files/server8_int-ca2.crt \ |
| 9801 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9802 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9803 | hs_timeout=250-10000" \ |
| 9804 | 0 \ |
| 9805 | -s "found fragmented DTLS handshake message" \ |
| 9806 | -c "found fragmented DTLS handshake message" \ |
| 9807 | -C "error" |
| 9808 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9809 | # 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] | 9810 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9811 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9812 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9813 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9814 | requires_config_enabled MBEDTLS_RSA_C |
| 9815 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9816 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9818 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9819 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9820 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9821 | crt_file=data_files/server7_int-ca.crt \ |
| 9822 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9823 | hs_timeout=10000-60000 \ |
| 9824 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9825 | "$P_CLI dtls=1 debug_level=2 \ |
| 9826 | crt_file=data_files/server8_int-ca2.crt \ |
| 9827 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9828 | hs_timeout=10000-60000 \ |
| 9829 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9830 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9831 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9832 | -s "found fragmented DTLS handshake message" \ |
| 9833 | -c "found fragmented DTLS handshake message" \ |
| 9834 | -C "error" |
| 9835 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9836 | # 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] | 9837 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9838 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9839 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9840 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9841 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9842 | requires_config_enabled MBEDTLS_RSA_C |
| 9843 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9844 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9845 | requires_config_enabled MBEDTLS_AES_C |
| 9846 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9847 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9849 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9850 | -p "$P_PXY mtu=512" \ |
| 9851 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9852 | crt_file=data_files/server7_int-ca.crt \ |
| 9853 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9854 | hs_timeout=10000-60000 \ |
| 9855 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9856 | "$P_CLI dtls=1 debug_level=2 \ |
| 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 \ |
| 9860 | hs_timeout=10000-60000 \ |
| 9861 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9862 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9863 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9864 | -s "found fragmented DTLS handshake message" \ |
| 9865 | -c "found fragmented DTLS handshake message" \ |
| 9866 | -C "error" |
| 9867 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9868 | not_with_valgrind # spurious autoreduction due to timeout |
| 9869 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9870 | requires_config_enabled MBEDTLS_RSA_C |
| 9871 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9872 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9874 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9875 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9876 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9877 | crt_file=data_files/server7_int-ca.crt \ |
| 9878 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9879 | hs_timeout=10000-60000 \ |
| 9880 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9881 | "$P_CLI dtls=1 debug_level=2 \ |
| 9882 | crt_file=data_files/server8_int-ca2.crt \ |
| 9883 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9884 | hs_timeout=10000-60000 \ |
| 9885 | mtu=1024 nbio=2" \ |
| 9886 | 0 \ |
| 9887 | -S "autoreduction" \ |
| 9888 | -s "found fragmented DTLS handshake message" \ |
| 9889 | -c "found fragmented DTLS handshake message" \ |
| 9890 | -C "error" |
| 9891 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9892 | # 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] | 9893 | not_with_valgrind # spurious autoreduction due to timeout |
| 9894 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9895 | requires_config_enabled MBEDTLS_RSA_C |
| 9896 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9897 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9898 | requires_config_enabled MBEDTLS_AES_C |
| 9899 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9900 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9902 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9903 | -p "$P_PXY mtu=512" \ |
| 9904 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9905 | crt_file=data_files/server7_int-ca.crt \ |
| 9906 | key_file=data_files/server7.key \ |
| 9907 | hs_timeout=10000-60000 \ |
| 9908 | mtu=512 nbio=2" \ |
| 9909 | "$P_CLI dtls=1 debug_level=2 \ |
| 9910 | crt_file=data_files/server8_int-ca2.crt \ |
| 9911 | key_file=data_files/server8.key \ |
| 9912 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9913 | hs_timeout=10000-60000 \ |
| 9914 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9915 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9916 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9917 | -s "found fragmented DTLS handshake message" \ |
| 9918 | -c "found fragmented DTLS handshake message" \ |
| 9919 | -C "error" |
| 9920 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9921 | # 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] | 9922 | # This ensures things still work after session_reset(). |
| 9923 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9924 | # Since we don't support reading fragmented ClientHello yet, |
| 9925 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9926 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9927 | # An autoreduction on the client-side might happen if the server is |
| 9928 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9929 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9930 | # resumed listening, which would result in a spurious autoreduction. |
| 9931 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9932 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9933 | requires_config_enabled MBEDTLS_RSA_C |
| 9934 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9935 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9936 | requires_config_enabled MBEDTLS_AES_C |
| 9937 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9938 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9940 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9941 | -p "$P_PXY mtu=1450" \ |
| 9942 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9943 | crt_file=data_files/server7_int-ca.crt \ |
| 9944 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9945 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9946 | mtu=1450" \ |
| 9947 | "$P_CLI dtls=1 debug_level=2 \ |
| 9948 | crt_file=data_files/server8_int-ca2.crt \ |
| 9949 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9950 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9951 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 9952 | 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] | 9953 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9954 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9955 | -s "found fragmented DTLS handshake message" \ |
| 9956 | -c "found fragmented DTLS handshake message" \ |
| 9957 | -C "error" |
| 9958 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9959 | # An autoreduction on the client-side might happen if the server is |
| 9960 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9961 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9962 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9963 | requires_config_enabled MBEDTLS_RSA_C |
| 9964 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9965 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9966 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9967 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9968 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9969 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9971 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9972 | -p "$P_PXY mtu=512" \ |
| 9973 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9974 | crt_file=data_files/server7_int-ca.crt \ |
| 9975 | key_file=data_files/server7.key \ |
| 9976 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9977 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9978 | mtu=512" \ |
| 9979 | "$P_CLI dtls=1 debug_level=2 \ |
| 9980 | crt_file=data_files/server8_int-ca2.crt \ |
| 9981 | key_file=data_files/server8.key \ |
| 9982 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9983 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9984 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9985 | mtu=512" \ |
| 9986 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9987 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9988 | -s "found fragmented DTLS handshake message" \ |
| 9989 | -c "found fragmented DTLS handshake message" \ |
| 9990 | -C "error" |
| 9991 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9992 | # An autoreduction on the client-side might happen if the server is |
| 9993 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9994 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9995 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9996 | requires_config_enabled MBEDTLS_RSA_C |
| 9997 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9998 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9999 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10000 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 10001 | requires_config_enabled MBEDTLS_AES_C |
| 10002 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10003 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10005 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 10006 | -p "$P_PXY mtu=512" \ |
| 10007 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10008 | crt_file=data_files/server7_int-ca.crt \ |
| 10009 | key_file=data_files/server7.key \ |
| 10010 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10011 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10012 | mtu=512" \ |
| 10013 | "$P_CLI dtls=1 debug_level=2 \ |
| 10014 | crt_file=data_files/server8_int-ca2.crt \ |
| 10015 | key_file=data_files/server8.key \ |
| 10016 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10017 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10018 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10019 | mtu=512" \ |
| 10020 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10021 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10022 | -s "found fragmented DTLS handshake message" \ |
| 10023 | -c "found fragmented DTLS handshake message" \ |
| 10024 | -C "error" |
| 10025 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10026 | # An autoreduction on the client-side might happen if the server is |
| 10027 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10028 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10029 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10030 | requires_config_enabled MBEDTLS_RSA_C |
| 10031 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10032 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10033 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 10035 | requires_config_enabled MBEDTLS_AES_C |
| 10036 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10037 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10038 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10039 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10040 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10041 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10042 | crt_file=data_files/server7_int-ca.crt \ |
| 10043 | key_file=data_files/server7.key \ |
| 10044 | exchanges=2 renegotiation=1 \ |
| 10045 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10046 | hs_timeout=10000-60000 \ |
| 10047 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10048 | "$P_CLI dtls=1 debug_level=2 \ |
| 10049 | crt_file=data_files/server8_int-ca2.crt \ |
| 10050 | key_file=data_files/server8.key \ |
| 10051 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10052 | hs_timeout=10000-60000 \ |
| 10053 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10054 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10055 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10056 | -s "found fragmented DTLS handshake message" \ |
| 10057 | -c "found fragmented DTLS handshake message" \ |
| 10058 | -C "error" |
| 10059 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10060 | # An autoreduction on the client-side might happen if the server is |
| 10061 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10062 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10063 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10064 | requires_config_enabled MBEDTLS_RSA_C |
| 10065 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10066 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10067 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10068 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 10069 | requires_config_enabled MBEDTLS_AES_C |
| 10070 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 10071 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10072 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10074 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10075 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10076 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10077 | crt_file=data_files/server7_int-ca.crt \ |
| 10078 | key_file=data_files/server7.key \ |
| 10079 | exchanges=2 renegotiation=1 \ |
| 10080 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10081 | hs_timeout=10000-60000 \ |
| 10082 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10083 | "$P_CLI dtls=1 debug_level=2 \ |
| 10084 | crt_file=data_files/server8_int-ca2.crt \ |
| 10085 | key_file=data_files/server8.key \ |
| 10086 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10087 | hs_timeout=10000-60000 \ |
| 10088 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10089 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10090 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10091 | -s "found fragmented DTLS handshake message" \ |
| 10092 | -c "found fragmented DTLS handshake message" \ |
| 10093 | -C "error" |
| 10094 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10095 | # An autoreduction on the client-side might happen if the server is |
| 10096 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10097 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10098 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10099 | requires_config_enabled MBEDTLS_RSA_C |
| 10100 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10101 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10102 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10103 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 10104 | requires_config_enabled MBEDTLS_AES_C |
| 10105 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10106 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10108 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10109 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10110 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10111 | crt_file=data_files/server7_int-ca.crt \ |
| 10112 | key_file=data_files/server7.key \ |
| 10113 | exchanges=2 renegotiation=1 \ |
| 10114 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10115 | hs_timeout=10000-60000 \ |
| 10116 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10117 | "$P_CLI dtls=1 debug_level=2 \ |
| 10118 | crt_file=data_files/server8_int-ca2.crt \ |
| 10119 | key_file=data_files/server8.key \ |
| 10120 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10121 | hs_timeout=10000-60000 \ |
| 10122 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10123 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10124 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10125 | -s "found fragmented DTLS handshake message" \ |
| 10126 | -c "found fragmented DTLS handshake message" \ |
| 10127 | -C "error" |
| 10128 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10129 | # 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] | 10130 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10131 | requires_config_enabled MBEDTLS_RSA_C |
| 10132 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10133 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10134 | requires_config_enabled MBEDTLS_AES_C |
| 10135 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10136 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10137 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10139 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 10140 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10141 | "$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] | 10142 | crt_file=data_files/server7_int-ca.crt \ |
| 10143 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10144 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10145 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10146 | crt_file=data_files/server8_int-ca2.crt \ |
| 10147 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10148 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10149 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10150 | 0 \ |
| 10151 | -s "found fragmented DTLS handshake message" \ |
| 10152 | -c "found fragmented DTLS handshake message" \ |
| 10153 | -C "error" |
| 10154 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10155 | # 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] | 10156 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10157 | requires_config_enabled MBEDTLS_RSA_C |
| 10158 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 10159 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10160 | requires_config_enabled MBEDTLS_AES_C |
| 10161 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10162 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10163 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10165 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 10166 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 10167 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10168 | crt_file=data_files/server7_int-ca.crt \ |
| 10169 | key_file=data_files/server7.key \ |
| 10170 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10171 | "$P_CLI dtls=1 debug_level=2 \ |
| 10172 | crt_file=data_files/server8_int-ca2.crt \ |
| 10173 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10174 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10175 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10176 | 0 \ |
| 10177 | -s "found fragmented DTLS handshake message" \ |
| 10178 | -c "found fragmented DTLS handshake message" \ |
| 10179 | -C "error" |
| 10180 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10181 | # interop tests for DTLS fragmentating with reliable connection |
| 10182 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10183 | # here and below we just want to test that the we fragment in a way that |
| 10184 | # pleases other implementations, so we don't need the peer to fragment |
| 10185 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10186 | requires_config_enabled MBEDTLS_RSA_C |
| 10187 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10188 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10189 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10190 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 10191 | "$G_SRV -u" \ |
| 10192 | "$P_CLI dtls=1 debug_level=2 \ |
| 10193 | crt_file=data_files/server8_int-ca2.crt \ |
| 10194 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10195 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10196 | 0 \ |
| 10197 | -c "fragmenting handshake message" \ |
| 10198 | -C "error" |
| 10199 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10200 | # We use --insecure for the GnuTLS client because it expects |
| 10201 | # the hostname / IP it connects to to be the name used in the |
| 10202 | # certificate obtained from the server. Here, however, it |
| 10203 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 10204 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 10205 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10206 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10207 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10208 | requires_config_enabled MBEDTLS_RSA_C |
| 10209 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10210 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 10211 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10212 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10213 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10214 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10215 | crt_file=data_files/server7_int-ca.crt \ |
| 10216 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10217 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10218 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10219 | 0 \ |
| 10220 | -s "fragmenting handshake message" |
| 10221 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10222 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10223 | requires_config_enabled MBEDTLS_RSA_C |
| 10224 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10225 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10226 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 10227 | "$O_SRV -dtls1_2 -verify 10" \ |
| 10228 | "$P_CLI dtls=1 debug_level=2 \ |
| 10229 | crt_file=data_files/server8_int-ca2.crt \ |
| 10230 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10231 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10232 | 0 \ |
| 10233 | -c "fragmenting handshake message" \ |
| 10234 | -C "error" |
| 10235 | |
| 10236 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10237 | requires_config_enabled MBEDTLS_RSA_C |
| 10238 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10239 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10240 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 10241 | "$P_SRV dtls=1 debug_level=2 \ |
| 10242 | crt_file=data_files/server7_int-ca.crt \ |
| 10243 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10244 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10245 | "$O_CLI -dtls1_2" \ |
| 10246 | 0 \ |
| 10247 | -s "fragmenting handshake message" |
| 10248 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10249 | # interop tests for DTLS fragmentating with unreliable connection |
| 10250 | # |
| 10251 | # again we just want to test that the we fragment in a way that |
| 10252 | # pleases other implementations, so we don't need the peer to fragment |
| 10253 | requires_gnutls_next |
| 10254 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10255 | requires_config_enabled MBEDTLS_RSA_C |
| 10256 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10257 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10258 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10259 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 10260 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10261 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10262 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10263 | crt_file=data_files/server8_int-ca2.crt \ |
| 10264 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10265 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10266 | 0 \ |
| 10267 | -c "fragmenting handshake message" \ |
| 10268 | -C "error" |
| 10269 | |
| 10270 | requires_gnutls_next |
| 10271 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10272 | requires_config_enabled MBEDTLS_RSA_C |
| 10273 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10274 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10275 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10276 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 10277 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10278 | "$P_SRV dtls=1 debug_level=2 \ |
| 10279 | crt_file=data_files/server7_int-ca.crt \ |
| 10280 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10281 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10282 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10283 | 0 \ |
| 10284 | -s "fragmenting handshake message" |
| 10285 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 10286 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 10287 | ## 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] | 10288 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10289 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10290 | requires_config_enabled MBEDTLS_RSA_C |
| 10291 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10292 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10293 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10294 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 10295 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10296 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10297 | "$P_CLI dtls=1 debug_level=2 \ |
| 10298 | crt_file=data_files/server8_int-ca2.crt \ |
| 10299 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10300 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10301 | 0 \ |
| 10302 | -c "fragmenting handshake message" \ |
| 10303 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10304 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10305 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10306 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 10307 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10308 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10309 | requires_config_enabled MBEDTLS_RSA_C |
| 10310 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10311 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10312 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10313 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 10314 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10315 | "$P_SRV dtls=1 debug_level=2 \ |
| 10316 | crt_file=data_files/server7_int-ca.crt \ |
| 10317 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10318 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10319 | "$O_CLI -dtls1_2" \ |
| 10320 | 0 \ |
| 10321 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10322 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10323 | # Tests for DTLS-SRTP (RFC 5764) |
| 10324 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10326 | run_test "DTLS-SRTP all profiles supported" \ |
| 10327 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10328 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10329 | 0 \ |
| 10330 | -s "found use_srtp extension" \ |
| 10331 | -s "found srtp profile" \ |
| 10332 | -s "selected srtp profile" \ |
| 10333 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10334 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10335 | -c "client hello, adding use_srtp extension" \ |
| 10336 | -c "found use_srtp extension" \ |
| 10337 | -c "found srtp profile" \ |
| 10338 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10339 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10340 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10341 | -C "error" |
| 10342 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10343 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10344 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10346 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10347 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10348 | "$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] | 10349 | 0 \ |
| 10350 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10351 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10352 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10353 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10354 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10355 | -c "client hello, adding use_srtp extension" \ |
| 10356 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10357 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10358 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10359 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10360 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10361 | -C "error" |
| 10362 | |
| 10363 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10365 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10366 | "$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] | 10367 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10368 | 0 \ |
| 10369 | -s "found use_srtp extension" \ |
| 10370 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10371 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10372 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10373 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10374 | -c "client hello, adding use_srtp extension" \ |
| 10375 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10376 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10377 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10378 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10379 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10380 | -C "error" |
| 10381 | |
| 10382 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10384 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10385 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10386 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10387 | 0 \ |
| 10388 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10389 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10390 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10391 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10392 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10393 | -c "client hello, adding use_srtp extension" \ |
| 10394 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10395 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10396 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10397 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10398 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10399 | -C "error" |
| 10400 | |
| 10401 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10403 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10404 | "$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] | 10405 | "$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] | 10406 | 0 \ |
| 10407 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10408 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10409 | -S "selected srtp profile" \ |
| 10410 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10411 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10412 | -c "client hello, adding use_srtp extension" \ |
| 10413 | -C "found use_srtp extension" \ |
| 10414 | -C "found srtp profile" \ |
| 10415 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10416 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10417 | -C "error" |
| 10418 | |
| 10419 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10421 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10422 | "$P_SRV dtls=1 debug_level=3" \ |
| 10423 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10424 | 0 \ |
| 10425 | -s "found use_srtp extension" \ |
| 10426 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10427 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10428 | -c "client hello, adding use_srtp extension" \ |
| 10429 | -C "found use_srtp extension" \ |
| 10430 | -C "found srtp profile" \ |
| 10431 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10432 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10433 | -C "error" |
| 10434 | |
| 10435 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10437 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10438 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10439 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10440 | 0 \ |
| 10441 | -s "found use_srtp extension" \ |
| 10442 | -s "found srtp profile" \ |
| 10443 | -s "selected srtp profile" \ |
| 10444 | -s "server hello, adding use_srtp extension" \ |
| 10445 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10446 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10447 | -c "client hello, adding use_srtp extension" \ |
| 10448 | -c "found use_srtp extension" \ |
| 10449 | -c "found srtp profile" \ |
| 10450 | -c "selected srtp profile" \ |
| 10451 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10452 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10453 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10454 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10455 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10456 | -C "error" |
| 10457 | |
| 10458 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10460 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10461 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10462 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10463 | 0 \ |
| 10464 | -s "found use_srtp extension" \ |
| 10465 | -s "found srtp profile" \ |
| 10466 | -s "selected srtp profile" \ |
| 10467 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10468 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10469 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10470 | -S "dumping 'using mki' (8 bytes)" \ |
| 10471 | -c "client hello, adding use_srtp extension" \ |
| 10472 | -c "found use_srtp extension" \ |
| 10473 | -c "found srtp profile" \ |
| 10474 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10475 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10476 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10477 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10478 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10479 | -C "dumping 'received mki' (8 bytes)" \ |
| 10480 | -C "error" |
| 10481 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10482 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10484 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10485 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10486 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10487 | 0 \ |
| 10488 | -s "found use_srtp extension" \ |
| 10489 | -s "found srtp profile" \ |
| 10490 | -s "selected srtp profile" \ |
| 10491 | -s "server hello, adding use_srtp extension" \ |
| 10492 | -s "DTLS-SRTP key material is"\ |
| 10493 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10494 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10495 | |
| 10496 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10498 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10499 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10500 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10501 | 0 \ |
| 10502 | -s "found use_srtp extension" \ |
| 10503 | -s "found srtp profile" \ |
| 10504 | -s "selected srtp profile" \ |
| 10505 | -s "server hello, adding use_srtp extension" \ |
| 10506 | -s "DTLS-SRTP key material is"\ |
| 10507 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10508 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10509 | |
| 10510 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10512 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10513 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10514 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10515 | 0 \ |
| 10516 | -s "found use_srtp extension" \ |
| 10517 | -s "found srtp profile" \ |
| 10518 | -s "selected srtp profile" \ |
| 10519 | -s "server hello, adding use_srtp extension" \ |
| 10520 | -s "DTLS-SRTP key material is"\ |
| 10521 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10522 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10523 | |
| 10524 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10526 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10527 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10528 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10529 | 0 \ |
| 10530 | -s "found use_srtp extension" \ |
| 10531 | -s "found srtp profile" \ |
| 10532 | -s "selected srtp profile" \ |
| 10533 | -s "server hello, adding use_srtp extension" \ |
| 10534 | -s "DTLS-SRTP key material is"\ |
| 10535 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10536 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10537 | |
| 10538 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10540 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10541 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10542 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10543 | 0 \ |
| 10544 | -s "found use_srtp extension" \ |
| 10545 | -s "found srtp profile" \ |
| 10546 | -s "selected srtp profile" \ |
| 10547 | -s "server hello, adding use_srtp extension" \ |
| 10548 | -s "DTLS-SRTP key material is"\ |
| 10549 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10550 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10551 | |
| 10552 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10554 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10555 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10556 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10557 | 0 \ |
| 10558 | -s "found use_srtp extension" \ |
| 10559 | -s "found srtp profile" \ |
| 10560 | -S "selected srtp profile" \ |
| 10561 | -S "server hello, adding use_srtp extension" \ |
| 10562 | -S "DTLS-SRTP key material is"\ |
| 10563 | -C "SRTP Extension negotiated, profile" |
| 10564 | |
| 10565 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10567 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10568 | "$P_SRV dtls=1 debug_level=3" \ |
| 10569 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10570 | 0 \ |
| 10571 | -s "found use_srtp extension" \ |
| 10572 | -S "server hello, adding use_srtp extension" \ |
| 10573 | -S "DTLS-SRTP key material is"\ |
| 10574 | -C "SRTP Extension negotiated, profile" |
| 10575 | |
| 10576 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10578 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10579 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10580 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10581 | 0 \ |
| 10582 | -c "client hello, adding use_srtp extension" \ |
| 10583 | -c "found use_srtp extension" \ |
| 10584 | -c "found srtp profile" \ |
| 10585 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10586 | -c "DTLS-SRTP key material is"\ |
| 10587 | -C "error" |
| 10588 | |
| 10589 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10591 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10592 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10593 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10594 | 0 \ |
| 10595 | -c "client hello, adding use_srtp extension" \ |
| 10596 | -c "found use_srtp extension" \ |
| 10597 | -c "found srtp profile" \ |
| 10598 | -c "selected srtp profile" \ |
| 10599 | -c "DTLS-SRTP key material is"\ |
| 10600 | -C "error" |
| 10601 | |
| 10602 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10604 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10605 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10606 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10607 | 0 \ |
| 10608 | -c "client hello, adding use_srtp extension" \ |
| 10609 | -c "found use_srtp extension" \ |
| 10610 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10611 | -c "selected srtp profile" \ |
| 10612 | -c "DTLS-SRTP key material is"\ |
| 10613 | -C "error" |
| 10614 | |
| 10615 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10617 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 10618 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10619 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10620 | 0 \ |
| 10621 | -c "client hello, adding use_srtp extension" \ |
| 10622 | -c "found use_srtp extension" \ |
| 10623 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10624 | -c "selected srtp profile" \ |
| 10625 | -c "DTLS-SRTP key material is"\ |
| 10626 | -C "error" |
| 10627 | |
| 10628 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10630 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10631 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10632 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10633 | 0 \ |
| 10634 | -c "client hello, adding use_srtp extension" \ |
| 10635 | -c "found use_srtp extension" \ |
| 10636 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10637 | -c "selected srtp profile" \ |
| 10638 | -c "DTLS-SRTP key material is"\ |
| 10639 | -C "error" |
| 10640 | |
| 10641 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10643 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10644 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10645 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10646 | 0 \ |
| 10647 | -c "client hello, adding use_srtp extension" \ |
| 10648 | -C "found use_srtp extension" \ |
| 10649 | -C "found srtp profile" \ |
| 10650 | -C "selected srtp profile" \ |
| 10651 | -C "DTLS-SRTP key material is"\ |
| 10652 | -C "error" |
| 10653 | |
| 10654 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10656 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10657 | "$O_SRV -dtls" \ |
| 10658 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10659 | 0 \ |
| 10660 | -c "client hello, adding use_srtp extension" \ |
| 10661 | -C "found use_srtp extension" \ |
| 10662 | -C "found srtp profile" \ |
| 10663 | -C "selected srtp profile" \ |
| 10664 | -C "DTLS-SRTP key material is"\ |
| 10665 | -C "error" |
| 10666 | |
| 10667 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10669 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10670 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10671 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10672 | 0 \ |
| 10673 | -c "client hello, adding use_srtp extension" \ |
| 10674 | -c "found use_srtp extension" \ |
| 10675 | -c "found srtp profile" \ |
| 10676 | -c "selected srtp profile" \ |
| 10677 | -c "DTLS-SRTP key material is"\ |
| 10678 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10679 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10680 | -C "dumping 'received mki' (8 bytes)" \ |
| 10681 | -C "error" |
| 10682 | |
| 10683 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10684 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10686 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10687 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10688 | "$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] | 10689 | 0 \ |
| 10690 | -s "found use_srtp extension" \ |
| 10691 | -s "found srtp profile" \ |
| 10692 | -s "selected srtp profile" \ |
| 10693 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10694 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10695 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10696 | |
| 10697 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10698 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10700 | 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] | 10701 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10702 | "$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] | 10703 | 0 \ |
| 10704 | -s "found use_srtp extension" \ |
| 10705 | -s "found srtp profile" \ |
| 10706 | -s "selected srtp profile" \ |
| 10707 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10708 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10709 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10710 | |
| 10711 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10712 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10714 | 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] | 10715 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10716 | "$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] | 10717 | 0 \ |
| 10718 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10719 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10720 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10721 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10722 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10723 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10724 | |
| 10725 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10726 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10728 | 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] | 10729 | "$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] | 10730 | "$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] | 10731 | 0 \ |
| 10732 | -s "found use_srtp extension" \ |
| 10733 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10734 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10735 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10736 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10737 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10738 | |
| 10739 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10740 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10742 | 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] | 10743 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10744 | "$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] | 10745 | 0 \ |
| 10746 | -s "found use_srtp extension" \ |
| 10747 | -s "found srtp profile" \ |
| 10748 | -s "selected srtp profile" \ |
| 10749 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10750 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10751 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10752 | |
| 10753 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10754 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10756 | 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] | 10757 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10758 | "$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] | 10759 | 0 \ |
| 10760 | -s "found use_srtp extension" \ |
| 10761 | -s "found srtp profile" \ |
| 10762 | -S "selected srtp profile" \ |
| 10763 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10764 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10765 | -C "SRTP profile:" |
| 10766 | |
| 10767 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10768 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10770 | 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] | 10771 | "$P_SRV dtls=1 debug_level=3" \ |
| 10772 | "$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] | 10773 | 0 \ |
| 10774 | -s "found use_srtp extension" \ |
| 10775 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10776 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10777 | -C "SRTP profile:" |
| 10778 | |
| 10779 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10780 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10782 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10783 | "$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" \ |
| 10784 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10785 | 0 \ |
| 10786 | -c "client hello, adding use_srtp extension" \ |
| 10787 | -c "found use_srtp extension" \ |
| 10788 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10789 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10790 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10791 | -C "error" |
| 10792 | |
| 10793 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10794 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10796 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10797 | "$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" \ |
| 10798 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10799 | 0 \ |
| 10800 | -c "client hello, adding use_srtp extension" \ |
| 10801 | -c "found use_srtp extension" \ |
| 10802 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10803 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10804 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10805 | -C "error" |
| 10806 | |
| 10807 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10808 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10810 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10811 | "$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" \ |
| 10812 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10813 | 0 \ |
| 10814 | -c "client hello, adding use_srtp extension" \ |
| 10815 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10816 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10817 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10818 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10819 | -C "error" |
| 10820 | |
| 10821 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10822 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10824 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10825 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10826 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10827 | 0 \ |
| 10828 | -c "client hello, adding use_srtp extension" \ |
| 10829 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10830 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10831 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10832 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10833 | -C "error" |
| 10834 | |
| 10835 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10836 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10838 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10839 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10840 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10841 | 0 \ |
| 10842 | -c "client hello, adding use_srtp extension" \ |
| 10843 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10844 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10845 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10846 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10847 | -C "error" |
| 10848 | |
| 10849 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10850 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10852 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10853 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10854 | "$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] | 10855 | 0 \ |
| 10856 | -c "client hello, adding use_srtp extension" \ |
| 10857 | -C "found use_srtp extension" \ |
| 10858 | -C "found srtp profile" \ |
| 10859 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10860 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10861 | -C "error" |
| 10862 | |
| 10863 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10864 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10866 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10867 | "$G_SRV -u" \ |
| 10868 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10869 | 0 \ |
| 10870 | -c "client hello, adding use_srtp extension" \ |
| 10871 | -C "found use_srtp extension" \ |
| 10872 | -C "found srtp profile" \ |
| 10873 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10874 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10875 | -C "error" |
| 10876 | |
| 10877 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10878 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10880 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10881 | "$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" \ |
| 10882 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10883 | 0 \ |
| 10884 | -c "client hello, adding use_srtp extension" \ |
| 10885 | -c "found use_srtp extension" \ |
| 10886 | -c "found srtp profile" \ |
| 10887 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10888 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10889 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10890 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10891 | -c "dumping 'received mki' (8 bytes)" \ |
| 10892 | -C "error" |
| 10893 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10894 | # Tests for specific things with "unreliable" UDP connection |
| 10895 | |
| 10896 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10898 | run_test "DTLS proxy: reference" \ |
| 10899 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10900 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10901 | "$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] | 10902 | 0 \ |
| 10903 | -C "replayed record" \ |
| 10904 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10905 | -C "Buffer record from epoch" \ |
| 10906 | -S "Buffer record from epoch" \ |
| 10907 | -C "ssl_buffer_message" \ |
| 10908 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10909 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10910 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10911 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10912 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10913 | -c "HTTP/1.0 200 OK" |
| 10914 | |
| 10915 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10916 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10917 | run_test "DTLS proxy: duplicate every packet" \ |
| 10918 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10919 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10920 | "$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] | 10921 | 0 \ |
| 10922 | -c "replayed record" \ |
| 10923 | -s "replayed record" \ |
| 10924 | -c "record from another epoch" \ |
| 10925 | -s "record from another epoch" \ |
| 10926 | -S "resend" \ |
| 10927 | -s "Extra-header:" \ |
| 10928 | -c "HTTP/1.0 200 OK" |
| 10929 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10931 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10932 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10933 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10934 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10935 | 0 \ |
| 10936 | -c "replayed record" \ |
| 10937 | -S "replayed record" \ |
| 10938 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10939 | -s "record from another epoch" \ |
| 10940 | -c "resend" \ |
| 10941 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10942 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10943 | -c "HTTP/1.0 200 OK" |
| 10944 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10946 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10947 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10948 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10949 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10950 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10951 | -c "next record in same datagram" \ |
| 10952 | -s "next record in same datagram" |
| 10953 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10955 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10956 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10957 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10958 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10959 | 0 \ |
| 10960 | -c "next record in same datagram" \ |
| 10961 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10962 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10964 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10965 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10966 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10967 | "$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] | 10968 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10969 | -c "discarding invalid record (mac)" \ |
| 10970 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10971 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10972 | -c "HTTP/1.0 200 OK" \ |
| 10973 | -S "too many records with bad MAC" \ |
| 10974 | -S "Verification of the message MAC failed" |
| 10975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10977 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10978 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10979 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10980 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10981 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10982 | -C "discarding invalid record (mac)" \ |
| 10983 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10984 | -S "Extra-header:" \ |
| 10985 | -C "HTTP/1.0 200 OK" \ |
| 10986 | -s "too many records with bad MAC" \ |
| 10987 | -s "Verification of the message MAC failed" |
| 10988 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10990 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10991 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10992 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10993 | "$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] | 10994 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10995 | -c "discarding invalid record (mac)" \ |
| 10996 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10997 | -s "Extra-header:" \ |
| 10998 | -c "HTTP/1.0 200 OK" \ |
| 10999 | -S "too many records with bad MAC" \ |
| 11000 | -S "Verification of the message MAC failed" |
| 11001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11003 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 11004 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11005 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 11006 | "$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] | 11007 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11008 | -c "discarding invalid record (mac)" \ |
| 11009 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11010 | -s "Extra-header:" \ |
| 11011 | -c "HTTP/1.0 200 OK" \ |
| 11012 | -s "too many records with bad MAC" \ |
| 11013 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11014 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11016 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 11017 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 11018 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 11019 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11020 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11021 | -c "record from another epoch" \ |
| 11022 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11023 | -s "Extra-header:" \ |
| 11024 | -c "HTTP/1.0 200 OK" |
| 11025 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11026 | # Tests for reordering support with DTLS |
| 11027 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11028 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11030 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 11031 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11032 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11033 | hs_timeout=2500-60000" \ |
| 11034 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11035 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11036 | 0 \ |
| 11037 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11038 | -c "Next handshake message has been buffered - load"\ |
| 11039 | -S "Buffering HS message" \ |
| 11040 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11041 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11042 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11043 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11044 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11045 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11046 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11048 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 11049 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11050 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11051 | hs_timeout=2500-60000" \ |
| 11052 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11053 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11054 | 0 \ |
| 11055 | -c "Buffering HS message" \ |
| 11056 | -c "found fragmented DTLS handshake message"\ |
| 11057 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 11058 | -c "Next handshake message has been buffered - load"\ |
| 11059 | -S "Buffering HS message" \ |
| 11060 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11061 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11062 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11063 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11064 | -S "Remember CCS message" |
| 11065 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11066 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 11067 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 11068 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 11069 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11070 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11071 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11073 | 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] | 11074 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11075 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11076 | hs_timeout=2500-60000" \ |
| 11077 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11078 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11079 | 0 \ |
| 11080 | -c "Buffering HS message" \ |
| 11081 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11082 | -C "attempt to make space by freeing buffered messages" \ |
| 11083 | -S "Buffering HS message" \ |
| 11084 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11085 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11086 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11087 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11088 | -S "Remember CCS message" |
| 11089 | |
| 11090 | # The size constraints ensure that the delayed certificate message can't |
| 11091 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 11092 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11093 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11094 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 11095 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11097 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 11098 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11099 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11100 | hs_timeout=2500-60000" \ |
| 11101 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11102 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11103 | 0 \ |
| 11104 | -c "Buffering HS message" \ |
| 11105 | -c "attempt to make space by freeing buffered future messages" \ |
| 11106 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11107 | -S "Buffering HS message" \ |
| 11108 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11109 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11110 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11111 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11112 | -S "Remember CCS message" |
| 11113 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11114 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11116 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 11117 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11118 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 11119 | hs_timeout=2500-60000" \ |
| 11120 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11121 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11122 | 0 \ |
| 11123 | -C "Buffering HS message" \ |
| 11124 | -C "Next handshake message has been buffered - load"\ |
| 11125 | -s "Buffering HS message" \ |
| 11126 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11127 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11128 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11129 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11130 | -S "Remember CCS message" |
| 11131 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11132 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11134 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 11135 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11136 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11137 | hs_timeout=2500-60000" \ |
| 11138 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11139 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11140 | 0 \ |
| 11141 | -C "Buffering HS message" \ |
| 11142 | -C "Next handshake message has been buffered - load"\ |
| 11143 | -S "Buffering HS message" \ |
| 11144 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11145 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11146 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11147 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11148 | -S "Remember CCS message" |
| 11149 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11150 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11152 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 11153 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11154 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11155 | hs_timeout=2500-60000" \ |
| 11156 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11157 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11158 | 0 \ |
| 11159 | -C "Buffering HS message" \ |
| 11160 | -C "Next handshake message has been buffered - load"\ |
| 11161 | -S "Buffering HS message" \ |
| 11162 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11163 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11164 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11165 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11166 | -s "Remember CCS message" |
| 11167 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11169 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11170 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11171 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11172 | hs_timeout=2500-60000" \ |
| 11173 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11174 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 11175 | 0 \ |
| 11176 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11177 | -s "Found buffered record from current epoch - load" \ |
| 11178 | -c "Buffer record from epoch 1" \ |
| 11179 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11180 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11181 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 11182 | # from the server are delayed, so that the encrypted Finished message |
| 11183 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 11184 | # in afterwards, the encrypted Finished message must be freed in order |
| 11185 | # to make space for the NewSessionTicket to be reassembled. |
| 11186 | # This works only in very particular circumstances: |
| 11187 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 11188 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 11189 | # the encrypted Finished message. |
| 11190 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 11191 | # needs to be fragmented. |
| 11192 | # - All messages sent by the server must be small enough to be either sent |
| 11193 | # without fragmentation or be reassembled within the bounds of |
| 11194 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 11195 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 11196 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 11197 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11199 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 11200 | -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] | 11201 | "$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] | 11202 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 11203 | 0 \ |
| 11204 | -s "Buffer record from epoch 1" \ |
| 11205 | -s "Found buffered record from current epoch - load" \ |
| 11206 | -c "Buffer record from epoch 1" \ |
| 11207 | -C "Found buffered record from current epoch - load" \ |
| 11208 | -c "Enough space available after freeing future epoch record" |
| 11209 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 11210 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 11211 | |
| 11212 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11214 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 11215 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11216 | "$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] | 11217 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11218 | "$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] | 11219 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11220 | 0 \ |
| 11221 | -s "Extra-header:" \ |
| 11222 | -c "HTTP/1.0 200 OK" |
| 11223 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11224 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11226 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 11227 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11228 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11229 | "$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] | 11230 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 11231 | 0 \ |
| 11232 | -s "Extra-header:" \ |
| 11233 | -c "HTTP/1.0 200 OK" |
| 11234 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11235 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11237 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 11238 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11239 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11240 | "$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] | 11241 | 0 \ |
| 11242 | -s "Extra-header:" \ |
| 11243 | -c "HTTP/1.0 200 OK" |
| 11244 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11245 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11247 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 11248 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11249 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 11250 | "$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] | 11251 | 0 \ |
| 11252 | -s "Extra-header:" \ |
| 11253 | -c "HTTP/1.0 200 OK" |
| 11254 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11255 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11257 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 11258 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11259 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 11260 | "$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] | 11261 | 0 \ |
| 11262 | -s "Extra-header:" \ |
| 11263 | -c "HTTP/1.0 200 OK" |
| 11264 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11265 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11267 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 11268 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11269 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 11270 | "$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] | 11271 | 0 \ |
| 11272 | -s "Extra-header:" \ |
| 11273 | -c "HTTP/1.0 200 OK" |
| 11274 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11275 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11277 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 11278 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11279 | "$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] | 11280 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11281 | "$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] | 11282 | 0 \ |
| 11283 | -s "Extra-header:" \ |
| 11284 | -c "HTTP/1.0 200 OK" |
| 11285 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11286 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11288 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11289 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 11290 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11291 | "$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] | 11292 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11293 | "$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] | 11294 | 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] | 11295 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11296 | 0 \ |
| 11297 | -s "a session has been resumed" \ |
| 11298 | -c "a session has been resumed" \ |
| 11299 | -s "Extra-header:" \ |
| 11300 | -c "HTTP/1.0 200 OK" |
| 11301 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11302 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11304 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11305 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 11306 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11307 | "$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] | 11308 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11309 | "$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] | 11310 | 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] | 11311 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 11312 | 0 \ |
| 11313 | -s "a session has been resumed" \ |
| 11314 | -c "a session has been resumed" \ |
| 11315 | -s "Extra-header:" \ |
| 11316 | -c "HTTP/1.0 200 OK" |
| 11317 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11318 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11319 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11321 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11322 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11323 | "$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] | 11324 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11325 | "$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] | 11326 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11327 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11328 | 0 \ |
| 11329 | -c "=> renegotiate" \ |
| 11330 | -s "=> renegotiate" \ |
| 11331 | -s "Extra-header:" \ |
| 11332 | -c "HTTP/1.0 200 OK" |
| 11333 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11334 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11335 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11337 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11338 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11339 | "$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] | 11340 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11341 | "$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] | 11342 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11343 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11344 | 0 \ |
| 11345 | -c "=> renegotiate" \ |
| 11346 | -s "=> renegotiate" \ |
| 11347 | -s "Extra-header:" \ |
| 11348 | -c "HTTP/1.0 200 OK" |
| 11349 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11350 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11351 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11353 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11354 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11355 | "$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] | 11356 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11357 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11358 | "$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] | 11359 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11360 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11361 | 0 \ |
| 11362 | -c "=> renegotiate" \ |
| 11363 | -s "=> renegotiate" \ |
| 11364 | -s "Extra-header:" \ |
| 11365 | -c "HTTP/1.0 200 OK" |
| 11366 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11367 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11368 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11370 | 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] | 11371 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11372 | "$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] | 11373 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11374 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11375 | "$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] | 11376 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11377 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11378 | 0 \ |
| 11379 | -c "=> renegotiate" \ |
| 11380 | -s "=> renegotiate" \ |
| 11381 | -s "Extra-header:" \ |
| 11382 | -c "HTTP/1.0 200 OK" |
| 11383 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11384 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11385 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11386 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11387 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11388 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11389 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11391 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11392 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11393 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11394 | "$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] | 11395 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11396 | -c "HTTP/1.0 200 OK" |
| 11397 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11398 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11399 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11400 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11402 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11403 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11404 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11405 | "$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] | 11406 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11407 | -c "HTTP/1.0 200 OK" |
| 11408 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11409 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11410 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11411 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11413 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11414 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11415 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11416 | "$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] | 11417 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11418 | -c "HTTP/1.0 200 OK" |
| 11419 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11420 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11421 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11422 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11424 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11425 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11426 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11427 | "$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] | 11428 | 0 \ |
| 11429 | -s "Extra-header:" \ |
| 11430 | -c "Extra-header:" |
| 11431 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11432 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11433 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11434 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11436 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11437 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11438 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11439 | "$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] | 11440 | 0 \ |
| 11441 | -s "Extra-header:" \ |
| 11442 | -c "Extra-header:" |
| 11443 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11444 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11445 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11446 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11448 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11449 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11450 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11451 | "$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] | 11452 | 0 \ |
| 11453 | -s "Extra-header:" \ |
| 11454 | -c "Extra-header:" |
| 11455 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11457 | run_test "export keys functionality" \ |
| 11458 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 11459 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 11460 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11461 | -c "EAP-TLS key material is:"\ |
| 11462 | -s "EAP-TLS key material is:"\ |
| 11463 | -c "EAP-TLS IV is:" \ |
| 11464 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11465 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11466 | # openssl feature tests: check if tls1.3 exists. |
| 11467 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11468 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11469 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11470 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11471 | 0 \ |
| 11472 | -c "TLS 1.3" \ |
| 11473 | -s "TLS 1.3" |
| 11474 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11475 | # 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] | 11476 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11477 | requires_gnutls_next_no_ticket |
| 11478 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11479 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11480 | "$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] | 11481 | "$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] | 11482 | 0 \ |
| 11483 | -s "Version: TLS1.3" \ |
| 11484 | -c "Version: TLS1.3" |
| 11485 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11486 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11487 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11488 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11489 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11490 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11491 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11492 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11493 | "$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] | 11494 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11495 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11496 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11497 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11498 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11499 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11500 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11501 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11502 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11503 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11504 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11505 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11506 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11507 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11508 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11509 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11510 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11511 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11512 | -c "=> parse certificate verify" \ |
| 11513 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11514 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11515 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11516 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11517 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11518 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11519 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11520 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11521 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11522 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11523 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11524 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11525 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11526 | "$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] | 11527 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11528 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11529 | -s "SERVER HELLO was queued" \ |
| 11530 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11531 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11532 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11533 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11534 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11535 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11536 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11537 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11538 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11539 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11540 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11541 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11542 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11543 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11544 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11545 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11546 | -c "=> parse certificate verify" \ |
| 11547 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11548 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11549 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11550 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11551 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11552 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11553 | requires_openssl_tls1_3 |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11554 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11555 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11556 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11557 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11558 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11559 | run_test "TLS 1.3: alpn - openssl" \ |
| 11560 | "$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] | 11561 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11562 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11563 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11564 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11565 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11566 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11567 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11568 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11569 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11570 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11571 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11572 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11573 | -c "<= ssl_tls13_process_server_hello" \ |
| 11574 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11575 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11576 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11577 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11578 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11579 | -c "=> parse certificate verify" \ |
| 11580 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11581 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11582 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11583 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11584 | -c "HTTP/1.0 200 ok" \ |
| 11585 | -c "Application Layer Protocol is h2" |
| 11586 | |
| 11587 | requires_gnutls_tls1_3 |
| 11588 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11589 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11590 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11591 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11592 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11593 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11594 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11595 | "$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] | 11596 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11597 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11598 | -s "SERVER HELLO was queued" \ |
| 11599 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11600 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11601 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11602 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11603 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11604 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11605 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11606 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11607 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11608 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11609 | -c "<= ssl_tls13_process_server_hello" \ |
| 11610 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11611 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11612 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11613 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11614 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11615 | -c "=> parse certificate verify" \ |
| 11616 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11617 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11618 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11619 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11620 | -c "HTTP/1.0 200 OK" \ |
| 11621 | -c "Application Layer Protocol is h2" |
| 11622 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11623 | requires_openssl_tls1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11624 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11625 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11626 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11627 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11628 | run_test "TLS 1.3: server alpn - openssl" \ |
| 11629 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11630 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11631 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11632 | -s "found alpn extension" \ |
| 11633 | -s "server side, adding alpn extension" \ |
| 11634 | -s "Protocol is TLSv1.3" \ |
| 11635 | -s "HTTP/1.0 200 OK" \ |
| 11636 | -s "Application Layer Protocol is h2" |
| 11637 | |
| 11638 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11639 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11640 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11641 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11642 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11643 | run_test "TLS 1.3: server alpn - gnutls" \ |
| 11644 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11645 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11646 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11647 | -s "found alpn extension" \ |
| 11648 | -s "server side, adding alpn extension" \ |
| 11649 | -s "Protocol is TLSv1.3" \ |
| 11650 | -s "HTTP/1.0 200 OK" \ |
| 11651 | -s "Application Layer Protocol is h2" |
| 11652 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11654 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11655 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11656 | skip_handshake_stage_check |
| 11657 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11658 | run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11659 | "$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] | 11660 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11661 | 1 \ |
| 11662 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11663 | -S "Version: TLS1.0" \ |
| 11664 | -C "Protocol is TLSv1.0" |
| 11665 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11667 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11668 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11669 | skip_handshake_stage_check |
| 11670 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11671 | run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11672 | "$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] | 11673 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11674 | 1 \ |
| 11675 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11676 | -S "Version: TLS1.1" \ |
| 11677 | -C "Protocol is TLSv1.1" |
| 11678 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11680 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11681 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11682 | skip_handshake_stage_check |
| 11683 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11684 | 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] | 11685 | "$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] | 11686 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11687 | 1 \ |
| 11688 | -s "Client's version: 3.3" \ |
| 11689 | -c "is a fatal alert message (msg 40)" \ |
| 11690 | -S "Version: TLS1.2" \ |
| 11691 | -C "Protocol is TLSv1.2" |
| 11692 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11694 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11695 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11696 | skip_handshake_stage_check |
| 11697 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11698 | 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] | 11699 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11700 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11701 | 1 \ |
| 11702 | -s "fatal protocol_version" \ |
| 11703 | -c "is a fatal alert message (msg 70)" \ |
| 11704 | -S "Version: TLS1.0" \ |
| 11705 | -C "Protocol : TLSv1.0" |
| 11706 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11708 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11709 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11710 | skip_handshake_stage_check |
| 11711 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11712 | 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] | 11713 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11714 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11715 | 1 \ |
| 11716 | -s "fatal protocol_version" \ |
| 11717 | -c "is a fatal alert message (msg 70)" \ |
| 11718 | -S "Version: TLS1.1" \ |
| 11719 | -C "Protocol : TLSv1.1" |
| 11720 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11722 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11723 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11724 | skip_handshake_stage_check |
| 11725 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11726 | 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] | 11727 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11728 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11729 | 1 \ |
| 11730 | -s "fatal protocol_version" \ |
| 11731 | -c "is a fatal alert message (msg 70)" \ |
| 11732 | -S "Version: TLS1.2" \ |
| 11733 | -C "Protocol : TLSv1.2" |
| 11734 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11735 | requires_openssl_tls1_3 |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11736 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11737 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11738 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11739 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11740 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11741 | "$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] | 11742 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11743 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11744 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11745 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11746 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11747 | -c "HTTP/1.0 200 ok" \ |
| 11748 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11749 | |
| 11750 | requires_gnutls_tls1_3 |
| 11751 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11752 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11753 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11754 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11755 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11756 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11757 | "$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] | 11758 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11759 | 0 \ |
| 11760 | -c "got a certificate request" \ |
| 11761 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11762 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11763 | -c "HTTP/1.0 200 OK" \ |
| 11764 | -c "Protocol is TLSv1.3" |
| 11765 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11766 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11767 | requires_openssl_tls1_3 |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11768 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11769 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11770 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11771 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11772 | "$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] | 11773 | "$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] | 11774 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11775 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11776 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11777 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11778 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11779 | |
| 11780 | requires_gnutls_tls1_3 |
| 11781 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11782 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11783 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11784 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11785 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11786 | "$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] | 11787 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11788 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11789 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11790 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11791 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11792 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11793 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11794 | |
| 11795 | requires_openssl_tls1_3 |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11796 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11797 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11798 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11799 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11800 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11801 | "$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] | 11802 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11803 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11804 | 0 \ |
| 11805 | -c "got a certificate request" \ |
| 11806 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11807 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11808 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11809 | |
| 11810 | requires_gnutls_tls1_3 |
| 11811 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11812 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11813 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11814 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11815 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11816 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11817 | "$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] | 11818 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11819 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11820 | 0 \ |
| 11821 | -c "got a certificate request" \ |
| 11822 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11823 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11824 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11825 | |
| 11826 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11827 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11828 | requires_config_enabled MBEDTLS_SSL_CLI_C |
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 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11831 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11832 | "$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] | 11833 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11834 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11835 | 0 \ |
| 11836 | -c "got a certificate request" \ |
| 11837 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11838 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11839 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11840 | |
| 11841 | requires_gnutls_tls1_3 |
| 11842 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11843 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11844 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11845 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11846 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11847 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11848 | "$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] | 11849 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11850 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11851 | 0 \ |
| 11852 | -c "got a certificate request" \ |
| 11853 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11854 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11855 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11856 | |
| 11857 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11858 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11859 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11860 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11861 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11862 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11863 | "$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] | 11864 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11865 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11866 | 0 \ |
| 11867 | -c "got a certificate request" \ |
| 11868 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11869 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11870 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11871 | |
| 11872 | requires_gnutls_tls1_3 |
| 11873 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11874 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11875 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11876 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11877 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11878 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11879 | "$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] | 11880 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11881 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11882 | 0 \ |
| 11883 | -c "got a certificate request" \ |
| 11884 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11885 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11886 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11887 | |
| 11888 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11889 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11890 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11891 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11892 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11893 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11894 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11895 | "$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] | 11896 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11897 | 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] | 11898 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11899 | -c "got a certificate request" \ |
| 11900 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11901 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11902 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11903 | |
| 11904 | requires_gnutls_tls1_3 |
| 11905 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11906 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11907 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11908 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11909 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11910 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11911 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11912 | "$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] | 11913 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11914 | 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] | 11915 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11916 | -c "got a certificate request" \ |
| 11917 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11918 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11919 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11920 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11921 | requires_openssl_tls1_3 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11922 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11923 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11924 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11925 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11926 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11927 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11928 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11929 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11930 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11931 | 0 \ |
| 11932 | -c "got a certificate request" \ |
| 11933 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11934 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11935 | -c "Protocol is TLSv1.3" |
| 11936 | |
| 11937 | requires_gnutls_tls1_3 |
| 11938 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11939 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11940 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11941 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11942 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11943 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11944 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11945 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11946 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11947 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11948 | 0 \ |
| 11949 | -c "got a certificate request" \ |
| 11950 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11951 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11952 | -c "Protocol is TLSv1.3" |
| 11953 | |
| 11954 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11955 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11956 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11957 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11958 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11959 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11960 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11961 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11962 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11963 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11964 | 0 \ |
| 11965 | -c "got a certificate request" \ |
| 11966 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11967 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11968 | -c "Protocol is TLSv1.3" |
| 11969 | |
| 11970 | requires_gnutls_tls1_3 |
| 11971 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11972 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11973 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11974 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11975 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11976 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11977 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11978 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11979 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11980 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11981 | 0 \ |
| 11982 | -c "got a certificate request" \ |
| 11983 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11984 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11985 | -c "Protocol is TLSv1.3" |
| 11986 | |
| 11987 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11988 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11989 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11990 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11991 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11992 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11993 | 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] | 11994 | "$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] | 11995 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11996 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11997 | 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] | 11998 | 1 \ |
| 11999 | -c "got a certificate request" \ |
| 12000 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12001 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12002 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 12003 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12004 | |
| 12005 | requires_gnutls_tls1_3 |
| 12006 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12007 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12008 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12009 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12010 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12011 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12012 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 12013 | "$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] | 12014 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 12015 | 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] | 12016 | 1 \ |
| 12017 | -c "got a certificate request" \ |
| 12018 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12019 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12020 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 12021 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12022 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12023 | # Test using an opaque private key for client authentication |
| 12024 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12025 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12026 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12027 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12028 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12029 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 12030 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 12031 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 12032 | 0 \ |
| 12033 | -c "got a certificate request" \ |
| 12034 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12035 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12036 | -c "Protocol is TLSv1.3" |
| 12037 | |
| 12038 | requires_gnutls_tls1_3 |
| 12039 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12040 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12041 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12042 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12043 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12044 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 12045 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 12046 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 12047 | key_file=data_files/cli2.key key_opaque=1" \ |
| 12048 | 0 \ |
| 12049 | -c "got a certificate request" \ |
| 12050 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12051 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12052 | -c "Protocol is TLSv1.3" |
| 12053 | |
| 12054 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12055 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12056 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12057 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12058 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12059 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12060 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 12061 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12062 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 12063 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 12064 | 0 \ |
| 12065 | -c "got a certificate request" \ |
| 12066 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12067 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12068 | -c "Protocol is TLSv1.3" |
| 12069 | |
| 12070 | requires_gnutls_tls1_3 |
| 12071 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12072 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12073 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12074 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12075 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12076 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12077 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 12078 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12079 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 12080 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 12081 | 0 \ |
| 12082 | -c "got a certificate request" \ |
| 12083 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12084 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12085 | -c "Protocol is TLSv1.3" |
| 12086 | |
| 12087 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12088 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12089 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12090 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12091 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12092 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12093 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 12094 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12095 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 12096 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 12097 | 0 \ |
| 12098 | -c "got a certificate request" \ |
| 12099 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12100 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12101 | -c "Protocol is TLSv1.3" |
| 12102 | |
| 12103 | requires_gnutls_tls1_3 |
| 12104 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12105 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12106 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12107 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12108 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12109 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12110 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 12111 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12112 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 12113 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 12114 | 0 \ |
| 12115 | -c "got a certificate request" \ |
| 12116 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12117 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12118 | -c "Protocol is TLSv1.3" |
| 12119 | |
| 12120 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12121 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12122 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12123 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12124 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12125 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12126 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 12127 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12128 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12129 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 12130 | 0 \ |
| 12131 | -c "got a certificate request" \ |
| 12132 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12133 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12134 | -c "Protocol is TLSv1.3" |
| 12135 | |
| 12136 | requires_gnutls_tls1_3 |
| 12137 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12138 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12139 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12140 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12141 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12142 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12143 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 12144 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12145 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12146 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 12147 | 0 \ |
| 12148 | -c "got a certificate request" \ |
| 12149 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12150 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12151 | -c "Protocol is TLSv1.3" |
| 12152 | |
| 12153 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12154 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12155 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12156 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12157 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12158 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12159 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12160 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 12161 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12162 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 12163 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 12164 | 0 \ |
| 12165 | -c "got a certificate request" \ |
| 12166 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12167 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12168 | -c "Protocol is TLSv1.3" |
| 12169 | |
| 12170 | requires_gnutls_tls1_3 |
| 12171 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12172 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12173 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12174 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12175 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12176 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12177 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12178 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 12179 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12180 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 12181 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 12182 | 0 \ |
| 12183 | -c "got a certificate request" \ |
| 12184 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12185 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12186 | -c "Protocol is TLSv1.3" |
| 12187 | |
| 12188 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12189 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12190 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12191 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12192 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12193 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12194 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12195 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 12196 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12197 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 12198 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12199 | 0 \ |
| 12200 | -c "got a certificate request" \ |
| 12201 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12202 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12203 | -c "Protocol is TLSv1.3" |
| 12204 | |
| 12205 | requires_gnutls_tls1_3 |
| 12206 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12207 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12208 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12209 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12210 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12211 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12212 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12213 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 12214 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12215 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 12216 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12217 | 0 \ |
| 12218 | -c "got a certificate request" \ |
| 12219 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12220 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12221 | -c "Protocol is TLSv1.3" |
| 12222 | |
| 12223 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12224 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12225 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12226 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12227 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12228 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12229 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12230 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 12231 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12232 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 12233 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12234 | 0 \ |
| 12235 | -c "got a certificate request" \ |
| 12236 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12237 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12238 | -c "Protocol is TLSv1.3" |
| 12239 | |
| 12240 | requires_gnutls_tls1_3 |
| 12241 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12242 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12243 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12244 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12245 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12246 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12247 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12248 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 12249 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12250 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 12251 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12252 | 0 \ |
| 12253 | -c "got a certificate request" \ |
| 12254 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12255 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12256 | -c "Protocol is TLSv1.3" |
| 12257 | |
| 12258 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12259 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12260 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12261 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12262 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12263 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12264 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12265 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12266 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12267 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 12268 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12269 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12270 | 1 \ |
| 12271 | -c "got a certificate request" \ |
| 12272 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12273 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12274 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12275 | -C "unkown pk type" |
| 12276 | |
| 12277 | requires_gnutls_tls1_3 |
| 12278 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12279 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12280 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12281 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12282 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12283 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12284 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12285 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 12286 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 12287 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12288 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12289 | 1 \ |
| 12290 | -c "got a certificate request" \ |
| 12291 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12292 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12293 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12294 | -C "unkown pk type" |
| 12295 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12296 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12297 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12298 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12299 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12300 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12301 | 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] | 12302 | "$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] | 12303 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12304 | 0 \ |
| 12305 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12306 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12307 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12308 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12309 | -c "HTTP/1.0 200 ok" |
| 12310 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12311 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12312 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12313 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12314 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12315 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12316 | 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] | 12317 | "$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] | 12318 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12319 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12320 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12321 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12322 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12323 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12324 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12325 | |
| 12326 | requires_gnutls_tls1_3 |
| 12327 | requires_gnutls_next_no_ticket |
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 | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12330 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12331 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12332 | 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] | 12333 | "$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] | 12334 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12335 | 0 \ |
| 12336 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12337 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12338 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12339 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12340 | -c "HTTP/1.0 200 OK" |
| 12341 | |
| 12342 | requires_gnutls_tls1_3 |
| 12343 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12344 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12345 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12346 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12347 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12348 | 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] | 12349 | "$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] | 12350 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12351 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12352 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12353 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12354 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12355 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12356 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12357 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12358 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12359 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12360 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12361 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12362 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12363 | "$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] | 12364 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12365 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12366 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12367 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12368 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12369 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12370 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12371 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12372 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12373 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12374 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12375 | requires_openssl_tls1_3 |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12376 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12377 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12378 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12379 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12380 | "$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] | 12381 | "$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] | 12382 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12383 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12384 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12385 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12386 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12387 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12388 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12389 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12390 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12391 | -s "=> parse client hello" \ |
| 12392 | -s "<= parse client hello" |
| 12393 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12394 | requires_gnutls_tls1_3 |
| 12395 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12396 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12397 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12398 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12399 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12400 | "$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] | 12401 | "$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] | 12402 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12403 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12404 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12405 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12406 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12407 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12408 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12409 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12410 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12411 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12412 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12413 | requires_gnutls_tls1_3 |
| 12414 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12415 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12416 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12417 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12418 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12419 | "$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" \ |
| 12420 | "$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] | 12421 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12422 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12423 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12424 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12425 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12426 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12427 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12428 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12429 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12430 | -s "=> parse client hello" \ |
| 12431 | -s "<= parse client hello" |
| 12432 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12433 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12434 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12435 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12436 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12437 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 12438 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12439 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12440 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12441 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12442 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12443 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12444 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12445 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12446 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12447 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12448 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12449 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12450 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12451 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12452 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12453 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12454 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12455 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12456 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12457 | "$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" \ |
| 12458 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12459 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12460 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12461 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12462 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12463 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12464 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12465 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12466 | -s "=> parse client hello" \ |
| 12467 | -s "<= parse client hello" |
| 12468 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12469 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12470 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12471 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12472 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12473 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 12474 | "$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" \ |
| 12475 | "$P_CLI debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12476 | 1 \ |
| 12477 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12478 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12479 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12480 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12481 | -s "=> write certificate request" \ |
| 12482 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12483 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12484 | -s "=> parse client hello" \ |
| 12485 | -s "<= parse client hello" |
| 12486 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12487 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12488 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12489 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12490 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12491 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 12492 | "$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" \ |
| 12493 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none key_file=none" \ |
| 12494 | 0 \ |
| 12495 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12496 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12497 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12498 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12499 | -s "=> write certificate request" \ |
| 12500 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12501 | -s "=> parse client hello" \ |
| 12502 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12503 | |
| 12504 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12505 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12506 | requires_config_enabled MBEDTLS_SSL_SRV_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 |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12508 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 12509 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 12510 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12511 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12512 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12513 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12514 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12515 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12516 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12517 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12518 | -s "=> write hello retry request" \ |
| 12519 | -s "<= write hello retry request" |
| 12520 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12521 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12522 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12523 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12524 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12525 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 12526 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12527 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 12528 | 1 \ |
| 12529 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12530 | -s "No certificate available." |
| 12531 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12532 | requires_openssl_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12533 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12534 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12535 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12536 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12537 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12538 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12539 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12540 | "$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" \ |
| 12541 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12542 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12543 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12544 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12545 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12546 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12547 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12548 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12549 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12550 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12551 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12552 | 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] | 12553 | "$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" \ |
| 12554 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12555 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12556 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12557 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12558 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12559 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12560 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12561 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12562 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12563 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12564 | "$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 \ |
| 12565 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12566 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 12567 | force_version=tls13" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12568 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12569 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12570 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12571 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12572 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12573 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12574 | TEST_SUITE_NAME=${i##*/} |
| 12575 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12576 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12577 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12578 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12579 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12580 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12581 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12582 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12583 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12584 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12585 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12586 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
| 12587 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12588 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12589 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12590 | -s "Protocol is TLSv1.3" \ |
| 12591 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12592 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12593 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12594 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12595 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12596 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12597 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12598 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12599 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12600 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
| 12601 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12602 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12603 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12604 | -s "Protocol is TLSv1.3" \ |
| 12605 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12606 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12607 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12608 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12609 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12610 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12611 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12612 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12613 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12614 | run_test "TLS 1.3 m->O both peers do not support middlebox compatibility" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12615 | "$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] | 12616 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12617 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12618 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12619 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12620 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12621 | |
| 12622 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12623 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12624 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12625 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12626 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12627 | 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] | 12628 | "$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] | 12629 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12630 | 1 \ |
| 12631 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12632 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12633 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12634 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12635 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12636 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12637 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12638 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12639 | "$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] | 12640 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12641 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12642 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12643 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12644 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12645 | requires_gnutls_tls1_3 |
| 12646 | requires_gnutls_next_no_ticket |
| 12647 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12648 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12649 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12650 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12651 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12652 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12653 | "$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] | 12654 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12655 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12656 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12657 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12658 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12659 | |
| 12660 | requires_gnutls_tls1_3 |
| 12661 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12662 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12663 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12664 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12665 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12666 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12667 | "$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] | 12668 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12669 | 1 \ |
| 12670 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12671 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12672 | requires_gnutls_tls1_3 |
| 12673 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12674 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12675 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12676 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12677 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12678 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12679 | "$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] | 12680 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12681 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12682 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12683 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12684 | |
| 12685 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12686 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12687 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12688 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12689 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12690 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
| 12691 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12692 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12693 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12694 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12695 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12696 | -C "14 03 03 00 01" |
| 12697 | |
| 12698 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12699 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12700 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12701 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12702 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12703 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
| 12704 | "$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] | 12705 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12706 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12707 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12708 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12709 | |
| 12710 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12711 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12712 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12713 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12714 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12715 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
| 12716 | "$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] | 12717 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12718 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12719 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12720 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12721 | -c "14 03 03 00 01" |
| 12722 | |
| 12723 | requires_gnutls_tls1_3 |
| 12724 | requires_gnutls_next_no_ticket |
| 12725 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12726 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12727 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12728 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12729 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12730 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
| 12731 | "$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] | 12732 | "$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] | 12733 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12734 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12735 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12736 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12737 | |
| 12738 | requires_gnutls_tls1_3 |
| 12739 | requires_gnutls_next_no_ticket |
| 12740 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12741 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12742 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12743 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12744 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12745 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
| 12746 | "$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] | 12747 | "$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] | 12748 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12749 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12750 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12751 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12752 | -c "discarding change cipher spec in TLS1.3" |
| 12753 | |
| 12754 | requires_gnutls_tls1_3 |
| 12755 | requires_gnutls_next_no_ticket |
| 12756 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12757 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12758 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12759 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12760 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12761 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
| 12762 | "$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] | 12763 | "$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] | 12764 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12765 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12766 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12767 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12768 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12769 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12770 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12771 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12772 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12773 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12774 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
| 12775 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12776 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12777 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12778 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12779 | -c "Protocol is TLSv1.3" \ |
| 12780 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12781 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12782 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12783 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12784 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12785 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12786 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12787 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12788 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12789 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
| 12790 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12791 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12792 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12793 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12794 | -c "Protocol is TLSv1.3" \ |
| 12795 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12796 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12797 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12798 | |
| 12799 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12800 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12801 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12802 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12803 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12804 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12805 | "$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] | 12806 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12807 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12808 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12809 | -c "received HelloRetryRequest message" \ |
| 12810 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12811 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12812 | |
| 12813 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12814 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12815 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12816 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12817 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12818 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12819 | "$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] | 12820 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12821 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12822 | -c "received HelloRetryRequest message" \ |
| 12823 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12824 | |
| 12825 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12826 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12827 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12828 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12829 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12830 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12831 | "$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] | 12832 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12833 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12834 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12835 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12836 | |
| 12837 | requires_gnutls_tls1_3 |
| 12838 | requires_gnutls_next_no_ticket |
| 12839 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12840 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12841 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12842 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12843 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12844 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12845 | "$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] | 12846 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12847 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12848 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12849 | -c "received HelloRetryRequest message" \ |
| 12850 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12851 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12852 | |
| 12853 | requires_gnutls_tls1_3 |
| 12854 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12855 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12856 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12857 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12858 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12859 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12860 | "$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] | 12861 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12862 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12863 | -c "received HelloRetryRequest message" \ |
| 12864 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12865 | |
| 12866 | requires_gnutls_tls1_3 |
| 12867 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12868 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12869 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12870 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12871 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12872 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12873 | "$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] | 12874 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12875 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12876 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12877 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12878 | |
| 12879 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12880 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12881 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12882 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12883 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12884 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
| 12885 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12886 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12887 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12888 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12889 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12890 | -C "14 03 03 00 01" |
| 12891 | |
| 12892 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12893 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12894 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12895 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12896 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12897 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
| 12898 | "$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] | 12899 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12900 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12901 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12902 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12903 | |
| 12904 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12905 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12906 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12907 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12908 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12909 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
| 12910 | "$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] | 12911 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12912 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12913 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12914 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12915 | -c "14 03 03 00 01" |
| 12916 | |
| 12917 | requires_gnutls_tls1_3 |
| 12918 | requires_gnutls_next_no_ticket |
| 12919 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12920 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12921 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12922 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12923 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12924 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
| 12925 | "$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] | 12926 | "$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] | 12927 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12928 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12929 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12930 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12931 | |
| 12932 | requires_gnutls_tls1_3 |
| 12933 | requires_gnutls_next_no_ticket |
| 12934 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12935 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12936 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12937 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12938 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12939 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
| 12940 | "$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] | 12941 | "$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] | 12942 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12943 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12944 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12945 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12946 | -c "discarding change cipher spec in TLS1.3" |
| 12947 | |
| 12948 | requires_gnutls_tls1_3 |
| 12949 | requires_gnutls_next_no_ticket |
| 12950 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12951 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12952 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12953 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12954 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12955 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
| 12956 | "$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] | 12957 | "$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] | 12958 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12959 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12960 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12961 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12962 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12963 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12964 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12965 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12966 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12967 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12968 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12969 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12970 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12971 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12972 | "$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] | 12973 | 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] | 12974 | 0 \ |
| 12975 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12976 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12977 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12978 | |
| 12979 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12980 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12981 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12982 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12983 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12984 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12985 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12986 | -d 4 |
| 12987 | --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 " \ |
| 12988 | "$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] | 12989 | 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] | 12990 | 0 \ |
| 12991 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12992 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12993 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12994 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12995 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12996 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12997 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12998 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12999 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13000 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
| 13001 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13002 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13003 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13004 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13005 | "$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] | 13006 | 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] | 13007 | 0 \ |
| 13008 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13009 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 13010 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13011 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 13012 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13013 | |
| 13014 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13015 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13016 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13017 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13018 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13019 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
| 13020 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13021 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13022 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13023 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13024 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13025 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 13026 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 13027 | 0 \ |
| 13028 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13029 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13030 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13031 | |
| 13032 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13033 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13034 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13035 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13036 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13037 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
| 13038 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13039 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13040 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13041 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13042 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13043 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 13044 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 13045 | 0 \ |
| 13046 | -c "Negotiated version: 3.4" \ |
| 13047 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13048 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13049 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13050 | |
| 13051 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13052 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13053 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13054 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13055 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13056 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
| 13057 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13058 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13059 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13060 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 13061 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13062 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 13063 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 13064 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13065 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13066 | |
| 13067 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13068 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13069 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13070 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13071 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13072 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
| 13073 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13074 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13075 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13076 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 13077 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13078 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 13079 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 13080 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13081 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13082 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13083 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13084 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13085 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13086 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13087 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13088 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
| 13089 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13090 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13091 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13092 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 13093 | "$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] | 13094 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13095 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13096 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13097 | |
| 13098 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13099 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13100 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13101 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13102 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13103 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
| 13104 | "$P_SRV debug_level=4 force_version=tls13 |
| 13105 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13106 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13107 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 13108 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 13109 | 1 \ |
| 13110 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13111 | |
| 13112 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13113 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13114 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13115 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13116 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13117 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
| 13118 | "$P_SRV debug_level=4 force_version=tls13 |
| 13119 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13120 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13121 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 13122 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 13123 | 1 \ |
| 13124 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13125 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13126 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13127 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13128 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13129 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13130 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13131 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
| 13132 | "$P_SRV debug_level=4 force_version=tls13 |
| 13133 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13134 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13135 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13136 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13137 | 1 \ |
| 13138 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13139 | |
| 13140 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13141 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13142 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13143 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13144 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13145 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 13146 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13147 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13148 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 13149 | "$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] | 13150 | 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] | 13151 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13152 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13153 | |
| 13154 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13155 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13156 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13157 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13158 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13159 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 13160 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13161 | -d 4 |
| 13162 | --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 " \ |
| 13163 | "$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] | 13164 | 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] | 13165 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13166 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13167 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13168 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13169 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13170 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13171 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13172 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13173 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
| 13174 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 13175 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13176 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13177 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 13178 | "$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] | 13179 | 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] | 13180 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13181 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13182 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13183 | requires_openssl_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13184 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13185 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13186 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13187 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13188 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13189 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13190 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 13191 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13192 | 0 \ |
| 13193 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13194 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13195 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13196 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13197 | -c "HTTP/1.0 200 ok" |
| 13198 | |
| 13199 | requires_gnutls_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13200 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13201 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13202 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13203 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13204 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13205 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Ronald Cron | a709a0f | 2022-09-27 16:46:11 +0200 | [diff] [blame] | 13206 | "$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] | 13207 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13208 | 0 \ |
| 13209 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13210 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13211 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13212 | -c "Reconnecting with saved session" \ |
| 13213 | -c "HTTP/1.0 200 OK" \ |
| 13214 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13215 | |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13216 | requires_openssl_tls1_3 |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13217 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13218 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13219 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13220 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13221 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13222 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13223 | # https://github.com/openssl/openssl/issues/10714 |
| 13224 | # Until now, OpenSSL client does not support reconnect. |
| 13225 | skip_next_test |
| 13226 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
| 13227 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 13228 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 13229 | 0 \ |
| 13230 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13231 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13232 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13233 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13234 | requires_gnutls_tls1_3 |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13235 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13236 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13237 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13238 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13239 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13240 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13241 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13242 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 13243 | "$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] | 13244 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13245 | -c "Connecting again- trying to resume previous session" \ |
| 13246 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13247 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13248 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13249 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13250 | -s "key exchange mode: ephemeral" \ |
| 13251 | -s "key exchange mode: psk_ephemeral" \ |
| 13252 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13253 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13254 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13255 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13256 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13257 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13258 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13259 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13260 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13261 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13262 | "$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] | 13263 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13264 | 0 \ |
| 13265 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13266 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13267 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13268 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13269 | -c "HTTP/1.0 200 OK" \ |
| 13270 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13271 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13272 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13273 | -s "key exchange mode: ephemeral" \ |
| 13274 | -s "key exchange mode: psk_ephemeral" \ |
| 13275 | -s "found pre_shared_key extension" |
| 13276 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13277 | requires_openssl_tls1_3 |
| 13278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13279 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13280 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13281 | 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] | 13282 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13283 | -msg -tls1_2 |
| 13284 | -Verify 10 " \ |
| 13285 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13286 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13287 | min_version=tls12 max_version=tls13 " \ |
| 13288 | 0 \ |
| 13289 | -c "Protocol is TLSv1.2" \ |
| 13290 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13291 | |
| 13292 | |
| 13293 | requires_gnutls_tls1_3 |
| 13294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13295 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13296 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13297 | 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] | 13298 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13299 | -d 4 |
| 13300 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 13301 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13302 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13303 | min_version=tls12 max_version=tls13 " \ |
| 13304 | 0 \ |
| 13305 | -c "Protocol is TLSv1.2" \ |
| 13306 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13307 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13308 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13309 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13310 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13311 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13312 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13313 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13314 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13315 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13316 | "$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] | 13317 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 13318 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 13319 | 0 \ |
| 13320 | -c "Protocol is TLSv1.3" \ |
| 13321 | -c "got new session ticket." \ |
| 13322 | -c "Saving session for reuse... ok" \ |
| 13323 | -c "Reconnecting with saved session" \ |
| 13324 | -c "HTTP/1.0 200 OK" \ |
| 13325 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13326 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13327 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13328 | -s "key exchange mode: ephemeral" \ |
| 13329 | -s "key exchange mode: psk_ephemeral" \ |
| 13330 | -s "found pre_shared_key extension" |
| 13331 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13332 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13333 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13334 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13335 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13336 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13337 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13338 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13339 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13340 | "$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] | 13341 | 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] | 13342 | "$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] | 13343 | 1 \ |
| 13344 | -c "Protocol is TLSv1.3" \ |
| 13345 | -c "got new session ticket." \ |
| 13346 | -c "Saving session for reuse... ok" \ |
| 13347 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13348 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13349 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13350 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13351 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13352 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13353 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13355 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13356 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13357 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13358 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13359 | run_tests_memory_after_hanshake |
| 13360 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13361 | # Final report |
| 13362 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13363 | echo "------------------------------------------------------------------------" |
| 13364 | |
| 13365 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13366 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13367 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13368 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13369 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 13370 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 13371 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13372 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 13373 | if [ $FAILS -gt 255 ]; then |
| 13374 | # Clamp at 255 as caller gets exit code & 0xFF |
| 13375 | # (so 256 would be 0, or success, etc) |
| 13376 | FAILS=255 |
| 13377 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13378 | exit $FAILS |