| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 |  | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # | 
| Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors | 
| Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 | 
|  | 7 | # | 
|  | 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 9 | # not use this file except in compliance with the License. | 
|  | 10 | # You may obtain a copy of the License at | 
|  | 11 | # | 
|  | 12 | # http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 13 | # | 
|  | 14 | # Unless required by applicable law or agreed to in writing, software | 
|  | 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 17 | # See the License for the specific language governing permissions and | 
|  | 18 | # limitations under the License. | 
|  | 19 | # | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose | 
|  | 21 | # | 
|  | 22 | # Executes tests to prove various TLS/SSL options and extensions. | 
|  | 23 | # | 
|  | 24 | # The goal is not to cover every ciphersuite/version, but instead to cover | 
|  | 25 | # specific options (max fragment length, truncated hmac, etc) or procedures | 
|  | 26 | # (session resumption from cache or ticket, renego, etc). | 
|  | 27 | # | 
|  | 28 | # The tests assume a build with default options, with exceptions expressed | 
|  | 29 | # with a dependency.  The tests focus on functionality and do not consider | 
|  | 30 | # performance. | 
|  | 31 | # | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u | 
|  | 34 |  | 
| Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script | 
|  | 36 | # where it may output seemingly unlimited length error logs. | 
|  | 37 | ulimit -f 20971520 | 
|  | 38 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD | 
|  | 40 | if ! cd "$(dirname "$0")"; then | 
|  | 41 | exit 125 | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi | 
|  | 43 |  | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} | 
|  | 46 | : ${P_CLI:=../programs/ssl/ssl_client2} | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} | 
| Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} | 
| Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 49 | : ${OPENSSL:=openssl} | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} | 
|  | 51 | : ${GNUTLS_SERV:=gnutls-serv} | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 |  | 
| Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 54 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. | 
|  | 55 | # To help the migration, error out if the old variable is set, | 
|  | 56 | # but only if it has a different value than the new one. | 
|  | 57 | if [ "${OPENSSL_CMD+set}" = set ]; then | 
|  | 58 | # the variable is set, we can now check its value | 
|  | 59 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then | 
|  | 60 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 | 
|  | 61 | exit 125 | 
|  | 62 | fi | 
|  | 63 | fi | 
|  | 64 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 65 | guess_config_name() { | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 66 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 67 | echo "default" | 
|  | 68 | else | 
|  | 69 | echo "unknown" | 
|  | 70 | fi | 
|  | 71 | } | 
|  | 72 | : ${MBEDTLS_TEST_OUTCOME_FILE=} | 
|  | 73 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} | 
|  | 74 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} | 
|  | 75 |  | 
| Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 76 | O_SRV="$OPENSSL s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
|  | 77 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 78 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 79 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 80 | TCP_CLIENT="$PERL scripts/tcp_client.pl" | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 81 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 82 | # alternative versions of OpenSSL and GnuTLS (no default path) | 
|  | 83 |  | 
|  | 84 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 85 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
|  | 86 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" | 
|  | 87 | else | 
|  | 88 | O_LEGACY_SRV=false | 
|  | 89 | O_LEGACY_CLI=false | 
|  | 90 | fi | 
|  | 91 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 92 | if [ -n "${OPENSSL_NEXT:-}" ]; then | 
| XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 93 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
| Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 94 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert data_files/server5.crt -key data_files/server5.key" | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 95 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " | 
| Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 96 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile data_files/test-ca_cat12.crt" | 
| XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 97 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 98 | else | 
|  | 99 | O_NEXT_SRV=false | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 100 | O_NEXT_SRV_NO_CERT=false | 
| Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 101 | O_NEXT_SRV_EARLY_DATA=false | 
| XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 102 | O_NEXT_CLI_NO_CERT=false | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 103 | O_NEXT_CLI=false | 
|  | 104 | fi | 
|  | 105 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 106 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 107 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 108 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 109 | else | 
|  | 110 | G_NEXT_SRV=false | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 111 | G_NEXT_SRV_NO_CERT=false | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 112 | fi | 
|  | 113 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 114 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 115 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" | 
| XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 116 | G_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 117 | else | 
|  | 118 | G_NEXT_CLI=false | 
| XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 119 | G_NEXT_CLI_NO_CERT=false | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 120 | fi | 
|  | 121 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 122 | TESTS=0 | 
|  | 123 | FAILS=0 | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 124 | SKIPS=0 | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 125 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 126 | CONFIG_H='../include/mbedtls/mbedtls_config.h' | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 127 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 128 | MEMCHECK=0 | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 129 | FILTER='.*' | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 130 | EXCLUDE='^$' | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 |  | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 132 | SHOW_TEST_NUMBER=0 | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 133 | RUN_TEST_NUMBER='' | 
|  | 134 |  | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 135 | PRESERVE_LOGS=0 | 
|  | 136 |  | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 137 | # Pick a "unique" server port in the range 10000-19999, and a proxy | 
|  | 138 | # port which is this plus 10000. Each port number may be independently | 
|  | 139 | # overridden by a command line option. | 
|  | 140 | SRV_PORT=$(($$ % 10000 + 10000)) | 
|  | 141 | PXY_PORT=$((SRV_PORT + 10000)) | 
|  | 142 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 143 | print_usage() { | 
|  | 144 | echo "Usage: $0 [options]" | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 145 | printf "  -h|--help\tPrint this help.\n" | 
|  | 146 | printf "  -m|--memcheck\tCheck memory leaks and errors.\n" | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 147 | printf "  -f|--filter\tOnly matching tests are executed (substring or BRE)\n" | 
|  | 148 | printf "  -e|--exclude\tMatching tests are excluded (substring or BRE)\n" | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 149 | printf "  -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 150 | printf "  -s|--show-numbers\tShow test numbers in front of test names\n" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 151 | printf "  -p|--preserve-logs\tPreserve logs of successful tests as well\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 152 | printf "     --outcome-file\tFile where test outcomes are written\n" | 
|  | 153 | printf "                \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" | 
|  | 154 | printf "     --port     \tTCP/UDP port (default: randomish 1xxxx)\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 155 | printf "     --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 156 | printf "     --seed     \tInteger seed value to use for this test run\n" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 157 | } | 
|  | 158 |  | 
|  | 159 | get_options() { | 
|  | 160 | while [ $# -gt 0 ]; do | 
|  | 161 | case "$1" in | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 162 | -f|--filter) | 
|  | 163 | shift; FILTER=$1 | 
|  | 164 | ;; | 
|  | 165 | -e|--exclude) | 
|  | 166 | shift; EXCLUDE=$1 | 
|  | 167 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 168 | -m|--memcheck) | 
|  | 169 | MEMCHECK=1 | 
|  | 170 | ;; | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 171 | -n|--number) | 
|  | 172 | shift; RUN_TEST_NUMBER=$1 | 
|  | 173 | ;; | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 174 | -s|--show-numbers) | 
|  | 175 | SHOW_TEST_NUMBER=1 | 
|  | 176 | ;; | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 177 | -p|--preserve-logs) | 
|  | 178 | PRESERVE_LOGS=1 | 
|  | 179 | ;; | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 180 | --port) | 
|  | 181 | shift; SRV_PORT=$1 | 
|  | 182 | ;; | 
|  | 183 | --proxy-port) | 
|  | 184 | shift; PXY_PORT=$1 | 
|  | 185 | ;; | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 186 | --seed) | 
|  | 187 | shift; SEED="$1" | 
|  | 188 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 189 | -h|--help) | 
|  | 190 | print_usage | 
|  | 191 | exit 0 | 
|  | 192 | ;; | 
|  | 193 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 194 | echo "Unknown argument: '$1'" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 195 | print_usage | 
|  | 196 | exit 1 | 
|  | 197 | ;; | 
|  | 198 | esac | 
|  | 199 | shift | 
|  | 200 | done | 
|  | 201 | } | 
|  | 202 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 203 | # Make the outcome file path relative to the original directory, not | 
|  | 204 | # to .../tests | 
|  | 205 | case "$MBEDTLS_TEST_OUTCOME_FILE" in | 
|  | 206 | [!/]*) | 
|  | 207 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 208 | ;; | 
|  | 209 | esac | 
|  | 210 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 211 | # Read boolean configuration options from mbedtls_config.h for easy and quick | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 212 | # testing. Skip non-boolean options (with something other than spaces | 
|  | 213 | # and a comment after "#define SYMBOL"). The variable contains a | 
|  | 214 | # space-separated list of symbols. | 
| Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 215 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 216 | # Skip next test; use this macro to skip tests which are legitimate | 
|  | 217 | # in theory and expected to be re-introduced at some point, but | 
|  | 218 | # aren't expected to succeed at the moment due to problems outside | 
|  | 219 | # our control (such as bugs in other TLS implementations). | 
|  | 220 | skip_next_test() { | 
|  | 221 | SKIP_NEXT="YES" | 
|  | 222 | } | 
|  | 223 |  | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 224 | # Check if the required configuration ($1) is enabled | 
|  | 225 | is_config_enabled() | 
|  | 226 | { | 
|  | 227 | case $CONFIGS_ENABLED in | 
|  | 228 | *" $1"[\ =]*) return 0;; | 
|  | 229 | *) return 1;; | 
|  | 230 | esac | 
|  | 231 | } | 
|  | 232 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 233 | # skip next test if the flag is not enabled in mbedtls_config.h | 
| Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 234 | requires_config_enabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 235 | case $CONFIGS_ENABLED in | 
| Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 236 | *" $1"[\ =]*) :;; | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 237 | *) SKIP_NEXT="YES";; | 
|  | 238 | esac | 
| Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 239 | } | 
|  | 240 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 241 | # skip next test if the flag is enabled in mbedtls_config.h | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 242 | requires_config_disabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 243 | case $CONFIGS_ENABLED in | 
| Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 244 | *" $1"[\ =]*) SKIP_NEXT="YES";; | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 245 | esac | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 246 | } | 
|  | 247 |  | 
| Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 248 | requires_all_configs_enabled() { | 
|  | 249 | if ! $P_QUERY -all $* | 
|  | 250 | then | 
|  | 251 | SKIP_NEXT="YES" | 
|  | 252 | fi | 
|  | 253 | } | 
|  | 254 |  | 
|  | 255 | requires_all_configs_disabled() { | 
|  | 256 | if $P_QUERY -any $* | 
|  | 257 | then | 
|  | 258 | SKIP_NEXT="YES" | 
|  | 259 | fi | 
|  | 260 | } | 
|  | 261 |  | 
|  | 262 | requires_any_configs_enabled() { | 
|  | 263 | if ! $P_QUERY -any $* | 
|  | 264 | then | 
|  | 265 | SKIP_NEXT="YES" | 
|  | 266 | fi | 
|  | 267 | } | 
|  | 268 |  | 
|  | 269 | requires_any_configs_disabled() { | 
|  | 270 | if $P_QUERY -all $* | 
|  | 271 | then | 
|  | 272 | SKIP_NEXT="YES" | 
|  | 273 | fi | 
|  | 274 | } | 
|  | 275 |  | 
| Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 276 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 277 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ | 
|  | 278 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ | 
|  | 279 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ | 
|  | 280 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ | 
|  | 281 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ | 
|  | 282 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" | 
|  | 283 |  | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 284 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ | 
|  | 285 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" | 
|  | 286 |  | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 287 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ | 
|  | 288 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ | 
|  | 289 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ | 
|  | 290 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ | 
|  | 291 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" | 
|  | 292 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 293 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 294 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 295 | then | 
| Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 296 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 297 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
|  | 298 | then | 
|  | 299 | SKIP_NEXT="YES" | 
|  | 300 | fi | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 301 | } | 
|  | 302 |  | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 303 | get_config_value_or_default() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 304 | # This function uses the query_config command line option to query the | 
|  | 305 | # required Mbed TLS compile time configuration from the ssl_server2 | 
|  | 306 | # program. The command will always return a success value if the | 
|  | 307 | # configuration is defined and the value will be printed to stdout. | 
|  | 308 | # | 
|  | 309 | # Note that if the configuration is not defined or is defined to nothing, | 
|  | 310 | # the output of this function will be an empty string. | 
|  | 311 | ${P_SRV} "query_config=${1}" | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 312 | } | 
|  | 313 |  | 
|  | 314 | requires_config_value_at_least() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 315 | VAL="$( get_config_value_or_default "$1" )" | 
|  | 316 | if [ -z "$VAL" ]; then | 
|  | 317 | # Should never happen | 
|  | 318 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 319 | exit 1 | 
|  | 320 | elif [ "$VAL" -lt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 321 | SKIP_NEXT="YES" | 
|  | 322 | fi | 
|  | 323 | } | 
|  | 324 |  | 
|  | 325 | requires_config_value_at_most() { | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 326 | VAL=$( get_config_value_or_default "$1" ) | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 327 | if [ -z "$VAL" ]; then | 
|  | 328 | # Should never happen | 
|  | 329 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 330 | exit 1 | 
|  | 331 | elif [ "$VAL" -gt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 332 | SKIP_NEXT="YES" | 
|  | 333 | fi | 
|  | 334 | } | 
|  | 335 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 336 | requires_config_value_equals() { | 
|  | 337 | VAL=$( get_config_value_or_default "$1" ) | 
|  | 338 | if [ -z "$VAL" ]; then | 
|  | 339 | # Should never happen | 
|  | 340 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 341 | exit 1 | 
|  | 342 | elif [ "$VAL" -ne "$2" ]; then | 
|  | 343 | SKIP_NEXT="YES" | 
|  | 344 | fi | 
|  | 345 | } | 
|  | 346 |  | 
| Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 347 | # Require Mbed TLS to support the given protocol version. | 
|  | 348 | # | 
|  | 349 | # Inputs: | 
|  | 350 | # * $1: protocol version in mbedtls syntax (argument to force_version=) | 
|  | 351 | requires_protocol_version() { | 
|  | 352 | # Support for DTLS is detected separately in detect_dtls(). | 
|  | 353 | case "$1" in | 
|  | 354 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; | 
|  | 355 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; | 
|  | 356 | *) echo "Unknown required protocol version: $1"; exit 1;; | 
|  | 357 | esac | 
|  | 358 | } | 
|  | 359 |  | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 360 | # Space-separated list of ciphersuites supported by this build of | 
|  | 361 | # Mbed TLS. | 
|  | 362 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | | 
| XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 363 | grep 'TLS-\|TLS1-3' | | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 364 | tr -s ' \n' ' ')" | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 365 | requires_ciphersuite_enabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 366 | case $P_CIPHERSUITES in | 
|  | 367 | *" $1 "*) :;; | 
|  | 368 | *) SKIP_NEXT="YES";; | 
|  | 369 | esac | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 370 | } | 
|  | 371 |  | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 372 | # Automatically detect required features based on command line parameters. | 
|  | 373 | # Parameters are: | 
|  | 374 | # - $1 = command line (call to a TLS client or server program) | 
|  | 375 | # - $2 = client/server | 
|  | 376 | # - $3 = TLS version (TLS12 or TLS13) | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 377 | # - $4 = Use an external tool without ECDH support | 
|  | 378 | # - $5 = run test options | 
| Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 379 | detect_required_features() { | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 380 | CMD_LINE=$1 | 
|  | 381 | ROLE=$2 | 
|  | 382 | TLS_VERSION=$3 | 
|  | 383 | EXT_WO_ECDH=$4 | 
|  | 384 | TEST_OPTIONS=${5:-} | 
|  | 385 |  | 
|  | 386 | case "$CMD_LINE" in | 
| Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 387 | *\ force_version=*) | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 388 | tmp="${CMD_LINE##*\ force_version=}" | 
| Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 389 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" | 
|  | 390 | requires_protocol_version "$tmp";; | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 391 | esac | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 392 |  | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 393 | case "$CMD_LINE" in | 
| Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 394 | *\ force_ciphersuite=*) | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 395 | tmp="${CMD_LINE##*\ force_ciphersuite=}" | 
| Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 396 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" | 
|  | 397 | requires_ciphersuite_enabled "$tmp";; | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 398 | esac | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 399 |  | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 400 | case " $CMD_LINE " in | 
| Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 401 | *[-_\ =]tickets=[^0]*) | 
|  | 402 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; | 
|  | 403 | esac | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 404 | case " $CMD_LINE " in | 
| Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 405 | *[-_\ =]alpn=*) | 
|  | 406 | requires_config_enabled MBEDTLS_SSL_ALPN;; | 
|  | 407 | esac | 
|  | 408 |  | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 409 | case "$CMD_LINE" in | 
| Valerio Setti | ccfad9a | 2023-03-08 10:25:05 +0100 | [diff] [blame] | 410 | *server5*|\ | 
| Valerio Setti | 80318d2 | 2023-03-13 12:26:42 +0100 | [diff] [blame] | 411 | *server7*|\ | 
|  | 412 | *dir-maxpath*) | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 413 | if [ "$TLS_VERSION" = "TLS13" ]; then | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 414 | # In case of TLS13 the support for ECDSA is enough | 
|  | 415 | requires_pk_alg "ECDSA" | 
|  | 416 | else | 
|  | 417 | # For TLS12 requirements are different between server and client | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 418 | if [ "$ROLE" = "server" ]; then | 
| Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 419 | # If the server uses "server5*" certificates, then an ECDSA based | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 420 | # key exchange is required. However gnutls also does not | 
|  | 421 | # support ECDH, so this limit the choice to ECDHE-ECDSA | 
|  | 422 | if [ "$EXT_WO_ECDH" = "yes" ]; then | 
|  | 423 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
|  | 424 | else | 
|  | 425 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT | 
|  | 426 | fi | 
|  | 427 | elif [ "$ROLE" = "client" ]; then | 
|  | 428 | # On the client side it is enough to have any certificate | 
|  | 429 | # based authentication together with support for ECDSA. | 
|  | 430 | # Of course the GnuTLS limitation mentioned above applies | 
|  | 431 | # also here. | 
|  | 432 | if [ "$EXT_WO_ECDH" = "yes" ]; then | 
|  | 433 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH | 
|  | 434 | else | 
|  | 435 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
|  | 436 | fi | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 437 | requires_pk_alg "ECDSA" | 
|  | 438 | fi | 
|  | 439 | fi | 
|  | 440 | ;; | 
|  | 441 | esac | 
|  | 442 |  | 
| Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 443 | unset tmp | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 444 | } | 
|  | 445 |  | 
| Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 446 | requires_certificate_authentication () { | 
|  | 447 | if [ "$PSK_ONLY" = "YES" ]; then | 
|  | 448 | SKIP_NEXT="YES" | 
|  | 449 | fi | 
|  | 450 | } | 
|  | 451 |  | 
| Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 452 | adapt_cmd_for_psk () { | 
|  | 453 | case "$2" in | 
|  | 454 | *openssl*) s='-psk abc123 -nocert';; | 
|  | 455 | *gnutls-*) s='--pskkey=abc123';; | 
|  | 456 | *) s='psk=abc123';; | 
|  | 457 | esac | 
|  | 458 | eval $1='"$2 $s"' | 
|  | 459 | unset s | 
|  | 460 | } | 
|  | 461 |  | 
|  | 462 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] | 
|  | 463 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. | 
|  | 464 | # | 
|  | 465 | # If not running in a PSK-only build, do nothing. | 
|  | 466 | # If the test looks like it doesn't use a pre-shared key but can run with a | 
|  | 467 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run | 
|  | 468 | # with a pre-shared key, skip it. If the test looks like it's already using | 
|  | 469 | # a pre-shared key, do nothing. | 
|  | 470 | # | 
| Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 471 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. | 
| Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 472 | # | 
|  | 473 | # Inputs: | 
|  | 474 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. | 
|  | 475 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). | 
|  | 476 | # * "$@": options passed to run_test. | 
|  | 477 | # | 
|  | 478 | # Outputs: | 
|  | 479 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. | 
|  | 480 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. | 
|  | 481 | maybe_adapt_for_psk() { | 
|  | 482 | if [ "$PSK_ONLY" != "YES" ]; then | 
|  | 483 | return | 
|  | 484 | fi | 
|  | 485 | if [ "$SKIP_NEXT" = "YES" ]; then | 
|  | 486 | return | 
|  | 487 | fi | 
|  | 488 | case "$CLI_CMD $SRV_CMD" in | 
|  | 489 | *[-_\ =]psk*|*[-_\ =]PSK*) | 
|  | 490 | return;; | 
|  | 491 | *force_ciphersuite*) | 
|  | 492 | # The test case forces a non-PSK cipher suite. In some cases, a | 
|  | 493 | # PSK cipher suite could be substituted, but we're not ready for | 
|  | 494 | # that yet. | 
|  | 495 | SKIP_NEXT="YES" | 
|  | 496 | return;; | 
|  | 497 | *\ auth_mode=*|*[-_\ =]crt[_=]*) | 
|  | 498 | # The test case involves certificates. PSK won't do. | 
|  | 499 | SKIP_NEXT="YES" | 
|  | 500 | return;; | 
|  | 501 | esac | 
|  | 502 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" | 
|  | 503 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" | 
|  | 504 | } | 
|  | 505 |  | 
|  | 506 | case " $CONFIGS_ENABLED " in | 
|  | 507 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; | 
|  | 508 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; | 
|  | 509 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; | 
|  | 510 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; | 
|  | 511 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; | 
|  | 512 | *) PSK_ONLY="NO";; | 
|  | 513 | esac | 
|  | 514 |  | 
| Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 515 | HAS_ALG_SHA_1="NO" | 
|  | 516 | HAS_ALG_SHA_224="NO" | 
|  | 517 | HAS_ALG_SHA_256="NO" | 
|  | 518 | HAS_ALG_SHA_384="NO" | 
|  | 519 | HAS_ALG_SHA_512="NO" | 
|  | 520 |  | 
|  | 521 | check_for_hash_alg() | 
|  | 522 | { | 
|  | 523 | CURR_ALG="INVALID"; | 
|  | 524 | USE_PSA="NO" | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 525 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then | 
|  | 526 | USE_PSA="YES"; | 
|  | 527 | fi | 
| Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 528 | if [ $USE_PSA = "YES" ]; then | 
|  | 529 | CURR_ALG=PSA_WANT_ALG_${1} | 
|  | 530 | else | 
|  | 531 | CURR_ALG=MBEDTLS_${1}_C | 
|  | 532 | # Remove the second underscore to match MBEDTLS_* naming convention | 
|  | 533 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') | 
|  | 534 | fi | 
|  | 535 |  | 
|  | 536 | case $CONFIGS_ENABLED in | 
|  | 537 | *" $CURR_ALG"[\ =]*) | 
|  | 538 | return 0 | 
|  | 539 | ;; | 
|  | 540 | *) :;; | 
|  | 541 | esac | 
|  | 542 | return 1 | 
|  | 543 | } | 
|  | 544 |  | 
|  | 545 | populate_enabled_hash_algs() | 
|  | 546 | { | 
|  | 547 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do | 
|  | 548 | if check_for_hash_alg "$hash_alg"; then | 
|  | 549 | hash_alg_variable=HAS_ALG_${hash_alg} | 
|  | 550 | eval ${hash_alg_variable}=YES | 
|  | 551 | fi | 
| Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 552 | done | 
| Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 553 | } | 
|  | 554 |  | 
|  | 555 | # skip next test if the given hash alg is not supported | 
|  | 556 | requires_hash_alg() { | 
|  | 557 | HASH_DEFINE="Invalid" | 
|  | 558 | HAS_HASH_ALG="NO" | 
|  | 559 | case $1 in | 
|  | 560 | SHA_1):;; | 
|  | 561 | SHA_224):;; | 
|  | 562 | SHA_256):;; | 
|  | 563 | SHA_384):;; | 
|  | 564 | SHA_512):;; | 
|  | 565 | *) | 
|  | 566 | echo "Unsupported hash alg - $1" | 
|  | 567 | exit 1 | 
|  | 568 | ;; | 
|  | 569 | esac | 
|  | 570 |  | 
|  | 571 | HASH_DEFINE=HAS_ALG_${1} | 
|  | 572 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" | 
|  | 573 | if [ "$HAS_HASH_ALG" = "NO" ] | 
|  | 574 | then | 
|  | 575 | SKIP_NEXT="YES" | 
|  | 576 | fi | 
|  | 577 | } | 
|  | 578 |  | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 579 | # Skip next test if the given pk alg is not enabled | 
|  | 580 | requires_pk_alg() { | 
|  | 581 | case $1 in | 
|  | 582 | ECDSA) | 
|  | 583 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then | 
|  | 584 | requires_config_enabled PSA_WANT_ALG_ECDSA | 
|  | 585 | else | 
|  | 586 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 587 | fi | 
|  | 588 | ;; | 
|  | 589 | *) | 
|  | 590 | echo "Unknown/unimplemented case $1 in requires_pk_alg" | 
|  | 591 | exit 1 | 
|  | 592 | ;; | 
|  | 593 | esac | 
|  | 594 | } | 
|  | 595 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 596 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV | 
|  | 597 | requires_openssl_with_fallback_scsv() { | 
|  | 598 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then | 
| Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 599 | if $OPENSSL s_client -help 2>&1 | grep fallback_scsv >/dev/null | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 600 | then | 
|  | 601 | OPENSSL_HAS_FBSCSV="YES" | 
|  | 602 | else | 
|  | 603 | OPENSSL_HAS_FBSCSV="NO" | 
|  | 604 | fi | 
|  | 605 | fi | 
|  | 606 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then | 
|  | 607 | SKIP_NEXT="YES" | 
|  | 608 | fi | 
|  | 609 | } | 
|  | 610 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 611 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value | 
|  | 612 | requires_max_content_len() { | 
|  | 613 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 | 
|  | 614 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 | 
|  | 615 | } | 
|  | 616 |  | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 617 | # skip next test if GnuTLS isn't available | 
|  | 618 | requires_gnutls() { | 
|  | 619 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then | 
| Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 620 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 621 | GNUTLS_AVAILABLE="YES" | 
|  | 622 | else | 
|  | 623 | GNUTLS_AVAILABLE="NO" | 
|  | 624 | fi | 
|  | 625 | fi | 
|  | 626 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then | 
|  | 627 | SKIP_NEXT="YES" | 
|  | 628 | fi | 
|  | 629 | } | 
|  | 630 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 631 | # skip next test if GnuTLS-next isn't available | 
|  | 632 | requires_gnutls_next() { | 
|  | 633 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then | 
|  | 634 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then | 
|  | 635 | GNUTLS_NEXT_AVAILABLE="YES" | 
|  | 636 | else | 
|  | 637 | GNUTLS_NEXT_AVAILABLE="NO" | 
|  | 638 | fi | 
|  | 639 | fi | 
|  | 640 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 641 | SKIP_NEXT="YES" | 
|  | 642 | fi | 
|  | 643 | } | 
|  | 644 |  | 
|  | 645 | # skip next test if OpenSSL-legacy isn't available | 
|  | 646 | requires_openssl_legacy() { | 
|  | 647 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then | 
|  | 648 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then | 
|  | 649 | OPENSSL_LEGACY_AVAILABLE="YES" | 
|  | 650 | else | 
|  | 651 | OPENSSL_LEGACY_AVAILABLE="NO" | 
|  | 652 | fi | 
|  | 653 | fi | 
|  | 654 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then | 
|  | 655 | SKIP_NEXT="YES" | 
|  | 656 | fi | 
|  | 657 | } | 
|  | 658 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 659 | requires_openssl_next() { | 
|  | 660 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then | 
|  | 661 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then | 
|  | 662 | OPENSSL_NEXT_AVAILABLE="YES" | 
|  | 663 | else | 
|  | 664 | OPENSSL_NEXT_AVAILABLE="NO" | 
|  | 665 | fi | 
|  | 666 | fi | 
|  | 667 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 668 | SKIP_NEXT="YES" | 
|  | 669 | fi | 
|  | 670 | } | 
|  | 671 |  | 
|  | 672 | # skip next test if tls1_3 is not available | 
|  | 673 | requires_openssl_tls1_3() { | 
|  | 674 | requires_openssl_next | 
|  | 675 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 676 | OPENSSL_TLS1_3_AVAILABLE="NO" | 
|  | 677 | fi | 
|  | 678 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then | 
|  | 679 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null | 
|  | 680 | then | 
|  | 681 | OPENSSL_TLS1_3_AVAILABLE="YES" | 
|  | 682 | else | 
|  | 683 | OPENSSL_TLS1_3_AVAILABLE="NO" | 
|  | 684 | fi | 
|  | 685 | fi | 
|  | 686 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then | 
|  | 687 | SKIP_NEXT="YES" | 
|  | 688 | fi | 
|  | 689 | } | 
|  | 690 |  | 
|  | 691 | # skip next test if tls1_3 is not available | 
|  | 692 | requires_gnutls_tls1_3() { | 
|  | 693 | requires_gnutls_next | 
|  | 694 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 695 | GNUTLS_TLS1_3_AVAILABLE="NO" | 
|  | 696 | fi | 
|  | 697 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then | 
|  | 698 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null | 
|  | 699 | then | 
|  | 700 | GNUTLS_TLS1_3_AVAILABLE="YES" | 
|  | 701 | else | 
|  | 702 | GNUTLS_TLS1_3_AVAILABLE="NO" | 
|  | 703 | fi | 
|  | 704 | fi | 
|  | 705 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then | 
|  | 706 | SKIP_NEXT="YES" | 
|  | 707 | fi | 
|  | 708 | } | 
|  | 709 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 710 | # Check %NO_TICKETS option | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 711 | requires_gnutls_next_no_ticket() { | 
|  | 712 | requires_gnutls_next | 
|  | 713 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 714 | GNUTLS_NO_TICKETS_AVAILABLE="NO" | 
|  | 715 | fi | 
|  | 716 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then | 
|  | 717 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null | 
|  | 718 | then | 
|  | 719 | GNUTLS_NO_TICKETS_AVAILABLE="YES" | 
|  | 720 | else | 
|  | 721 | GNUTLS_NO_TICKETS_AVAILABLE="NO" | 
|  | 722 | fi | 
|  | 723 | fi | 
|  | 724 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then | 
|  | 725 | SKIP_NEXT="YES" | 
|  | 726 | fi | 
|  | 727 | } | 
|  | 728 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 729 | # Check %DISABLE_TLS13_COMPAT_MODE option | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 730 | requires_gnutls_next_disable_tls13_compat() { | 
|  | 731 | requires_gnutls_next | 
|  | 732 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 733 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" | 
|  | 734 | fi | 
|  | 735 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then | 
|  | 736 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null | 
|  | 737 | then | 
|  | 738 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" | 
|  | 739 | else | 
|  | 740 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" | 
|  | 741 | fi | 
|  | 742 | fi | 
|  | 743 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then | 
|  | 744 | SKIP_NEXT="YES" | 
|  | 745 | fi | 
|  | 746 | } | 
|  | 747 |  | 
| Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 748 | # skip next test if GnuTLS does not support the record size limit extension | 
|  | 749 | requires_gnutls_record_size_limit() { | 
|  | 750 | requires_gnutls_next | 
|  | 751 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 752 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" | 
|  | 753 | else | 
|  | 754 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" | 
|  | 755 | fi | 
|  | 756 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then | 
|  | 757 | SKIP_NEXT="YES" | 
|  | 758 | fi | 
|  | 759 | } | 
|  | 760 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 761 | # skip next test if IPv6 isn't available on this host | 
|  | 762 | requires_ipv6() { | 
|  | 763 | if [ -z "${HAS_IPV6:-}" ]; then | 
|  | 764 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & | 
|  | 765 | SRV_PID=$! | 
|  | 766 | sleep 1 | 
|  | 767 | kill $SRV_PID >/dev/null 2>&1 | 
|  | 768 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then | 
|  | 769 | HAS_IPV6="NO" | 
|  | 770 | else | 
|  | 771 | HAS_IPV6="YES" | 
|  | 772 | fi | 
|  | 773 | rm -r $SRV_OUT | 
|  | 774 | fi | 
|  | 775 |  | 
|  | 776 | if [ "$HAS_IPV6" = "NO" ]; then | 
|  | 777 | SKIP_NEXT="YES" | 
|  | 778 | fi | 
|  | 779 | } | 
|  | 780 |  | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 781 | # skip next test if it's i686 or uname is not available | 
|  | 782 | requires_not_i686() { | 
|  | 783 | if [ -z "${IS_I686:-}" ]; then | 
|  | 784 | IS_I686="YES" | 
|  | 785 | if which "uname" >/dev/null 2>&1; then | 
|  | 786 | if [ -z "$(uname -a | grep i686)" ]; then | 
|  | 787 | IS_I686="NO" | 
|  | 788 | fi | 
|  | 789 | fi | 
|  | 790 | fi | 
|  | 791 | if [ "$IS_I686" = "YES" ]; then | 
|  | 792 | SKIP_NEXT="YES" | 
|  | 793 | fi | 
|  | 794 | } | 
|  | 795 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 796 | # Calculate the input & output maximum content lengths set in the config | 
| David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 797 | MAX_CONTENT_LEN=16384 | 
| Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 798 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) | 
|  | 799 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 800 |  | 
| Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 801 | # Calculate the maximum content length that fits both | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 802 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 803 | MAX_CONTENT_LEN="$MAX_IN_LEN" | 
|  | 804 | fi | 
|  | 805 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 806 | MAX_CONTENT_LEN="$MAX_OUT_LEN" | 
|  | 807 | fi | 
|  | 808 |  | 
|  | 809 | # skip the next test if the SSL output buffer is less than 16KB | 
|  | 810 | requires_full_size_output_buffer() { | 
|  | 811 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then | 
|  | 812 | SKIP_NEXT="YES" | 
|  | 813 | fi | 
|  | 814 | } | 
|  | 815 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 816 | # skip the next test if valgrind is in use | 
|  | 817 | not_with_valgrind() { | 
|  | 818 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 819 | SKIP_NEXT="YES" | 
|  | 820 | fi | 
|  | 821 | } | 
|  | 822 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 823 | # skip the next test if valgrind is NOT in use | 
|  | 824 | only_with_valgrind() { | 
|  | 825 | if [ "$MEMCHECK" -eq 0 ]; then | 
|  | 826 | SKIP_NEXT="YES" | 
|  | 827 | fi | 
|  | 828 | } | 
|  | 829 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 830 | # multiply the client timeout delay by the given factor for the next test | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 831 | client_needs_more_time() { | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 832 | CLI_DELAY_FACTOR=$1 | 
|  | 833 | } | 
|  | 834 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 835 | # wait for the given seconds after the client finished in the next test | 
|  | 836 | server_needs_more_time() { | 
|  | 837 | SRV_DELAY_SECONDS=$1 | 
|  | 838 | } | 
|  | 839 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 840 | # print_name <name> | 
|  | 841 | print_name() { | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 842 | TESTS=$(( $TESTS + 1 )) | 
|  | 843 | LINE="" | 
|  | 844 |  | 
|  | 845 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then | 
|  | 846 | LINE="$TESTS " | 
|  | 847 | fi | 
|  | 848 |  | 
|  | 849 | LINE="$LINE$1" | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 850 | printf "%s " "$LINE" | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 851 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 852 | for i in `seq 1 $LEN`; do printf '.'; done | 
|  | 853 | printf ' ' | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 854 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 855 | } | 
|  | 856 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 857 | # record_outcome <outcome> [<failure-reason>] | 
|  | 858 | # The test name must be in $NAME. | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 859 | # Use $TEST_SUITE_NAME as the test suite name if set. | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 860 | record_outcome() { | 
|  | 861 | echo "$1" | 
|  | 862 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then | 
|  | 863 | printf '%s;%s;%s;%s;%s;%s\n' \ | 
|  | 864 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 865 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 866 | "$1" "${2-}" \ | 
|  | 867 | >>"$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 868 | fi | 
|  | 869 | } | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 870 | unset TEST_SUITE_NAME | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 871 |  | 
| Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 872 | # True if the presence of the given pattern in a log definitely indicates | 
|  | 873 | # that the test has failed. False if the presence is inconclusive. | 
|  | 874 | # | 
|  | 875 | # Inputs: | 
|  | 876 | # * $1: pattern found in the logs | 
|  | 877 | # * $TIMES_LEFT: >0 if retrying is an option | 
|  | 878 | # | 
|  | 879 | # Outputs: | 
|  | 880 | # * $outcome: set to a retry reason if the pattern is inconclusive, | 
|  | 881 | #             unchanged otherwise. | 
|  | 882 | # * Return value: 1 if the pattern is inconclusive, | 
|  | 883 | #                 0 if the failure is definitive. | 
|  | 884 | log_pattern_presence_is_conclusive() { | 
|  | 885 | # If we've run out of attempts, then don't retry no matter what. | 
|  | 886 | if [ $TIMES_LEFT -eq 0 ]; then | 
|  | 887 | return 0 | 
|  | 888 | fi | 
|  | 889 | case $1 in | 
|  | 890 | "resend") | 
|  | 891 | # An undesired resend may have been caused by the OS dropping or | 
|  | 892 | # delaying a packet at an inopportune time. | 
|  | 893 | outcome="RETRY(resend)" | 
|  | 894 | return 1;; | 
|  | 895 | esac | 
|  | 896 | } | 
|  | 897 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 898 | # fail <message> | 
|  | 899 | fail() { | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 900 | record_outcome "FAIL" "$1" | 
| Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 901 | echo "  ! $1" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 902 |  | 
| Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 903 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 904 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 905 | if [ -n "$PXY_CMD" ]; then | 
|  | 906 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 907 | fi | 
|  | 908 | echo "  ! outputs saved to o-XXX-${TESTS}.log" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 909 |  | 
| Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 910 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 911 | echo "  ! server output:" | 
|  | 912 | cat o-srv-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 913 | echo "  ! ========================================================" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 914 | echo "  ! client output:" | 
|  | 915 | cat o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 916 | if [ -n "$PXY_CMD" ]; then | 
|  | 917 | echo "  ! ========================================================" | 
|  | 918 | echo "  ! proxy output:" | 
|  | 919 | cat o-pxy-${TESTS}.log | 
|  | 920 | fi | 
|  | 921 | echo "" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 922 | fi | 
|  | 923 |  | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 924 | FAILS=$(( $FAILS + 1 )) | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 925 | } | 
|  | 926 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 927 | # is_polar <cmd_line> | 
|  | 928 | is_polar() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 929 | case "$1" in | 
|  | 930 | *ssl_client2*) true;; | 
|  | 931 | *ssl_server2*) true;; | 
|  | 932 | *) false;; | 
|  | 933 | esac | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 934 | } | 
|  | 935 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 936 | # openssl s_server doesn't have -www with DTLS | 
|  | 937 | check_osrv_dtls() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 938 | case "$SRV_CMD" in | 
|  | 939 | *s_server*-dtls*) | 
|  | 940 | NEEDS_INPUT=1 | 
|  | 941 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; | 
|  | 942 | *) NEEDS_INPUT=0;; | 
|  | 943 | esac | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 944 | } | 
|  | 945 |  | 
|  | 946 | # provide input to commands that need it | 
|  | 947 | provide_input() { | 
|  | 948 | if [ $NEEDS_INPUT -eq 0 ]; then | 
|  | 949 | return | 
|  | 950 | fi | 
|  | 951 |  | 
|  | 952 | while true; do | 
|  | 953 | echo "HTTP/1.0 200 OK" | 
|  | 954 | sleep 1 | 
|  | 955 | done | 
|  | 956 | } | 
|  | 957 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 958 | # has_mem_err <log_file_name> | 
|  | 959 | has_mem_err() { | 
|  | 960 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && | 
|  | 961 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null | 
|  | 962 | then | 
|  | 963 | return 1 # false: does not have errors | 
|  | 964 | else | 
|  | 965 | return 0 # true: has errors | 
|  | 966 | fi | 
|  | 967 | } | 
|  | 968 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 969 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 970 | if type lsof >/dev/null 2>/dev/null; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 971 | wait_app_start() { | 
| Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 972 | newline=' | 
|  | 973 | ' | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 974 | START_TIME=$(date +%s) | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 975 | if [ "$DTLS" -eq 1 ]; then | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 976 | proto=UDP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 977 | else | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 978 | proto=TCP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 979 | fi | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 980 | # Make a tight loop, server normally takes less than 1s to start. | 
| Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 981 | while true; do | 
| Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 982 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) | 
| Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 983 | # When we use a proxy, it will be listening on the same port we | 
|  | 984 | # are checking for as well as the server and lsof will list both. | 
| Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 985 | case ${newline}${SERVER_PIDS}${newline} in | 
| Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 986 | *${newline}${2}${newline}*) break;; | 
| Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 987 | esac | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 988 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 989 | echo "$3 START TIMEOUT" | 
|  | 990 | echo "$3 START TIMEOUT" >> $4 | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 991 | break | 
|  | 992 | fi | 
|  | 993 | # Linux and *BSD support decimal arguments to sleep. On other | 
|  | 994 | # OSes this may be a tight loop. | 
|  | 995 | sleep 0.1 2>/dev/null || true | 
|  | 996 | done | 
|  | 997 | } | 
|  | 998 | else | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 999 | echo "Warning: lsof not available, wait_app_start = sleep" | 
|  | 1000 | wait_app_start() { | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1001 | sleep "$START_DELAY" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1002 | } | 
|  | 1003 | fi | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1004 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1005 | # Wait for server process $2 to be listening on port $1. | 
|  | 1006 | wait_server_start() { | 
|  | 1007 | wait_app_start $1 $2 "SERVER" $SRV_OUT | 
|  | 1008 | } | 
|  | 1009 |  | 
|  | 1010 | # Wait for proxy process $2 to be listening on port $1. | 
|  | 1011 | wait_proxy_start() { | 
|  | 1012 | wait_app_start $1 $2 "PROXY" $PXY_OUT | 
|  | 1013 | } | 
|  | 1014 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1015 | # Given the client or server debug output, parse the unix timestamp that is | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1016 | # included in the first 4 bytes of the random bytes and check that it's within | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1017 | # acceptable bounds | 
|  | 1018 | check_server_hello_time() { | 
|  | 1019 | # Extract the time from the debug (lvl 3) output of the client | 
| Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 1020 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1021 | # Get the Unix timestamp for now | 
|  | 1022 | CUR_TIME=$(date +'%s') | 
|  | 1023 | THRESHOLD_IN_SECS=300 | 
|  | 1024 |  | 
|  | 1025 | # Check if the ServerHello time was printed | 
|  | 1026 | if [ -z "$SERVER_HELLO_TIME" ]; then | 
|  | 1027 | return 1 | 
|  | 1028 | fi | 
|  | 1029 |  | 
|  | 1030 | # Check the time in ServerHello is within acceptable bounds | 
|  | 1031 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then | 
|  | 1032 | # The time in ServerHello is at least 5 minutes before now | 
|  | 1033 | return 1 | 
|  | 1034 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1035 | # The time in ServerHello is at least 5 minutes later than now | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1036 | return 1 | 
|  | 1037 | else | 
|  | 1038 | return 0 | 
|  | 1039 | fi | 
|  | 1040 | } | 
|  | 1041 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1042 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument | 
|  | 1043 | handshake_memory_get() { | 
|  | 1044 | OUTPUT_VARIABLE="$1" | 
|  | 1045 | OUTPUT_FILE="$2" | 
|  | 1046 |  | 
|  | 1047 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" | 
|  | 1048 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) | 
|  | 1049 |  | 
|  | 1050 | # Check if memory usage was read | 
|  | 1051 | if [ -z "$MEM_USAGE" ]; then | 
|  | 1052 | echo "Error: Can not read the value of handshake memory usage" | 
|  | 1053 | return 1 | 
|  | 1054 | else | 
|  | 1055 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" | 
|  | 1056 | return 0 | 
|  | 1057 | fi | 
|  | 1058 | } | 
|  | 1059 |  | 
|  | 1060 | # Get handshake memory usage from server or client output and check if this value | 
|  | 1061 | # is not higher than the maximum given by the first argument | 
|  | 1062 | handshake_memory_check() { | 
|  | 1063 | MAX_MEMORY="$1" | 
|  | 1064 | OUTPUT_FILE="$2" | 
|  | 1065 |  | 
|  | 1066 | # Get memory usage | 
|  | 1067 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then | 
|  | 1068 | return 1 | 
|  | 1069 | fi | 
|  | 1070 |  | 
|  | 1071 | # Check if memory usage is below max value | 
|  | 1072 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then | 
|  | 1073 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ | 
|  | 1074 | "but should be below $MAX_MEMORY bytes" | 
|  | 1075 | return 1 | 
|  | 1076 | else | 
|  | 1077 | return 0 | 
|  | 1078 | fi | 
|  | 1079 | } | 
|  | 1080 |  | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1081 | # wait for client to terminate and set CLI_EXIT | 
|  | 1082 | # must be called right after starting the client | 
|  | 1083 | wait_client_done() { | 
|  | 1084 | CLI_PID=$! | 
|  | 1085 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1086 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) | 
|  | 1087 | CLI_DELAY_FACTOR=1 | 
|  | 1088 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1089 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1090 | DOG_PID=$! | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1091 |  | 
| Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1092 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. | 
|  | 1093 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT | 
|  | 1094 | wait $CLI_PID >> $CLI_OUT 2>&1 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1095 | CLI_EXIT=$? | 
|  | 1096 |  | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1097 | kill $DOG_PID >/dev/null 2>&1 | 
| Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1098 | wait $DOG_PID >> $CLI_OUT 2>&1 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1099 |  | 
|  | 1100 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1101 |  | 
|  | 1102 | sleep $SRV_DELAY_SECONDS | 
|  | 1103 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1104 | } | 
|  | 1105 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1106 | # check if the given command uses dtls and sets global variable DTLS | 
|  | 1107 | detect_dtls() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1108 | case "$1" in | 
| Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1109 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1110 | *) DTLS=0;; | 
|  | 1111 | esac | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1112 | } | 
|  | 1113 |  | 
| Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1114 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS | 
|  | 1115 | is_gnutls() { | 
|  | 1116 | case "$1" in | 
|  | 1117 | *gnutls-cli*) | 
|  | 1118 | CMD_IS_GNUTLS=1 | 
|  | 1119 | ;; | 
|  | 1120 | *gnutls-serv*) | 
|  | 1121 | CMD_IS_GNUTLS=1 | 
|  | 1122 | ;; | 
|  | 1123 | *) | 
|  | 1124 | CMD_IS_GNUTLS=0 | 
|  | 1125 | ;; | 
|  | 1126 | esac | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1127 | } | 
|  | 1128 |  | 
| Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1129 | # Some external tools (gnutls or openssl) might not have support for static ECDH | 
|  | 1130 | # and this limit the tests that can be run with them. This function checks server | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1131 | # and client command lines, given as input, to verify if the current test | 
|  | 1132 | # is using one of these tools. | 
|  | 1133 | use_ext_tool_without_ecdh_support() { | 
|  | 1134 | case "$1" in | 
|  | 1135 | *$GNUTLS_SERV*|\ | 
|  | 1136 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ | 
|  | 1137 | *${OPENSSL_NEXT:-"openssl-dummy"}*) | 
|  | 1138 | echo "yes" | 
|  | 1139 | return;; | 
|  | 1140 | esac | 
|  | 1141 | case "$2" in | 
|  | 1142 | *$GNUTLS_CLI*|\ | 
|  | 1143 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ | 
|  | 1144 | *${OPENSSL_NEXT:-"openssl-dummy"}*) | 
|  | 1145 | echo "yes" | 
|  | 1146 | return;; | 
|  | 1147 | esac | 
|  | 1148 | echo "no" | 
|  | 1149 | } | 
|  | 1150 |  | 
| Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1151 | # Generate random psk_list argument for ssl_server2 | 
|  | 1152 | get_srv_psk_list () | 
|  | 1153 | { | 
|  | 1154 | case $(( TESTS % 3 )) in | 
|  | 1155 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; | 
|  | 1156 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; | 
|  | 1157 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; | 
|  | 1158 | esac | 
|  | 1159 | } | 
|  | 1160 |  | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1161 | # Determine what calc_verify trace is to be expected, if any. | 
|  | 1162 | # | 
|  | 1163 | # calc_verify is only called for two things: to calculate the | 
|  | 1164 | # extended master secret, and to process client authentication. | 
|  | 1165 | # | 
|  | 1166 | # Warning: the current implementation assumes that extended_ms is not | 
|  | 1167 | #          disabled on the client or on the server. | 
|  | 1168 | # | 
|  | 1169 | # Inputs: | 
| Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1170 | # * $1: the value of the server auth_mode parameter. | 
|  | 1171 | #       'required' if client authentication is expected, | 
|  | 1172 | #       'none' or absent if not. | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1173 | # * $CONFIGS_ENABLED | 
|  | 1174 | # | 
|  | 1175 | # Outputs: | 
|  | 1176 | # * $maybe_calc_verify: set to a trace expected in the debug logs | 
|  | 1177 | set_maybe_calc_verify() { | 
|  | 1178 | maybe_calc_verify= | 
|  | 1179 | case $CONFIGS_ENABLED in | 
|  | 1180 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; | 
|  | 1181 | *) | 
|  | 1182 | case ${1-} in | 
| Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1183 | ''|none) return;; | 
|  | 1184 | required) :;; | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1185 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; | 
|  | 1186 | esac | 
|  | 1187 | esac | 
|  | 1188 | case $CONFIGS_ENABLED in | 
|  | 1189 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; | 
|  | 1190 | *) maybe_calc_verify="<= calc verify";; | 
|  | 1191 | esac | 
|  | 1192 | } | 
|  | 1193 |  | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1194 | # Compare file content | 
|  | 1195 | # Usage: find_in_both pattern file1 file2 | 
|  | 1196 | # extract from file1 the first line matching the pattern | 
|  | 1197 | # check in file2 that the same line can be found | 
|  | 1198 | find_in_both() { | 
|  | 1199 | srv_pattern=$(grep -m 1 "$1" "$2"); | 
|  | 1200 | if [ -z "$srv_pattern" ]; then | 
|  | 1201 | return 1; | 
|  | 1202 | fi | 
|  | 1203 |  | 
|  | 1204 | if grep "$srv_pattern" $3 >/dev/null; then : | 
| Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1205 | return 0; | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1206 | else | 
|  | 1207 | return 1; | 
|  | 1208 | fi | 
|  | 1209 | } | 
|  | 1210 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1211 | SKIP_HANDSHAKE_CHECK="NO" | 
|  | 1212 | skip_handshake_stage_check() { | 
|  | 1213 | SKIP_HANDSHAKE_CHECK="YES" | 
|  | 1214 | } | 
|  | 1215 |  | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1216 | # Analyze the commands that will be used in a test. | 
|  | 1217 | # | 
|  | 1218 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass | 
|  | 1219 | # extra arguments or go through wrappers. | 
| Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1220 | # | 
|  | 1221 | # Inputs: | 
|  | 1222 | # * $@: supplemental options to run_test() (after the mandatory arguments). | 
|  | 1223 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. | 
|  | 1224 | # * $DTLS: 1 if DTLS, otherwise 0. | 
|  | 1225 | # | 
|  | 1226 | # Outputs: | 
|  | 1227 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1228 | analyze_test_commands() { | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1229 | # if the test uses DTLS but no custom proxy, add a simple proxy | 
|  | 1230 | # as it provides timing info that's useful to debug failures | 
| Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 1231 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1232 | PXY_CMD="$P_PXY" | 
| Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1233 | case " $SRV_CMD " in | 
|  | 1234 | *' server_addr=::1 '*) | 
|  | 1235 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; | 
|  | 1236 | esac | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1237 | fi | 
|  | 1238 |  | 
| Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1239 | # update CMD_IS_GNUTLS variable | 
|  | 1240 | is_gnutls "$SRV_CMD" | 
|  | 1241 |  | 
|  | 1242 | # if the server uses gnutls but doesn't set priority, explicitly | 
|  | 1243 | # set the default priority | 
|  | 1244 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then | 
|  | 1245 | case "$SRV_CMD" in | 
|  | 1246 | *--priority*) :;; | 
|  | 1247 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; | 
|  | 1248 | esac | 
|  | 1249 | fi | 
|  | 1250 |  | 
|  | 1251 | # update CMD_IS_GNUTLS variable | 
|  | 1252 | is_gnutls "$CLI_CMD" | 
|  | 1253 |  | 
|  | 1254 | # if the client uses gnutls but doesn't set priority, explicitly | 
|  | 1255 | # set the default priority | 
|  | 1256 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then | 
|  | 1257 | case "$CLI_CMD" in | 
|  | 1258 | *--priority*) :;; | 
|  | 1259 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; | 
|  | 1260 | esac | 
|  | 1261 | fi | 
|  | 1262 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1263 | # fix client port | 
|  | 1264 | if [ -n "$PXY_CMD" ]; then | 
|  | 1265 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) | 
|  | 1266 | else | 
|  | 1267 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) | 
|  | 1268 | fi | 
|  | 1269 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1270 | # prepend valgrind to our commands if active | 
|  | 1271 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 1272 | if is_polar "$SRV_CMD"; then | 
|  | 1273 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" | 
|  | 1274 | fi | 
|  | 1275 | if is_polar "$CLI_CMD"; then | 
|  | 1276 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" | 
|  | 1277 | fi | 
|  | 1278 | fi | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1279 | } | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1280 |  | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1281 | # Check for failure conditions after a test case. | 
|  | 1282 | # | 
|  | 1283 | # Inputs from run_test: | 
|  | 1284 | # * positional parameters: test options (see run_test documentation) | 
|  | 1285 | # * $CLI_EXIT: client return code | 
|  | 1286 | # * $CLI_EXPECT: expected client return code | 
|  | 1287 | # * $SRV_RET: server return code | 
|  | 1288 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1289 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1290 | # | 
|  | 1291 | # Outputs: | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1292 | # * $outcome: one of PASS/RETRY*/FAIL | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1293 | check_test_failure() { | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1294 | outcome=FAIL | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1295 |  | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1296 | if [ $TIMES_LEFT -gt 0 ] && | 
|  | 1297 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null | 
|  | 1298 | then | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1299 | outcome="RETRY(client-timeout)" | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1300 | return | 
|  | 1301 | fi | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1302 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1303 | # check if the client and server went at least to the handshake stage | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1304 | # (useful to avoid tests with only negative assertions and non-zero | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1305 | # expected client exit to incorrectly succeed in case of catastrophic | 
|  | 1306 | # failure) | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1307 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] | 
|  | 1308 | then | 
|  | 1309 | if is_polar "$SRV_CMD"; then | 
|  | 1310 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; | 
|  | 1311 | else | 
|  | 1312 | fail "server or client failed to reach handshake stage" | 
|  | 1313 | return | 
|  | 1314 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1315 | fi | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1316 | if is_polar "$CLI_CMD"; then | 
|  | 1317 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; | 
|  | 1318 | else | 
|  | 1319 | fail "server or client failed to reach handshake stage" | 
|  | 1320 | return | 
|  | 1321 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1322 | fi | 
|  | 1323 | fi | 
|  | 1324 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1325 | SKIP_HANDSHAKE_CHECK="NO" | 
| Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1326 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't | 
|  | 1327 | # exit with status 0 when interrupted by a signal, and we don't really | 
|  | 1328 | # care anyway), in case e.g. the server reports a memory leak. | 
|  | 1329 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then | 
| Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1330 | fail "Server exited with status $SRV_RET" | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1331 | return | 
|  | 1332 | fi | 
|  | 1333 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1334 | # check client exit code | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1335 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ | 
|  | 1336 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1337 | then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1338 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1339 | return | 
|  | 1340 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1341 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1342 | # check other assertions | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1343 | # lines beginning with == are added by valgrind, ignore them | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1344 | # lines with 'Serious error when reading debug info', are valgrind issues as well | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1345 | while [ $# -gt 0 ] | 
|  | 1346 | do | 
|  | 1347 | case $1 in | 
|  | 1348 | "-s") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1349 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1350 | fail "pattern '$2' MUST be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1351 | return | 
|  | 1352 | fi | 
|  | 1353 | ;; | 
|  | 1354 |  | 
|  | 1355 | "-c") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1356 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1357 | fail "pattern '$2' MUST be present in the Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1358 | return | 
|  | 1359 | fi | 
|  | 1360 | ;; | 
|  | 1361 |  | 
|  | 1362 | "-S") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1363 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then | 
| Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1364 | if log_pattern_presence_is_conclusive "$2"; then | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1365 | fail "pattern '$2' MUST NOT be present in the Server output" | 
|  | 1366 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1367 | return | 
|  | 1368 | fi | 
|  | 1369 | ;; | 
|  | 1370 |  | 
|  | 1371 | "-C") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1372 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then | 
| Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1373 | if log_pattern_presence_is_conclusive "$2"; then | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1374 | fail "pattern '$2' MUST NOT be present in the Client output" | 
|  | 1375 | fi | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1376 | return | 
|  | 1377 | fi | 
|  | 1378 | ;; | 
|  | 1379 |  | 
|  | 1380 | # The filtering in the following two options (-u and -U) do the following | 
|  | 1381 | #   - ignore valgrind output | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1382 | #   - filter out everything but lines right after the pattern occurrences | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1383 | #   - keep one of each non-unique line | 
|  | 1384 | #   - count how many lines remain | 
|  | 1385 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 | 
|  | 1386 | # if there were no duplicates. | 
|  | 1387 | "-U") | 
|  | 1388 | if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then | 
|  | 1389 | fail "lines following pattern '$2' must be unique in Server output" | 
|  | 1390 | return | 
|  | 1391 | fi | 
|  | 1392 | ;; | 
|  | 1393 |  | 
|  | 1394 | "-u") | 
|  | 1395 | if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then | 
|  | 1396 | fail "lines following pattern '$2' must be unique in Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1397 | return | 
|  | 1398 | fi | 
|  | 1399 | ;; | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1400 | "-F") | 
|  | 1401 | if ! $2 "$SRV_OUT"; then | 
|  | 1402 | fail "function call to '$2' failed on Server output" | 
|  | 1403 | return | 
|  | 1404 | fi | 
|  | 1405 | ;; | 
|  | 1406 | "-f") | 
|  | 1407 | if ! $2 "$CLI_OUT"; then | 
|  | 1408 | fail "function call to '$2' failed on Client output" | 
|  | 1409 | return | 
|  | 1410 | fi | 
|  | 1411 | ;; | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1412 | "-g") | 
|  | 1413 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then | 
|  | 1414 | fail "function call to '$2' failed on Server and Client output" | 
|  | 1415 | return | 
|  | 1416 | fi | 
|  | 1417 | ;; | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1418 |  | 
|  | 1419 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1420 | echo "Unknown test: $1" >&2 | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1421 | exit 1 | 
|  | 1422 | esac | 
|  | 1423 | shift 2 | 
|  | 1424 | done | 
|  | 1425 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1426 | # check valgrind's results | 
|  | 1427 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1428 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1429 | fail "Server has memory errors" | 
|  | 1430 | return | 
|  | 1431 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1432 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1433 | fail "Client has memory errors" | 
|  | 1434 | return | 
|  | 1435 | fi | 
|  | 1436 | fi | 
|  | 1437 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1438 | # if we're here, everything is ok | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1439 | outcome=PASS | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1440 | } | 
|  | 1441 |  | 
| Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1442 | # Run the current test case: start the server and if applicable the proxy, run | 
|  | 1443 | # the client, wait for all processes to finish or time out. | 
|  | 1444 | # | 
|  | 1445 | # Inputs: | 
|  | 1446 | # * $NAME: test case name | 
|  | 1447 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run | 
|  | 1448 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs | 
|  | 1449 | # | 
|  | 1450 | # Outputs: | 
|  | 1451 | # * $CLI_EXIT: client return code | 
|  | 1452 | # * $SRV_RET: server return code | 
|  | 1453 | do_run_test_once() { | 
|  | 1454 | # run the commands | 
|  | 1455 | if [ -n "$PXY_CMD" ]; then | 
|  | 1456 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT | 
|  | 1457 | $PXY_CMD >> $PXY_OUT 2>&1 & | 
|  | 1458 | PXY_PID=$! | 
|  | 1459 | wait_proxy_start "$PXY_PORT" "$PXY_PID" | 
|  | 1460 | fi | 
|  | 1461 |  | 
|  | 1462 | check_osrv_dtls | 
|  | 1463 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT | 
|  | 1464 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & | 
|  | 1465 | SRV_PID=$! | 
|  | 1466 | wait_server_start "$SRV_PORT" "$SRV_PID" | 
|  | 1467 |  | 
|  | 1468 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT | 
| Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1469 | # The client must be a subprocess of the script in order for killing it to | 
|  | 1470 | # work properly, that's why the ampersand is placed inside the eval command, | 
|  | 1471 | # not at the end of the line: the latter approach will spawn eval as a | 
|  | 1472 | # subprocess, and the $CLI_CMD as a grandchild. | 
|  | 1473 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 | 
| Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1474 | wait_client_done | 
|  | 1475 |  | 
|  | 1476 | sleep 0.05 | 
|  | 1477 |  | 
|  | 1478 | # terminate the server (and the proxy) | 
|  | 1479 | kill $SRV_PID | 
| Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1480 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. | 
| Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1481 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT | 
| Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1482 | wait $SRV_PID >> $SRV_OUT 2>&1 | 
| Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1483 | SRV_RET=$? | 
|  | 1484 |  | 
|  | 1485 | if [ -n "$PXY_CMD" ]; then | 
|  | 1486 | kill $PXY_PID >/dev/null 2>&1 | 
| Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1487 | wait $PXY_PID >> $PXY_OUT 2>&1 | 
| Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1488 | fi | 
|  | 1489 | } | 
|  | 1490 |  | 
| Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1491 | # Detect if the current test is going to use TLS 1.3 or TLS 1.2. | 
| Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 1492 | # $1 and $2 contain the server and client command lines, respectively. | 
| Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1493 | # | 
|  | 1494 | # Note: this function only provides some guess about TLS version by simply | 
|  | 1495 | #       looking at the server/client command lines. Even thought this works | 
|  | 1496 | #       for the sake of tests' filtering (especially in conjunction with the | 
|  | 1497 | #       detect_required_features() function), it does NOT guarantee that the | 
|  | 1498 | #       result is accurate. It does not check other conditions, such as: | 
| Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1499 | #       - we can force a ciphersuite which contains "WITH" in its name, meaning | 
|  | 1500 | #         that we are going to use TLS 1.2 | 
|  | 1501 | #       - etc etc | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1502 | get_tls_version() { | 
| Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1503 | # First check if the version is forced on an Mbed TLS peer | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1504 | case $1 in | 
| Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1505 | *tls12*) | 
|  | 1506 | echo "TLS12" | 
|  | 1507 | return;; | 
|  | 1508 | *tls13*) | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1509 | echo "TLS13" | 
|  | 1510 | return;; | 
|  | 1511 | esac | 
|  | 1512 | case $2 in | 
| Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1513 | *tls12*) | 
|  | 1514 | echo "TLS12" | 
|  | 1515 | return;; | 
|  | 1516 | *tls13*) | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1517 | echo "TLS13" | 
|  | 1518 | return;; | 
|  | 1519 | esac | 
| Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1520 | # Second check if the version is forced on an OpenSSL or GnuTLS peer | 
|  | 1521 | case $1 in | 
|  | 1522 | tls1_2*) | 
|  | 1523 | echo "TLS12" | 
|  | 1524 | return;; | 
|  | 1525 | *tls1_3) | 
|  | 1526 | echo "TLS13" | 
|  | 1527 | return;; | 
|  | 1528 | esac | 
|  | 1529 | case $2 in | 
|  | 1530 | *tls1_2) | 
|  | 1531 | echo "TLS12" | 
|  | 1532 | return;; | 
|  | 1533 | *tls1_3) | 
|  | 1534 | echo "TLS13" | 
|  | 1535 | return;; | 
|  | 1536 | esac | 
|  | 1537 | # Third if the version is not forced, if TLS 1.3 is enabled then the test | 
|  | 1538 | # is aimed to run a TLS 1.3 handshake. | 
|  | 1539 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 1540 | then | 
|  | 1541 | echo "TLS13" | 
|  | 1542 | else | 
|  | 1543 | echo "TLS12" | 
|  | 1544 | fi | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1545 | } | 
|  | 1546 |  | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1547 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] | 
|  | 1548 | # Options:  -s pattern  pattern that must be present in server output | 
|  | 1549 | #           -c pattern  pattern that must be present in client output | 
|  | 1550 | #           -u pattern  lines after pattern must be unique in client output | 
|  | 1551 | #           -f call shell function on client output | 
|  | 1552 | #           -S pattern  pattern that must be absent in server output | 
|  | 1553 | #           -C pattern  pattern that must be absent in client output | 
|  | 1554 | #           -U pattern  lines after pattern must be unique in server output | 
|  | 1555 | #           -F call shell function on server output | 
|  | 1556 | #           -g call shell function on server and client output | 
|  | 1557 | run_test() { | 
|  | 1558 | NAME="$1" | 
|  | 1559 | shift 1 | 
|  | 1560 |  | 
|  | 1561 | if is_excluded "$NAME"; then | 
|  | 1562 | SKIP_NEXT="NO" | 
|  | 1563 | # There was no request to run the test, so don't record its outcome. | 
|  | 1564 | return | 
|  | 1565 | fi | 
|  | 1566 |  | 
|  | 1567 | print_name "$NAME" | 
|  | 1568 |  | 
|  | 1569 | # Do we only run numbered tests? | 
|  | 1570 | if [ -n "$RUN_TEST_NUMBER" ]; then | 
|  | 1571 | case ",$RUN_TEST_NUMBER," in | 
|  | 1572 | *",$TESTS,"*) :;; | 
|  | 1573 | *) SKIP_NEXT="YES";; | 
|  | 1574 | esac | 
|  | 1575 | fi | 
|  | 1576 |  | 
|  | 1577 | # does this test use a proxy? | 
|  | 1578 | if [ "X$1" = "X-p" ]; then | 
|  | 1579 | PXY_CMD="$2" | 
|  | 1580 | shift 2 | 
|  | 1581 | else | 
|  | 1582 | PXY_CMD="" | 
|  | 1583 | fi | 
|  | 1584 |  | 
|  | 1585 | # get commands and client output | 
|  | 1586 | SRV_CMD="$1" | 
|  | 1587 | CLI_CMD="$2" | 
|  | 1588 | CLI_EXPECT="$3" | 
|  | 1589 | shift 3 | 
|  | 1590 |  | 
|  | 1591 | # Check if test uses files | 
|  | 1592 | case "$SRV_CMD $CLI_CMD" in | 
|  | 1593 | *data_files/*) | 
|  | 1594 | requires_config_enabled MBEDTLS_FS_IO;; | 
|  | 1595 | esac | 
|  | 1596 |  | 
| Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1597 | # Check if the test uses DTLS. | 
|  | 1598 | detect_dtls "$SRV_CMD" | 
|  | 1599 | if [ "$DTLS" -eq 1 ]; then | 
|  | 1600 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 1601 | fi | 
|  | 1602 |  | 
| Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1603 | # If the client or server requires certain features that can be detected | 
|  | 1604 | # from their command-line arguments, check that they're enabled. | 
| Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1605 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1606 |  | 
|  | 1607 | # Check if we are trying to use an external tool wich does not support ECDH | 
|  | 1608 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") | 
|  | 1609 |  | 
|  | 1610 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" | 
|  | 1611 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1612 |  | 
| Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1613 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. | 
|  | 1614 | maybe_adapt_for_psk "$@" | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1615 |  | 
|  | 1616 | # should we skip? | 
|  | 1617 | if [ "X$SKIP_NEXT" = "XYES" ]; then | 
|  | 1618 | SKIP_NEXT="NO" | 
|  | 1619 | record_outcome "SKIP" | 
|  | 1620 | SKIPS=$(( $SKIPS + 1 )) | 
|  | 1621 | return | 
|  | 1622 | fi | 
|  | 1623 |  | 
|  | 1624 | analyze_test_commands "$@" | 
|  | 1625 |  | 
| Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1626 | # One regular run and two retries | 
|  | 1627 | TIMES_LEFT=3 | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1628 | while [ $TIMES_LEFT -gt 0 ]; do | 
|  | 1629 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) | 
|  | 1630 |  | 
| Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1631 | do_run_test_once | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1632 |  | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1633 | check_test_failure "$@" | 
|  | 1634 | case $outcome in | 
|  | 1635 | PASS) break;; | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1636 | RETRY*) printf "$outcome ";; | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1637 | FAIL) return;; | 
|  | 1638 | esac | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1639 | done | 
|  | 1640 |  | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1641 | # If we get this far, the test case passed. | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1642 | record_outcome "PASS" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1643 | if [ "$PRESERVE_LOGS" -gt 0 ]; then | 
|  | 1644 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 1645 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1646 | if [ -n "$PXY_CMD" ]; then | 
|  | 1647 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 1648 | fi | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1649 | fi | 
|  | 1650 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1651 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1652 | } | 
|  | 1653 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1654 | run_test_psa() { | 
|  | 1655 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1656 | set_maybe_calc_verify none | 
| Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1657 | run_test    "PSA-supported ciphersuite: $1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1658 | "$P_SRV debug_level=3 force_version=tls12" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1659 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1660 | 0 \ | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1661 | -c "$maybe_calc_verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1662 | -c "calc PSA finished" \ | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1663 | -s "$maybe_calc_verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1664 | -s "calc PSA finished" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1665 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1666 | -c "Perform PSA-based ECDH computation."\ | 
| Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1667 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1668 | -S "error" \ | 
|  | 1669 | -C "error" | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1670 | unset maybe_calc_verify | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1671 | } | 
|  | 1672 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1673 | run_test_psa_force_curve() { | 
|  | 1674 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1675 | set_maybe_calc_verify none | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1676 | run_test    "PSA - ECDH with $1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1677 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1678 | "$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] | 1679 | 0 \ | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1680 | -c "$maybe_calc_verify" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1681 | -c "calc PSA finished" \ | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1682 | -s "$maybe_calc_verify" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1683 | -s "calc PSA finished" \ | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1684 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1685 | -c "Perform PSA-based ECDH computation."\ | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1686 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1687 | -S "error" \ | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1688 | -C "error" | 
| Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1689 | unset maybe_calc_verify | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1690 | } | 
|  | 1691 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1692 | # Test that the server's memory usage after a handshake is reduced when a client specifies | 
|  | 1693 | # a maximum fragment length. | 
|  | 1694 | #  first argument ($1) is MFL for SSL client | 
|  | 1695 | #  second argument ($2) is memory usage for SSL client with default MFL (16k) | 
|  | 1696 | run_test_memory_after_hanshake_with_mfl() | 
|  | 1697 | { | 
|  | 1698 | # The test passes if the difference is around 2*(16k-MFL) | 
| Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1699 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1700 |  | 
|  | 1701 | # Leave some margin for robustness | 
|  | 1702 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" | 
|  | 1703 |  | 
|  | 1704 | run_test    "Handshake memory usage (MFL $1)" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1705 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1706 | "$P_CLI debug_level=3 \ | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1707 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 1708 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ | 
|  | 1709 | 0 \ | 
|  | 1710 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" | 
|  | 1711 | } | 
|  | 1712 |  | 
|  | 1713 |  | 
|  | 1714 | # Test that the server's memory usage after a handshake is reduced when a client specifies | 
|  | 1715 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes | 
|  | 1716 | run_tests_memory_after_hanshake() | 
|  | 1717 | { | 
|  | 1718 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) | 
|  | 1719 | SKIP_THIS_TESTS="$SKIP_NEXT" | 
|  | 1720 |  | 
|  | 1721 | # first test with default MFU is to get reference memory usage | 
|  | 1722 | MEMORY_USAGE_MFL_16K=0 | 
|  | 1723 | run_test    "Handshake memory usage initial (MFL 16384 - default)" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1724 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1725 | "$P_CLI debug_level=3 \ | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1726 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 1727 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ | 
|  | 1728 | 0 \ | 
|  | 1729 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" | 
|  | 1730 |  | 
|  | 1731 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1732 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" | 
|  | 1733 |  | 
|  | 1734 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1735 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" | 
|  | 1736 |  | 
|  | 1737 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1738 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" | 
|  | 1739 |  | 
|  | 1740 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1741 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" | 
|  | 1742 | } | 
|  | 1743 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1744 | cleanup() { | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1745 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION | 
| Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1746 | rm -f context_srv.txt | 
|  | 1747 | rm -f context_cli.txt | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1748 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 | 
|  | 1749 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 | 
|  | 1750 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 | 
|  | 1751 | 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] | 1752 | exit 1 | 
|  | 1753 | } | 
|  | 1754 |  | 
| Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1755 | # | 
|  | 1756 | # MAIN | 
|  | 1757 | # | 
|  | 1758 |  | 
| Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1759 | get_options "$@" | 
|  | 1760 |  | 
| Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1761 | populate_enabled_hash_algs | 
|  | 1762 |  | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1763 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell | 
|  | 1764 | # patterns rather than regular expressions, use a case statement instead | 
|  | 1765 | # of calling grep. To keep the optimizer simple, it is incomplete and only | 
|  | 1766 | # detects simple cases: plain substring, everything, nothing. | 
|  | 1767 | # | 
|  | 1768 | # As an exception, the character '.' is treated as an ordinary character | 
|  | 1769 | # if it is the only special character in the string. This is because it's | 
|  | 1770 | # rare to need "any one character", but needing a literal '.' is common | 
|  | 1771 | # (e.g. '-f "DTLS 1.2"'). | 
|  | 1772 | need_grep= | 
|  | 1773 | case "$FILTER" in | 
|  | 1774 | '^$') simple_filter=;; | 
|  | 1775 | '.*') simple_filter='*';; | 
| Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1776 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1777 | need_grep=1;; | 
|  | 1778 | *) # No regexp or shell-pattern special character | 
|  | 1779 | simple_filter="*$FILTER*";; | 
|  | 1780 | esac | 
|  | 1781 | case "$EXCLUDE" in | 
|  | 1782 | '^$') simple_exclude=;; | 
|  | 1783 | '.*') simple_exclude='*';; | 
| Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1784 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1785 | need_grep=1;; | 
|  | 1786 | *) # No regexp or shell-pattern special character | 
|  | 1787 | simple_exclude="*$EXCLUDE*";; | 
|  | 1788 | esac | 
|  | 1789 | if [ -n "$need_grep" ]; then | 
|  | 1790 | is_excluded () { | 
|  | 1791 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" | 
|  | 1792 | } | 
|  | 1793 | else | 
|  | 1794 | is_excluded () { | 
|  | 1795 | case "$1" in | 
|  | 1796 | $simple_exclude) true;; | 
|  | 1797 | $simple_filter) false;; | 
|  | 1798 | *) true;; | 
|  | 1799 | esac | 
|  | 1800 | } | 
|  | 1801 | fi | 
|  | 1802 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1803 | # sanity checks, avoid an avalanche of errors | 
| Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1804 | P_SRV_BIN="${P_SRV%%[  ]*}" | 
|  | 1805 | P_CLI_BIN="${P_CLI%%[  ]*}" | 
|  | 1806 | P_PXY_BIN="${P_PXY%%[  ]*}" | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1807 | if [ ! -x "$P_SRV_BIN" ]; then | 
|  | 1808 | echo "Command '$P_SRV_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1809 | exit 1 | 
|  | 1810 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1811 | if [ ! -x "$P_CLI_BIN" ]; then | 
|  | 1812 | echo "Command '$P_CLI_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1813 | exit 1 | 
|  | 1814 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1815 | if [ ! -x "$P_PXY_BIN" ]; then | 
|  | 1816 | echo "Command '$P_PXY_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1817 | exit 1 | 
|  | 1818 | fi | 
| Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1819 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 1820 | if which valgrind >/dev/null 2>&1; then :; else | 
|  | 1821 | echo "Memcheck not possible. Valgrind not found" | 
|  | 1822 | exit 1 | 
|  | 1823 | fi | 
|  | 1824 | fi | 
| Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 1825 | if which $OPENSSL >/dev/null 2>&1; then :; else | 
|  | 1826 | echo "Command '$OPENSSL' not found" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1827 | exit 1 | 
|  | 1828 | fi | 
|  | 1829 |  | 
| Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1830 | # used by watchdog | 
|  | 1831 | MAIN_PID="$$" | 
|  | 1832 |  | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1833 | # We use somewhat arbitrary delays for tests: | 
|  | 1834 | # - how long do we wait for the server to start (when lsof not available)? | 
|  | 1835 | # - how long do we allow for the client to finish? | 
|  | 1836 | #   (not to check performance, just to avoid waiting indefinitely) | 
|  | 1837 | # Things are slower with valgrind, so give extra time here. | 
|  | 1838 | # | 
|  | 1839 | # Note: without lsof, there is a trade-off between the running time of this | 
|  | 1840 | # script and the risk of spurious errors because we didn't wait long enough. | 
|  | 1841 | # The watchdog delay on the other hand doesn't affect normal running time of | 
|  | 1842 | # 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] | 1843 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1844 | START_DELAY=6 | 
|  | 1845 | DOG_DELAY=60 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1846 | else | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1847 | START_DELAY=2 | 
|  | 1848 | DOG_DELAY=20 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1849 | fi | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1850 |  | 
|  | 1851 | # some particular tests need more time: | 
|  | 1852 | # - for the client, we multiply the usual watchdog limit by a factor | 
|  | 1853 | # - for the server, we sleep for a number of seconds after the client exits | 
|  | 1854 | # see client_need_more_time() and server_needs_more_time() | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1855 | CLI_DELAY_FACTOR=1 | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1856 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1857 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1858 | # 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] | 1859 | # +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] | 1860 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many | 
|  | 1861 | # 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] | 1862 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" | 
|  | 1863 | 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] | 1864 | 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] | 1865 | O_SRV="$O_SRV -accept $SRV_PORT" | 
| Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1866 | 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] | 1867 | G_SRV="$G_SRV -p $SRV_PORT" | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1868 | G_CLI="$G_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1869 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1870 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 1871 | 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] | 1872 | 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] | 1873 | fi | 
|  | 1874 |  | 
| Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1875 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even | 
|  | 1876 | # low-security ones. This covers not just cipher suites but also protocol | 
|  | 1877 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on | 
|  | 1878 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in | 
|  | 1879 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find | 
|  | 1880 | # 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] | 1881 | case $($OPENSSL version) in | 
| Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1882 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; | 
|  | 1883 | *) | 
|  | 1884 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" | 
|  | 1885 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" | 
|  | 1886 | ;; | 
|  | 1887 | esac | 
|  | 1888 |  | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1889 | if [ -n "${OPENSSL_NEXT:-}" ]; then | 
|  | 1890 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1891 | 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] | 1892 | 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] | 1893 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" | 
| XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1894 | 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] | 1895 | fi | 
|  | 1896 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1897 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1898 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1899 | 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] | 1900 | fi | 
|  | 1901 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1902 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1903 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" | 
| Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1904 | 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] | 1905 | fi | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1906 |  | 
| Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1907 | # Allow SHA-1, because many of our test certificates use it | 
|  | 1908 | P_SRV="$P_SRV allow_sha1=1" | 
|  | 1909 | P_CLI="$P_CLI allow_sha1=1" | 
|  | 1910 |  | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1911 | # Also pick a unique name for intermediate files | 
|  | 1912 | SRV_OUT="srv_out.$$" | 
|  | 1913 | CLI_OUT="cli_out.$$" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1914 | PXY_OUT="pxy_out.$$" | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1915 | SESSION="session.$$" | 
|  | 1916 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1917 | SKIP_NEXT="NO" | 
|  | 1918 |  | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1919 | trap cleanup INT TERM HUP | 
|  | 1920 |  | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1921 | # Basic test | 
|  | 1922 |  | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1923 | # Checks that: | 
|  | 1924 | # - 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] | 1925 | # - the expected parameters are selected | 
| Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1926 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1927 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" | 
| Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1928 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1929 | run_test    "Default, TLS 1.2" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1930 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1931 | "$P_CLI force_version=tls12" \ | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1932 | 0 \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1933 | -s "Protocol is TLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1934 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1935 | -s "client hello v3, signature_algorithm ext: 6" \ | 
| Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1936 | -s "ECDHE curve: x25519" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1937 | -S "error" \ | 
|  | 1938 | -C "error" | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1939 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1941 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1942 | run_test    "Default, DTLS" \ | 
|  | 1943 | "$P_SRV dtls=1" \ | 
|  | 1944 | "$P_CLI dtls=1" \ | 
|  | 1945 | 0 \ | 
|  | 1946 | -s "Protocol is DTLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1947 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1948 |  | 
| Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 1949 | # GnuTLS can be setup to send a ClientHello containing a supported versions | 
|  | 1950 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, | 
|  | 1951 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and | 
|  | 1952 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS | 
|  | 1953 | # client then detects the downgrade indication and aborts the handshake even | 
|  | 1954 | # if TLS 1.2 was its preferred version. Keeping the test even if the | 
|  | 1955 | # handshake fails eventually as it exercices parts of the Mbed TLS | 
|  | 1956 | # implementation that are otherwise not exercised. | 
| Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 1957 | requires_gnutls_tls1_3 | 
|  | 1958 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 1959 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 1960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 1961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 1962 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 1963 | run_test    "Server selecting TLS 1.2 over TLS 1.3" \ | 
|  | 1964 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 1965 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ | 
|  | 1966 | 1 \ | 
|  | 1967 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" | 
|  | 1968 |  | 
|  | 1969 | requires_gnutls_tls1_3 | 
|  | 1970 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 1971 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 1972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 1973 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 1974 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
|  | 1975 | run_test    "Server selecting TLS 1.2" \ | 
| Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 1976 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 1977 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ | 
|  | 1978 | 0 \ | 
|  | 1979 | -s "Protocol is TLSv1.2" \ | 
|  | 1980 | -c "HTTP/1.0 200 OK" | 
|  | 1981 |  | 
|  | 1982 | requires_gnutls_tls1_3 | 
|  | 1983 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 1984 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 1985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 1986 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | 1a353ea | 2023-04-04 14:55:57 +0200 | [diff] [blame] | 1987 | run_test    "Server selecting TLS 1.3, over TLS 1.2 if supported" \ | 
| Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 1988 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 1989 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:%DISABLE_TLS13_COMPAT_MODE" \ | 
|  | 1990 | 0 \ | 
|  | 1991 | -s "Protocol is TLSv1.3" \ | 
|  | 1992 | -c "HTTP/1.0 200 OK" | 
|  | 1993 |  | 
|  | 1994 | requires_gnutls_tls1_3 | 
|  | 1995 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 1996 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 1997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 1998 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
|  | 1999 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 1a353ea | 2023-04-04 14:55:57 +0200 | [diff] [blame] | 2000 | run_test    "Server selecting TLS 1.3, over TLS 1.2 if supported - compat mode enabled" \ | 
| Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 2001 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 2002 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2" \ | 
|  | 2003 | 0 \ | 
|  | 2004 | -s "Protocol is TLSv1.3" \ | 
|  | 2005 | -c "HTTP/1.0 200 OK" | 
|  | 2006 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 2007 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2008 | run_test    "TLS client auth: required" \ | 
|  | 2009 | "$P_SRV auth_mode=required" \ | 
|  | 2010 | "$P_CLI" \ | 
|  | 2011 | 0 \ | 
|  | 2012 | -s "Verifying peer X.509 certificate... ok" | 
|  | 2013 |  | 
| Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2014 | run_test    "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2015 | "$P_SRV" \ | 
|  | 2016 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2017 | 0 \ | 
|  | 2018 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2019 | -c "Key size is 256" | 
|  | 2020 |  | 
|  | 2021 | run_test    "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2022 | "$P_SRV" \ | 
|  | 2023 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2024 | 0 \ | 
|  | 2025 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2026 | -c "Key size is 128" | 
|  | 2027 |  | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2028 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2029 | requires_hash_alg SHA_256 | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2030 | run_test    "TLS: password protected client key" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2031 | "$P_SRV force_version=tls12 auth_mode=required" \ | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2032 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ | 
|  | 2033 | 0 | 
|  | 2034 |  | 
|  | 2035 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2036 | requires_hash_alg SHA_256 | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2037 | run_test    "TLS: password protected server key" \ | 
|  | 2038 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2039 | "$P_CLI force_version=tls12" \ | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2040 | 0 | 
|  | 2041 |  | 
|  | 2042 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2043 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2044 | requires_hash_alg SHA_256 | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2045 | run_test    "TLS: password protected server key, two certificates" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2046 | "$P_SRV force_version=tls12\ | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2047 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ | 
|  | 2048 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ | 
|  | 2049 | "$P_CLI" \ | 
|  | 2050 | 0 | 
|  | 2051 |  | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2052 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 2053 | run_test    "CA callback on client" \ | 
|  | 2054 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2055 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 " \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2056 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2057 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2058 | -S "error" \ | 
|  | 2059 | -C "error" | 
|  | 2060 |  | 
|  | 2061 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 2062 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2063 | requires_hash_alg SHA_256 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2064 | run_test    "CA callback on server" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2065 | "$P_SRV force_version=tls12 auth_mode=required" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2066 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ | 
|  | 2067 | key_file=data_files/server5.key" \ | 
|  | 2068 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2069 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2070 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 2071 | -S "error" \ | 
|  | 2072 | -C "error" | 
|  | 2073 |  | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2074 | # Test using an EC opaque private key for client authentication | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2076 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2077 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2078 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2079 | run_test    "Opaque key for client authentication: ECDHE-ECDSA" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2080 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server5.crt \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2081 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2082 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2083 | 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] | 2084 | 0 \ | 
|  | 2085 | -c "key type: Opaque" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2086 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2087 | -s "Verifying peer X.509 certificate... ok" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2088 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2089 | -S "error" \ | 
|  | 2090 | -C "error" | 
|  | 2091 |  | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2092 | # Test using a RSA opaque private key for client authentication | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2093 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2094 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2095 | requires_config_enabled MBEDTLS_RSA_C | 
| valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2096 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2097 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2098 | run_test    "Opaque key for client authentication: ECDHE-RSA" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2099 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2100 | key_file=data_files/server2.key" \ | 
|  | 2101 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2102 | 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] | 2103 | 0 \ | 
|  | 2104 | -c "key type: Opaque" \ | 
|  | 2105 | -c "Ciphersuite is TLS-ECDHE-RSA" \ | 
|  | 2106 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 2107 | -s "Ciphersuite is TLS-ECDHE-RSA" \ | 
|  | 2108 | -S "error" \ | 
|  | 2109 | -C "error" | 
|  | 2110 |  | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2111 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2112 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 2113 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2114 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2115 | run_test    "Opaque key for client authentication: DHE-RSA" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2116 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2117 | key_file=data_files/server2.key" \ | 
|  | 2118 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2119 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2120 | key_opaque_algs=rsa-sign-pkcs1,none" \ | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2121 | 0 \ | 
|  | 2122 | -c "key type: Opaque" \ | 
|  | 2123 | -c "Ciphersuite is TLS-DHE-RSA" \ | 
|  | 2124 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 2125 | -s "Ciphersuite is TLS-DHE-RSA" \ | 
|  | 2126 | -S "error" \ | 
|  | 2127 | -C "error" | 
|  | 2128 |  | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2129 | # Test using an EC opaque private key for server authentication | 
| Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2130 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2131 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2132 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2133 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2134 | run_test    "Opaque key for server authentication: ECDHE-ECDSA" \ | 
| Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2135 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2136 | key_file=data_files/server5.key  key_opaque_algs=ecdsa-sign,none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2137 | "$P_CLI force_version=tls12" \ | 
| Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2138 | 0 \ | 
|  | 2139 | -c "Verifying peer X.509 certificate... ok" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2140 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2141 | -s "key types: Opaque, none" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2142 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2143 | -S "error" \ | 
|  | 2144 | -C "error" | 
|  | 2145 |  | 
| Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2147 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2148 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2149 | run_test    "Opaque key for server authentication: ECDH-" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2150 | "$P_SRV auth_mode=required key_opaque=1\ | 
| Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 2151 | crt_file=data_files/server5.ku-ka.crt\ | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2152 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2153 | "$P_CLI force_version=tls12" \ | 
| Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2154 | 0 \ | 
|  | 2155 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2156 | -c "Ciphersuite is TLS-ECDH-" \ | 
|  | 2157 | -s "key types: Opaque, none" \ | 
|  | 2158 | -s "Ciphersuite is TLS-ECDH-" \ | 
|  | 2159 | -S "error" \ | 
|  | 2160 | -C "error" | 
|  | 2161 |  | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2162 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2163 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2164 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2165 | requires_hash_alg SHA_256 | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2166 | run_test    "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ | 
|  | 2167 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 2168 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ | 
|  | 2169 | debug_level=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2170 | "$P_CLI force_version=tls12" \ | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2171 | 1 \ | 
|  | 2172 | -s "key types: Opaque, none" \ | 
|  | 2173 | -s "error" \ | 
|  | 2174 | -c "error" \ | 
|  | 2175 | -c "Public key type mismatch" | 
|  | 2176 |  | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 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 | 
|  | 2181 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 2182 | requires_hash_alg SHA_256 | 
|  | 2183 | run_test    "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ | 
|  | 2184 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
|  | 2185 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ | 
|  | 2186 | debug_level=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2187 | "$P_CLI force_version=tls12" \ | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2188 | 1 \ | 
|  | 2189 | -s "key types: Opaque, none" \ | 
|  | 2190 | -s "error" \ | 
|  | 2191 | -c "error" \ | 
|  | 2192 | -c "Public key type mismatch" | 
|  | 2193 |  | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2194 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2195 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2196 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 2197 | requires_hash_alg SHA_256 | 
|  | 2198 | 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] | 2199 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2200 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ | 
|  | 2201 | debug_level=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2202 | "$P_CLI force_version=tls12" \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2203 | 1 \ | 
|  | 2204 | -s "key types: Opaque, none" \ | 
|  | 2205 | -s "got ciphersuites in common, but none of them usable" \ | 
|  | 2206 | -s "error" \ | 
|  | 2207 | -c "error" | 
|  | 2208 |  | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2209 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2210 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2211 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2213 | requires_hash_alg SHA_256 | 
| Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2214 | 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] | 2215 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2216 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ | 
|  | 2217 | debug_level=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2218 | "$P_CLI force_version=tls12" \ | 
| Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2219 | 1 \ | 
|  | 2220 | -s "key types: Opaque, none" \ | 
|  | 2221 | -s "got ciphersuites in common, but none of them usable" \ | 
|  | 2222 | -s "error" \ | 
|  | 2223 | -c "error" | 
|  | 2224 |  | 
| Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2225 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2226 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2227 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2228 | requires_config_enabled MBEDTLS_CCM_C | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2229 | 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] | 2230 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2231 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ | 
|  | 2232 | debug_level=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2233 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2234 | 1 \ | 
|  | 2235 | -s "key types: Opaque, none" \ | 
|  | 2236 | -s "got ciphersuites in common, but none of them usable" \ | 
|  | 2237 | -s "error" \ | 
|  | 2238 | -c "error" | 
|  | 2239 |  | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2240 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2241 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2242 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2243 | requires_hash_alg SHA_256 | 
| Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2244 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2245 | run_test    "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2246 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=data_files/server7.crt \ | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2247 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2248 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ | 
|  | 2249 | key_opaque_algs2=ecdsa-sign,none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2250 | "$P_CLI force_version=tls12" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2251 | 0 \ | 
|  | 2252 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2253 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2254 | -c "CN=Polarssl Test EC CA" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2255 | -s "key types: Opaque, Opaque" \ | 
|  | 2256 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
|  | 2257 | -S "error" \ | 
|  | 2258 | -C "error" | 
|  | 2259 |  | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2260 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2261 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2262 | requires_hash_alg SHA_384 | 
| Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2263 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2264 | 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] | 2265 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2266 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ | 
|  | 2267 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ | 
|  | 2268 | key_opaque_algs2=ecdh,none debug_level=3" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2269 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2270 | 0 \ | 
|  | 2271 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2272 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ | 
|  | 2273 | -c "CN=Polarssl Test EC CA" \ | 
|  | 2274 | -s "key types: Opaque, Opaque" \ | 
|  | 2275 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ | 
|  | 2276 | -S "error" \ | 
|  | 2277 | -C "error" | 
|  | 2278 |  | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2279 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2280 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2281 | requires_hash_alg SHA_384 | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_CCM_C | 
| Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2283 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2284 | run_test    "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ | 
| Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2285 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2286 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ | 
|  | 2287 | crt_file2=data_files/server2-sha256.crt \ | 
|  | 2288 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2289 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2290 | 0 \ | 
|  | 2291 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2292 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2293 | -c "CN=Polarssl Test EC CA" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2294 | -s "key types: Opaque, Opaque" \ | 
|  | 2295 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
|  | 2296 | -S "error" \ | 
|  | 2297 | -C "error" | 
|  | 2298 |  | 
| Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 2300 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2301 | requires_config_enabled MBEDTLS_RSA_C | 
| Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2302 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 2303 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2304 | run_test    "TLS 1.3 opaque key: no suitable algorithm found" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2305 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ | 
| Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2306 | "$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] | 2307 | 1 \ | 
| Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2308 | -c "key type: Opaque" \ | 
|  | 2309 | -s "key types: Opaque, Opaque" \ | 
|  | 2310 | -c "error" \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2311 | -s "no suitable signature algorithm" | 
| Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2312 |  | 
|  | 2313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 2314 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2315 | requires_config_enabled MBEDTLS_RSA_C | 
| Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2316 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 2317 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2318 | run_test    "TLS 1.3 opaque key: suitable algorithm found" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2319 | "$P_SRV debug_level=4 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] | 2320 | "$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] | 2321 | 0 \ | 
| Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2322 | -c "key type: Opaque" \ | 
|  | 2323 | -s "key types: Opaque, Opaque" \ | 
|  | 2324 | -C "error" \ | 
| Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2325 | -S "error" | 
| Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2326 |  | 
|  | 2327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 2328 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2329 | requires_config_enabled MBEDTLS_RSA_C | 
| Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 2331 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2332 | run_test    "TLS 1.3 opaque key: first client sig alg not suitable" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2333 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ | 
| Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2334 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ | 
|  | 2335 | 0 \ | 
| Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2336 | -s "key types: Opaque, Opaque" \ | 
|  | 2337 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ | 
|  | 2338 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ | 
|  | 2339 | -C "error" \ | 
|  | 2340 | -S "error" \ | 
|  | 2341 |  | 
|  | 2342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 2343 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2344 | requires_config_enabled MBEDTLS_RSA_C | 
| Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2345 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 2346 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2347 | run_test    "TLS 1.3 opaque key: 2 keys on server, suitable algorithm found" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2348 | "$P_SRV debug_level=4 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] | 2349 | "$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] | 2350 | 0 \ | 
| Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2351 | -c "key type: Opaque" \ | 
|  | 2352 | -s "key types: Opaque, Opaque" \ | 
|  | 2353 | -C "error" \ | 
|  | 2354 | -S "error" \ | 
|  | 2355 |  | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2356 | # Test using a RSA opaque private key for server authentication | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2357 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2358 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2359 | requires_config_enabled MBEDTLS_RSA_C | 
| valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2360 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2361 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2362 | run_test    "Opaque key for server authentication: ECDHE-RSA" \ | 
| Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2363 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2364 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2365 | "$P_CLI force_version=tls12" \ | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2366 | 0 \ | 
|  | 2367 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2368 | -c "Ciphersuite is TLS-ECDHE-RSA" \ | 
|  | 2369 | -s "key types: Opaque, none" \ | 
|  | 2370 | -s "Ciphersuite is TLS-ECDHE-RSA" \ | 
|  | 2371 | -S "error" \ | 
|  | 2372 | -C "error" | 
|  | 2373 |  | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2374 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2375 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2376 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2377 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2378 | run_test    "Opaque key for server authentication: DHE-RSA" \ | 
| Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2379 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2380 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2381 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2382 | 0 \ | 
|  | 2383 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2384 | -c "Ciphersuite is TLS-DHE-RSA" \ | 
|  | 2385 | -s "key types: Opaque, none" \ | 
|  | 2386 | -s "Ciphersuite is TLS-DHE-RSA" \ | 
|  | 2387 | -S "error" \ | 
|  | 2388 | -C "error" | 
|  | 2389 |  | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2390 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2391 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2392 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2393 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2394 | run_test    "Opaque key for server authentication: RSA-PSK" \ | 
|  | 2395 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ | 
|  | 2396 | psk=abc123 psk_identity=foo" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2397 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2398 | psk=abc123 psk_identity=foo" \ | 
|  | 2399 | 0 \ | 
|  | 2400 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2401 | -c "Ciphersuite is TLS-RSA-PSK-" \ | 
|  | 2402 | -s "key types: Opaque, Opaque" \ | 
|  | 2403 | -s "Ciphersuite is TLS-RSA-PSK-" \ | 
|  | 2404 | -S "error" \ | 
|  | 2405 | -C "error" | 
|  | 2406 |  | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2407 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2408 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 2409 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2410 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2411 | run_test    "Opaque key for server authentication: RSA-" \ | 
|  | 2412 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2413 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2414 | 0 \ | 
|  | 2415 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2416 | -c "Ciphersuite is TLS-RSA-" \ | 
|  | 2417 | -s "key types: Opaque, Opaque" \ | 
|  | 2418 | -s "Ciphersuite is TLS-RSA-" \ | 
|  | 2419 | -S "error" \ | 
|  | 2420 | -C "error" | 
|  | 2421 |  | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2422 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2423 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2424 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2425 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2426 | 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] | 2427 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
|  | 2428 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ | 
|  | 2429 | "$P_CLI crt_file=data_files/server2-sha256.crt \ | 
|  | 2430 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2431 | 1 \ | 
|  | 2432 | -s "key types: Opaque, none" \ | 
|  | 2433 | -s "got ciphersuites in common, but none of them usable" \ | 
|  | 2434 | -s "error" \ | 
|  | 2435 | -c "error" | 
|  | 2436 |  | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2437 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2438 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2440 | requires_hash_alg SHA_256 | 
| Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2441 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2442 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2443 | run_test    "Opaque keys for server authentication: RSA keys with different algs" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2444 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2445 | 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] | 2446 | crt_file2=data_files/server4.crt \ | 
|  | 2447 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2448 | "$P_CLI force_version=tls12" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2449 | 0 \ | 
|  | 2450 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2451 | -c "Ciphersuite is TLS-ECDHE-RSA" \ | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2452 | -c "CN=Polarssl Test EC CA" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2453 | -s "key types: Opaque, Opaque" \ | 
|  | 2454 | -s "Ciphersuite is TLS-ECDHE-RSA" \ | 
|  | 2455 | -S "error" \ | 
|  | 2456 | -C "error" | 
|  | 2457 |  | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2459 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2460 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2461 | requires_hash_alg SHA_384 | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2462 | requires_config_enabled MBEDTLS_GCM_C | 
| Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2463 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2464 | run_test    "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2465 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 2466 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2467 | crt_file2=data_files/server4.crt \ | 
|  | 2468 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ | 
|  | 2469 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2470 | 0 \ | 
|  | 2471 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2472 | -c "Ciphersuite is TLS-DHE-RSA" \ | 
| Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2473 | -c "CN=Polarssl Test EC CA" \ | 
| Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2474 | -s "key types: Opaque, Opaque" \ | 
|  | 2475 | -s "Ciphersuite is TLS-DHE-RSA" \ | 
|  | 2476 | -S "error" \ | 
|  | 2477 | -C "error" | 
|  | 2478 |  | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2479 | # Test using an EC opaque private key for client/server authentication | 
| Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2480 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2481 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2482 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2483 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2484 | run_test    "Opaque key for client/server authentication: ECDHE-ECDSA" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2485 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2486 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ | 
| Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2487 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2488 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ | 
| Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2489 | 0 \ | 
|  | 2490 | -c "key type: Opaque" \ | 
|  | 2491 | -c "Verifying peer X.509 certificate... ok" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2492 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2493 | -s "key types: Opaque, none" \ | 
| Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2494 | -s "Verifying peer X.509 certificate... ok" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2495 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2496 | -S "error" \ | 
|  | 2497 | -C "error" | 
|  | 2498 |  | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2499 | # Test using a RSA opaque private key for client/server authentication | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2501 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2502 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2503 | requires_hash_alg SHA_256 | 
| valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2504 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2505 | run_test    "Opaque key for client/server authentication: ECDHE-RSA" \ | 
| Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2506 | "$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] | 2507 | key_file=data_files/server2.key  key_opaque_algs=rsa-sign-pkcs1,none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2508 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2509 | 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] | 2510 | 0 \ | 
|  | 2511 | -c "key type: Opaque" \ | 
|  | 2512 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2513 | -c "Ciphersuite is TLS-ECDHE-RSA" \ | 
|  | 2514 | -s "key types: Opaque, none" \ | 
|  | 2515 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 2516 | -s "Ciphersuite is TLS-ECDHE-RSA" \ | 
|  | 2517 | -S "error" \ | 
|  | 2518 | -C "error" | 
|  | 2519 |  | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2520 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2521 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2522 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2523 | requires_hash_alg SHA_256 | 
| Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2524 | run_test    "Opaque key for client/server authentication: DHE-RSA" \ | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2525 | "$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] | 2526 | 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] | 2527 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2528 | key_file=data_files/server2.key  key_opaque_algs=rsa-sign-pkcs1,none \ | 
|  | 2529 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
| Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2530 | 0 \ | 
|  | 2531 | -c "key type: Opaque" \ | 
|  | 2532 | -c "Verifying peer X.509 certificate... ok" \ | 
|  | 2533 | -c "Ciphersuite is TLS-DHE-RSA" \ | 
|  | 2534 | -s "key types: Opaque, none" \ | 
|  | 2535 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 2536 | -s "Ciphersuite is TLS-DHE-RSA" \ | 
|  | 2537 | -S "error" \ | 
|  | 2538 | -C "error" | 
|  | 2539 |  | 
| Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2540 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2541 | # Test ciphersuites which we expect to be fully supported by PSA Crypto | 
|  | 2542 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. | 
|  | 2543 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM | 
|  | 2544 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 | 
|  | 2545 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM | 
|  | 2546 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 | 
|  | 2547 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 | 
|  | 2548 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 | 
|  | 2549 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA | 
|  | 2550 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 | 
|  | 2551 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 | 
|  | 2552 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2553 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED | 
|  | 2554 | run_test_psa_force_curve "secp521r1" | 
|  | 2555 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED | 
|  | 2556 | run_test_psa_force_curve "brainpoolP512r1" | 
|  | 2557 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED | 
|  | 2558 | run_test_psa_force_curve "secp384r1" | 
|  | 2559 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED | 
|  | 2560 | run_test_psa_force_curve "brainpoolP384r1" | 
|  | 2561 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
|  | 2562 | run_test_psa_force_curve "secp256r1" | 
|  | 2563 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED | 
|  | 2564 | run_test_psa_force_curve "secp256k1" | 
|  | 2565 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED | 
|  | 2566 | run_test_psa_force_curve "brainpoolP256r1" | 
|  | 2567 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED | 
|  | 2568 | run_test_psa_force_curve "secp224r1" | 
| Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2569 | ## SECP224K1 is buggy via the PSA API | 
| Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2570 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), | 
| Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2571 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. | 
|  | 2572 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but | 
|  | 2573 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. | 
|  | 2574 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED | 
|  | 2575 | #run_test_psa_force_curve "secp224k1" | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2576 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED | 
|  | 2577 | run_test_psa_force_curve "secp192r1" | 
|  | 2578 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED | 
|  | 2579 | run_test_psa_force_curve "secp192k1" | 
|  | 2580 |  | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2581 | # Test current time in ServerHello | 
|  | 2582 | requires_config_enabled MBEDTLS_HAVE_TIME | 
|  | 2583 | run_test    "ServerHello contains gmt_unix_time" \ | 
|  | 2584 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2585 | "$P_CLI force_version=tls12 debug_level=3" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2586 | 0 \ | 
|  | 2587 | -f "check_server_hello_time" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2588 | -F "check_server_hello_time" | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2589 |  | 
|  | 2590 | # Test for uniqueness of IVs in AEAD ciphersuites | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2591 | run_test    "Unique IV in GCM" \ | 
|  | 2592 | "$P_SRV exchanges=20 debug_level=4" \ | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2593 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2594 | 0 \ | 
|  | 2595 | -u "IV used" \ | 
|  | 2596 | -U "IV used" | 
|  | 2597 |  | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2598 | # Test for correctness of sent single supported algorithm | 
|  | 2599 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2600 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 2601 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2602 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2603 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
|  | 2604 | requires_pk_alg "ECDSA" | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2605 | requires_hash_alg SHA_256 | 
| Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2606 | run_test    "Single supported algorithm sending: mbedtls client" \ | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2607 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2608 | "$P_CLI force_version=tls12 sig_algs=ecdsa_secp256r1_sha256 debug_level=3" \ | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2609 | 0 \ | 
|  | 2610 | -c "Supported Signature Algorithm found: 04 03" | 
|  | 2611 |  | 
| Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 2613 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2614 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
|  | 2615 | requires_hash_alg SHA_256 | 
|  | 2616 | run_test    "Single supported algorithm sending: openssl client" \ | 
|  | 2617 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ | 
|  | 2618 | "$O_CLI -cert data_files/server6.crt \ | 
|  | 2619 | -key data_files/server6.key" \ | 
|  | 2620 | 0 | 
|  | 2621 |  | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2622 | # Tests for certificate verification callback | 
|  | 2623 | run_test    "Configuration-specific CRT verification callback" \ | 
|  | 2624 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2625 | "$P_CLI force_version=tls12 context_crt_cb=0 debug_level=3" \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2626 | 0 \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2627 | -S "error" \ | 
|  | 2628 | -c "Verify requested for " \ | 
|  | 2629 | -c "Use configuration-specific verification callback" \ | 
|  | 2630 | -C "Use context-specific verification callback" \ | 
|  | 2631 | -C "error" | 
|  | 2632 |  | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2633 | run_test    "Context-specific CRT verification callback" \ | 
|  | 2634 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2635 | "$P_CLI force_version=tls12 context_crt_cb=1 debug_level=3" \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2636 | 0 \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2637 | -S "error" \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2638 | -c "Verify requested for " \ | 
|  | 2639 | -c "Use context-specific verification callback" \ | 
|  | 2640 | -C "Use configuration-specific verification callback" \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2641 | -C "error" | 
|  | 2642 |  | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2643 | # Tests for SHA-1 support | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2644 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 2645 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2646 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2647 | 1 \ | 
|  | 2648 | -c "The certificate is signed with an unacceptable hash" | 
|  | 2649 |  | 
|  | 2650 | run_test    "SHA-1 explicitly allowed in server certificate" \ | 
|  | 2651 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2652 | "$P_CLI force_version=tls12 allow_sha1=1" \ | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2653 | 0 | 
|  | 2654 |  | 
|  | 2655 | run_test    "SHA-256 allowed by default in server certificate" \ | 
|  | 2656 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2657 | "$P_CLI force_version=tls12 allow_sha1=0" \ | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2658 | 0 | 
|  | 2659 |  | 
|  | 2660 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2661 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2662 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 2663 | 1 \ | 
|  | 2664 | -s "The certificate is signed with an unacceptable hash" | 
|  | 2665 |  | 
|  | 2666 | run_test    "SHA-1 explicitly allowed in client certificate" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2667 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2668 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 2669 | 0 | 
|  | 2670 |  | 
|  | 2671 | run_test    "SHA-256 allowed by default in client certificate" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2672 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2673 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ | 
|  | 2674 | 0 | 
|  | 2675 |  | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2676 | # Tests for datagram packing | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2678 | run_test    "DTLS: multiple records in same datagram, client and server" \ | 
|  | 2679 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 2680 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 2681 | 0 \ | 
|  | 2682 | -c "next record in same datagram" \ | 
|  | 2683 | -s "next record in same datagram" | 
|  | 2684 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2686 | run_test    "DTLS: multiple records in same datagram, client only" \ | 
|  | 2687 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 2688 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 2689 | 0 \ | 
|  | 2690 | -s "next record in same datagram" \ | 
|  | 2691 | -C "next record in same datagram" | 
|  | 2692 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2694 | run_test    "DTLS: multiple records in same datagram, server only" \ | 
|  | 2695 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 2696 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 2697 | 0 \ | 
|  | 2698 | -S "next record in same datagram" \ | 
|  | 2699 | -c "next record in same datagram" | 
|  | 2700 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2702 | run_test    "DTLS: multiple records in same datagram, neither client nor server" \ | 
|  | 2703 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 2704 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 2705 | 0 \ | 
|  | 2706 | -S "next record in same datagram" \ | 
|  | 2707 | -C "next record in same datagram" | 
|  | 2708 |  | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2709 | # Tests for Context serialization | 
|  | 2710 |  | 
|  | 2711 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2712 | run_test    "Context serialization, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2713 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2714 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2715 | 0 \ | 
|  | 2716 | -c "Deserializing connection..." \ | 
|  | 2717 | -S "Deserializing connection..." | 
|  | 2718 |  | 
|  | 2719 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2720 | run_test    "Context serialization, client serializes, ChaChaPoly" \ | 
|  | 2721 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 2722 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2723 | 0 \ | 
|  | 2724 | -c "Deserializing connection..." \ | 
|  | 2725 | -S "Deserializing connection..." | 
|  | 2726 |  | 
|  | 2727 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2728 | run_test    "Context serialization, client serializes, GCM" \ | 
|  | 2729 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 2730 | "$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] | 2731 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2732 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2733 | -S "Deserializing connection..." | 
|  | 2734 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2736 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2737 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2738 | run_test    "Context serialization, client serializes, with CID" \ | 
|  | 2739 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 2740 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 2741 | 0 \ | 
|  | 2742 | -c "Deserializing connection..." \ | 
|  | 2743 | -S "Deserializing connection..." | 
|  | 2744 |  | 
|  | 2745 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2746 | run_test    "Context serialization, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2747 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2748 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2749 | 0 \ | 
|  | 2750 | -C "Deserializing connection..." \ | 
|  | 2751 | -s "Deserializing connection..." | 
|  | 2752 |  | 
|  | 2753 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2754 | run_test    "Context serialization, server serializes, ChaChaPoly" \ | 
|  | 2755 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 2756 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2757 | 0 \ | 
|  | 2758 | -C "Deserializing connection..." \ | 
|  | 2759 | -s "Deserializing connection..." | 
|  | 2760 |  | 
|  | 2761 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2762 | run_test    "Context serialization, server serializes, GCM" \ | 
|  | 2763 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 2764 | "$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] | 2765 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2766 | -C "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2767 | -s "Deserializing connection..." | 
|  | 2768 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2770 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2772 | run_test    "Context serialization, server serializes, with CID" \ | 
|  | 2773 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 2774 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 2775 | 0 \ | 
|  | 2776 | -C "Deserializing connection..." \ | 
|  | 2777 | -s "Deserializing connection..." | 
|  | 2778 |  | 
|  | 2779 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2780 | run_test    "Context serialization, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2781 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2782 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2783 | 0 \ | 
|  | 2784 | -c "Deserializing connection..." \ | 
|  | 2785 | -s "Deserializing connection..." | 
|  | 2786 |  | 
|  | 2787 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2788 | run_test    "Context serialization, both serialize, ChaChaPoly" \ | 
|  | 2789 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 2790 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2791 | 0 \ | 
|  | 2792 | -c "Deserializing connection..." \ | 
|  | 2793 | -s "Deserializing connection..." | 
|  | 2794 |  | 
|  | 2795 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2796 | run_test    "Context serialization, both serialize, GCM" \ | 
|  | 2797 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 2798 | "$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] | 2799 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2800 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 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 | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2804 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2805 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2806 | run_test    "Context serialization, both serialize, with CID" \ | 
|  | 2807 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 2808 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 2809 | 0 \ | 
|  | 2810 | -c "Deserializing connection..." \ | 
|  | 2811 | -s "Deserializing connection..." | 
|  | 2812 |  | 
|  | 2813 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2814 | run_test    "Context serialization, re-init, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2815 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2816 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 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 | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2822 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2823 | run_test    "Context serialization, re-init, client serializes, ChaChaPoly" \ | 
|  | 2824 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 2825 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2826 | 0 \ | 
|  | 2827 | -c "Deserializing connection..." \ | 
|  | 2828 | -S "Deserializing connection..." | 
|  | 2829 |  | 
|  | 2830 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2831 | run_test    "Context serialization, re-init, client serializes, GCM" \ | 
|  | 2832 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 2833 | "$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] | 2834 | 0 \ | 
|  | 2835 | -c "Deserializing connection..." \ | 
|  | 2836 | -S "Deserializing connection..." | 
|  | 2837 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2839 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2840 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2841 | run_test    "Context serialization, re-init, client serializes, with CID" \ | 
|  | 2842 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 2843 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 2844 | 0 \ | 
|  | 2845 | -c "Deserializing connection..." \ | 
|  | 2846 | -S "Deserializing connection..." | 
|  | 2847 |  | 
|  | 2848 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2849 | run_test    "Context serialization, re-init, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2850 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2851 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2852 | 0 \ | 
|  | 2853 | -C "Deserializing connection..." \ | 
|  | 2854 | -s "Deserializing connection..." | 
|  | 2855 |  | 
|  | 2856 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2857 | run_test    "Context serialization, re-init, server serializes, ChaChaPoly" \ | 
|  | 2858 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 2859 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2860 | 0 \ | 
|  | 2861 | -C "Deserializing connection..." \ | 
|  | 2862 | -s "Deserializing connection..." | 
|  | 2863 |  | 
|  | 2864 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2865 | run_test    "Context serialization, re-init, server serializes, GCM" \ | 
|  | 2866 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 2867 | "$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] | 2868 | 0 \ | 
|  | 2869 | -C "Deserializing connection..." \ | 
|  | 2870 | -s "Deserializing connection..." | 
|  | 2871 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2873 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2874 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2875 | run_test    "Context serialization, re-init, server serializes, with CID" \ | 
|  | 2876 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 2877 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 2878 | 0 \ | 
|  | 2879 | -C "Deserializing connection..." \ | 
|  | 2880 | -s "Deserializing connection..." | 
|  | 2881 |  | 
|  | 2882 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2883 | run_test    "Context serialization, re-init, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2884 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2885 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2886 | 0 \ | 
|  | 2887 | -c "Deserializing connection..." \ | 
|  | 2888 | -s "Deserializing connection..." | 
|  | 2889 |  | 
|  | 2890 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2891 | run_test    "Context serialization, re-init, both serialize, ChaChaPoly" \ | 
|  | 2892 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 2893 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2894 | 0 \ | 
|  | 2895 | -c "Deserializing connection..." \ | 
|  | 2896 | -s "Deserializing connection..." | 
|  | 2897 |  | 
|  | 2898 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2899 | run_test    "Context serialization, re-init, both serialize, GCM" \ | 
|  | 2900 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 2901 | "$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] | 2902 | 0 \ | 
|  | 2903 | -c "Deserializing connection..." \ | 
|  | 2904 | -s "Deserializing connection..." | 
|  | 2905 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2907 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2908 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2909 | run_test    "Context serialization, re-init, both serialize, with CID" \ | 
|  | 2910 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 2911 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 2912 | 0 \ | 
|  | 2913 | -c "Deserializing connection..." \ | 
|  | 2914 | -s "Deserializing connection..." | 
|  | 2915 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2916 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2917 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2918 | run_test    "Saving the serialized context to a file" \ | 
|  | 2919 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ | 
|  | 2920 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ | 
|  | 2921 | 0 \ | 
|  | 2922 | -s "Save serialized context to a file... ok" \ | 
|  | 2923 | -c "Save serialized context to a file... ok" | 
|  | 2924 | rm -f context_srv.txt | 
|  | 2925 | rm -f context_cli.txt | 
|  | 2926 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2927 | # Tests for DTLS Connection ID extension | 
|  | 2928 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2929 | # So far, the CID API isn't implemented, so we can't | 
|  | 2930 | # grep for output witnessing its use. This needs to be | 
|  | 2931 | # changed once the CID extension is implemented. | 
|  | 2932 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2934 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2935 | run_test    "Connection ID: Cli enabled, Srv disabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2936 | "$P_SRV debug_level=3 dtls=1 cid=0" \ | 
|  | 2937 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2938 | 0 \ | 
|  | 2939 | -s "Disable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2940 | -s "found CID extension"           \ | 
|  | 2941 | -s "Client sent CID extension, but CID disabled" \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2942 | -c "Enable use of CID extension."  \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2943 | -c "client hello, adding CID extension" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2944 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2945 | -C "found CID extension" \ | 
|  | 2946 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2947 | -C "Copy CIDs into SSL transform" \ | 
|  | 2948 | -c "Use of Connection ID was rejected by the server" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2949 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2952 | run_test    "Connection ID: Cli disabled, Srv enabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2953 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2954 | "$P_CLI debug_level=3 dtls=1 cid=0" \ | 
|  | 2955 | 0 \ | 
|  | 2956 | -c "Disable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2957 | -C "client hello, adding CID extension"           \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2958 | -S "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2959 | -s "Enable use of CID extension." \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2960 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2961 | -C "found CID extension" \ | 
|  | 2962 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2963 | -C "Copy CIDs into SSL transform"  \ | 
| Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2964 | -s "Use of Connection ID was not offered by client" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2965 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2967 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2968 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2969 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2970 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2971 | 0 \ | 
|  | 2972 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2973 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2974 | -c "client hello, adding CID extension" \ | 
|  | 2975 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2976 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2977 | -s "server hello, adding CID extension" \ | 
|  | 2978 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2979 | -c "Use of CID extension negotiated" \ | 
|  | 2980 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2981 | -c "Copy CIDs into SSL transform" \ | 
|  | 2982 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2983 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2984 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2985 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2986 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2987 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2988 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2989 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2990 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2991 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ | 
|  | 2992 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ | 
|  | 2993 | 0 \ | 
|  | 2994 | -c "Enable use of CID extension." \ | 
|  | 2995 | -s "Enable use of CID extension." \ | 
|  | 2996 | -c "client hello, adding CID extension" \ | 
|  | 2997 | -s "found CID extension"           \ | 
|  | 2998 | -s "Use of CID extension negotiated" \ | 
|  | 2999 | -s "server hello, adding CID extension" \ | 
|  | 3000 | -c "found CID extension" \ | 
|  | 3001 | -c "Use of CID extension negotiated" \ | 
|  | 3002 | -s "Copy CIDs into SSL transform" \ | 
|  | 3003 | -c "Copy CIDs into SSL transform" \ | 
|  | 3004 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 3005 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 3006 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3007 | -c "Use of Connection ID has been negotiated" \ | 
|  | 3008 | -c "ignoring unexpected CID" \ | 
|  | 3009 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3010 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3012 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3013 | run_test    "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
|  | 3014 | -p "$P_PXY mtu=800" \ | 
|  | 3015 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 3016 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 3017 | 0 \ | 
|  | 3018 | -c "Enable use of CID extension." \ | 
|  | 3019 | -s "Enable use of CID extension." \ | 
|  | 3020 | -c "client hello, adding CID extension" \ | 
|  | 3021 | -s "found CID extension"           \ | 
|  | 3022 | -s "Use of CID extension negotiated" \ | 
|  | 3023 | -s "server hello, adding CID extension" \ | 
|  | 3024 | -c "found CID extension" \ | 
|  | 3025 | -c "Use of CID extension negotiated" \ | 
|  | 3026 | -s "Copy CIDs into SSL transform" \ | 
|  | 3027 | -c "Copy CIDs into SSL transform" \ | 
|  | 3028 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 3029 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 3030 | -s "Use of Connection ID has been negotiated" \ | 
|  | 3031 | -c "Use of Connection ID has been negotiated" | 
|  | 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, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3036 | -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] | 3037 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 3038 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 3039 | 0 \ | 
|  | 3040 | -c "Enable use of CID extension." \ | 
|  | 3041 | -s "Enable use of CID extension." \ | 
|  | 3042 | -c "client hello, adding CID extension" \ | 
|  | 3043 | -s "found CID extension"           \ | 
|  | 3044 | -s "Use of CID extension negotiated" \ | 
|  | 3045 | -s "server hello, adding CID extension" \ | 
|  | 3046 | -c "found CID extension" \ | 
|  | 3047 | -c "Use of CID extension negotiated" \ | 
|  | 3048 | -s "Copy CIDs into SSL transform" \ | 
|  | 3049 | -c "Copy CIDs into SSL transform" \ | 
|  | 3050 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 3051 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 3052 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3053 | -c "Use of Connection ID has been negotiated" \ | 
|  | 3054 | -c "ignoring unexpected CID" \ | 
|  | 3055 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3056 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3058 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3059 | run_test    "Connection ID: Cli+Srv enabled, Cli CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3060 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 3061 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 3062 | 0 \ | 
|  | 3063 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3064 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3065 | -c "client hello, adding CID extension" \ | 
|  | 3066 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3067 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3068 | -s "server hello, adding CID extension" \ | 
|  | 3069 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3070 | -c "Use of CID extension negotiated" \ | 
|  | 3071 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3072 | -c "Copy CIDs into SSL transform" \ | 
|  | 3073 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 3074 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 3075 | -s "Use of Connection ID has been negotiated" \ | 
|  | 3076 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3077 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3079 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3080 | run_test    "Connection ID: Cli+Srv enabled, Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3081 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 3082 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 3083 | 0 \ | 
|  | 3084 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3085 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3086 | -c "client hello, adding CID extension" \ | 
|  | 3087 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3088 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3089 | -s "server hello, adding CID extension" \ | 
|  | 3090 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3091 | -c "Use of CID extension negotiated" \ | 
|  | 3092 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3093 | -c "Copy CIDs into SSL transform" \ | 
|  | 3094 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 3095 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 3096 | -s "Use of Connection ID has been negotiated" \ | 
|  | 3097 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3098 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3100 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3101 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3102 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 3103 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 3104 | 0 \ | 
|  | 3105 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3106 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3107 | -c "client hello, adding CID extension" \ | 
|  | 3108 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3109 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3110 | -s "server hello, adding CID extension" \ | 
|  | 3111 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3112 | -c "Use of CID extension negotiated" \ | 
|  | 3113 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3114 | -c "Copy CIDs into SSL transform" \ | 
|  | 3115 | -S "Use of Connection ID has been negotiated" \ | 
|  | 3116 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3117 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3118 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3119 | 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] | 3120 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 3121 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 3122 | 0 \ | 
|  | 3123 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3124 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3125 | -c "client hello, adding CID extension" \ | 
|  | 3126 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3127 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3128 | -s "server hello, adding CID extension" \ | 
|  | 3129 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3130 | -c "Use of CID extension negotiated" \ | 
|  | 3131 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3132 | -c "Copy CIDs into SSL transform" \ | 
|  | 3133 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 3134 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 3135 | -s "Use of Connection ID has been negotiated" \ | 
|  | 3136 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3137 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3138 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3139 | 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] | 3140 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 3141 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 3142 | 0 \ | 
|  | 3143 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3144 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3145 | -c "client hello, adding CID extension" \ | 
|  | 3146 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3147 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3148 | -s "server hello, adding CID extension" \ | 
|  | 3149 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3150 | -c "Use of CID extension negotiated" \ | 
|  | 3151 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3152 | -c "Copy CIDs into SSL transform" \ | 
|  | 3153 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 3154 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 3155 | -s "Use of Connection ID has been negotiated" \ | 
|  | 3156 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3157 |  | 
| 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-CCM-8" \ | 
| 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-CCM-8" \ | 
|  | 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 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3178 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3179 | 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] | 3180 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 3181 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 3182 | 0 \ | 
|  | 3183 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3184 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3185 | -c "client hello, adding CID extension" \ | 
|  | 3186 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3187 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3188 | -s "server hello, adding CID extension" \ | 
|  | 3189 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3190 | -c "Use of CID extension negotiated" \ | 
|  | 3191 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3192 | -c "Copy CIDs into SSL transform" \ | 
|  | 3193 | -S "Use of Connection ID has been negotiated" \ | 
|  | 3194 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3195 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3196 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3197 | 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] | 3198 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 3199 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 3200 | 0 \ | 
|  | 3201 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3202 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3203 | -c "client hello, adding CID extension" \ | 
|  | 3204 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3205 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3206 | -s "server hello, adding CID extension" \ | 
|  | 3207 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3208 | -c "Use of CID extension negotiated" \ | 
|  | 3209 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3210 | -c "Copy CIDs into SSL transform" \ | 
|  | 3211 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 3212 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 3213 | -s "Use of Connection ID has been negotiated" \ | 
|  | 3214 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3215 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3217 | 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] | 3218 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 3219 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 3220 | 0 \ | 
|  | 3221 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3222 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3223 | -c "client hello, adding CID extension" \ | 
|  | 3224 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3225 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3226 | -s "server hello, adding CID extension" \ | 
|  | 3227 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3228 | -c "Use of CID extension negotiated" \ | 
|  | 3229 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3230 | -c "Copy CIDs into SSL transform" \ | 
|  | 3231 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 3232 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 3233 | -s "Use of Connection ID has been negotiated" \ | 
|  | 3234 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3235 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3236 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3237 | 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] | 3238 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 3239 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 3240 | 0 \ | 
|  | 3241 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3242 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3243 | -c "client hello, adding CID extension" \ | 
|  | 3244 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3245 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3246 | -s "server hello, adding CID extension" \ | 
|  | 3247 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3248 | -c "Use of CID extension negotiated" \ | 
|  | 3249 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3250 | -c "Copy CIDs into SSL transform" \ | 
|  | 3251 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 3252 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 3253 | -s "Use of Connection ID has been negotiated" \ | 
|  | 3254 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3255 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3256 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3257 | 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] | 3258 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 3259 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 3260 | 0 \ | 
|  | 3261 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3262 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3263 | -c "client hello, adding CID extension" \ | 
|  | 3264 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3265 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3266 | -s "server hello, adding CID extension" \ | 
|  | 3267 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3268 | -c "Use of CID extension negotiated" \ | 
|  | 3269 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3270 | -c "Copy CIDs into SSL transform" \ | 
|  | 3271 | -S "Use of Connection ID has been negotiated" \ | 
|  | 3272 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3273 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3275 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3276 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3277 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3278 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 3279 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 3280 | 0 \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3281 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3282 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3283 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3284 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3285 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3286 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3287 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3288 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 3289 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3291 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3292 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3293 | run_test    "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3294 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 3295 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 3296 | 0 \ | 
|  | 3297 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3298 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3299 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3300 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3301 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3302 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3303 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3304 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 3305 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3307 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3308 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3309 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ | 
|  | 3310 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 3311 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 3312 | 0 \ | 
|  | 3313 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3314 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3315 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3316 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3317 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3318 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3319 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3320 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 3321 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3323 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3324 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3325 | 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] | 3326 | -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] | 3327 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 3328 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 3329 | 0 \ | 
|  | 3330 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3331 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3332 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3333 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3334 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3335 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3336 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3337 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3338 | -c "ignoring unexpected CID" \ | 
|  | 3339 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3340 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3341 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3342 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3343 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 3344 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3345 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 3346 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 3347 | 0 \ | 
|  | 3348 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3349 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3350 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3351 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3352 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3353 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3354 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3355 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 3356 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3358 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3359 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3360 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ | 
|  | 3361 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 3362 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 3363 | 0 \ | 
|  | 3364 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3365 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3366 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3367 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3368 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3369 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3370 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3371 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 3372 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3374 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3375 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3376 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3377 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3378 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 3379 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 3380 | 0 \ | 
|  | 3381 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3382 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3383 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3384 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3385 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3386 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3387 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3388 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3389 | -c "ignoring unexpected CID" \ | 
|  | 3390 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3391 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3393 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3394 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 3395 | run_test    "Connection ID: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3396 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 3397 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 3398 | 0 \ | 
|  | 3399 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3400 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3401 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3402 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3403 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3404 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 3405 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3407 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3408 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3409 | run_test    "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ | 
|  | 3410 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 3411 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 3412 | 0 \ | 
|  | 3413 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3414 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3415 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3416 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3417 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3418 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 3419 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3421 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3422 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3423 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3424 | -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] | 3425 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 3426 | "$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" \ | 
|  | 3427 | 0 \ | 
|  | 3428 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3429 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3430 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3431 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3432 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3433 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3434 | -c "ignoring unexpected CID" \ | 
|  | 3435 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3436 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3438 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3439 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 3440 | run_test    "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3441 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 3442 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 3443 | 0 \ | 
|  | 3444 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3445 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3446 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3447 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3448 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3449 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3450 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3451 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3452 | -s "(after renegotiation) Use of Connection ID was not offered by client" | 
|  | 3453 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3455 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3456 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3457 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3458 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3459 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 3460 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 3461 | 0 \ | 
|  | 3462 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3463 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3464 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3465 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3466 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3467 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3468 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3469 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3470 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ | 
|  | 3471 | -c "ignoring unexpected CID" \ | 
|  | 3472 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3473 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3475 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 3477 | run_test    "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ | 
|  | 3478 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 3479 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 3480 | 0 \ | 
|  | 3481 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3482 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3483 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3484 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3485 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3486 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3487 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3488 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3489 | -c "(after renegotiation) Use of Connection ID was rejected by the server" | 
|  | 3490 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3492 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3493 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 3494 | run_test    "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3495 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3496 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 3497 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 3498 | 0 \ | 
|  | 3499 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3500 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3501 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3502 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3503 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3504 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3505 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 3506 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3507 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ | 
|  | 3508 | -c "ignoring unexpected CID" \ | 
|  | 3509 | -s "ignoring unexpected CID" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3510 |  | 
| Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3511 | # 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] | 3512 | # tests check that the buffer contents are reallocated when the message is | 
|  | 3513 | # larger than the buffer. | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3514 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 3515 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH | 
| Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3516 | requires_max_content_len 513 | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3517 | run_test    "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ | 
|  | 3518 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ | 
|  | 3519 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ | 
|  | 3520 | 0 \ | 
|  | 3521 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3522 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3523 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3524 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3525 | -s "Reallocating in_buf" \ | 
|  | 3526 | -s "Reallocating out_buf" | 
|  | 3527 |  | 
|  | 3528 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 3529 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH | 
| Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3530 | requires_max_content_len 1025 | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3531 | run_test    "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ | 
|  | 3532 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ | 
|  | 3533 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ | 
|  | 3534 | 0 \ | 
|  | 3535 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 3536 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 3537 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3538 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 3539 | -s "Reallocating in_buf" \ | 
|  | 3540 | -s "Reallocating out_buf" | 
|  | 3541 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3542 | # Tests for Encrypt-then-MAC extension | 
|  | 3543 |  | 
|  | 3544 | run_test    "Encrypt then MAC: default" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3545 | "$P_SRV debug_level=3 \ | 
|  | 3546 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3547 | "$P_CLI debug_level=3" \ | 
|  | 3548 | 0 \ | 
|  | 3549 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 3550 | -s "found encrypt then mac extension" \ | 
|  | 3551 | -s "server hello, adding encrypt then mac extension" \ | 
|  | 3552 | -c "found encrypt_then_mac extension" \ | 
|  | 3553 | -c "using encrypt then mac" \ | 
|  | 3554 | -s "using encrypt then mac" | 
|  | 3555 |  | 
|  | 3556 | run_test    "Encrypt then MAC: client enabled, server disabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3557 | "$P_SRV debug_level=3 etm=0 \ | 
|  | 3558 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3559 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 3560 | 0 \ | 
|  | 3561 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 3562 | -s "found encrypt then mac extension" \ | 
|  | 3563 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 3564 | -C "found encrypt_then_mac extension" \ | 
|  | 3565 | -C "using encrypt then mac" \ | 
|  | 3566 | -S "using encrypt then mac" | 
|  | 3567 |  | 
| Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3568 | run_test    "Encrypt then MAC: client enabled, aead cipher" \ | 
|  | 3569 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 3570 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 3571 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 3572 | 0 \ | 
|  | 3573 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 3574 | -s "found encrypt then mac extension" \ | 
|  | 3575 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 3576 | -C "found encrypt_then_mac extension" \ | 
|  | 3577 | -C "using encrypt then mac" \ | 
|  | 3578 | -S "using encrypt then mac" | 
|  | 3579 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3580 | run_test    "Encrypt then MAC: client disabled, server enabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3581 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 3582 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3583 | "$P_CLI debug_level=3 etm=0" \ | 
|  | 3584 | 0 \ | 
|  | 3585 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 3586 | -S "found encrypt then mac extension" \ | 
|  | 3587 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 3588 | -C "found encrypt_then_mac extension" \ | 
|  | 3589 | -C "using encrypt then mac" \ | 
|  | 3590 | -S "using encrypt then mac" | 
|  | 3591 |  | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3592 | # Tests for Extended Master Secret extension | 
|  | 3593 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3594 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3595 | run_test    "Extended Master Secret: default" \ | 
|  | 3596 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3597 | "$P_CLI force_version=tls12 debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3598 | 0 \ | 
|  | 3599 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 3600 | -s "found extended master secret extension" \ | 
|  | 3601 | -s "server hello, adding extended master secret extension" \ | 
|  | 3602 | -c "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3603 | -c "session hash for extended master secret" \ | 
|  | 3604 | -s "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3605 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3606 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3607 | run_test    "Extended Master Secret: client enabled, server disabled" \ | 
|  | 3608 | "$P_SRV debug_level=3 extended_ms=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3609 | "$P_CLI force_version=tls12 debug_level=3 extended_ms=1" \ | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3610 | 0 \ | 
|  | 3611 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 3612 | -s "found extended master secret extension" \ | 
|  | 3613 | -S "server hello, adding extended master secret extension" \ | 
|  | 3614 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3615 | -C "session hash for extended master secret" \ | 
|  | 3616 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3617 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3618 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3619 | run_test    "Extended Master Secret: client disabled, server enabled" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3620 | "$P_SRV force_version=tls12 debug_level=3 extended_ms=1" \ | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3621 | "$P_CLI debug_level=3 extended_ms=0" \ | 
|  | 3622 | 0 \ | 
|  | 3623 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 3624 | -S "found extended master secret extension" \ | 
|  | 3625 | -S "server hello, adding extended master secret extension" \ | 
|  | 3626 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3627 | -C "session hash for extended master secret" \ | 
|  | 3628 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3629 |  | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3630 | # Test sending and receiving empty application data records | 
|  | 3631 |  | 
|  | 3632 | run_test    "Encrypt then MAC: empty application data record" \ | 
|  | 3633 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ | 
|  | 3634 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3635 | 0 \ | 
|  | 3636 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 3637 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 3638 | -c "0 bytes written in 1 fragments" | 
|  | 3639 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3641 | run_test    "Encrypt then MAC: disabled, empty application data record" \ | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3642 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ | 
|  | 3643 | "$P_CLI auth_mode=none etm=0 request_size=0" \ | 
|  | 3644 | 0 \ | 
|  | 3645 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 3646 | -c "0 bytes written in 1 fragments" | 
|  | 3647 |  | 
|  | 3648 | run_test    "Encrypt then MAC, DTLS: empty application data record" \ | 
|  | 3649 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ | 
|  | 3650 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ | 
|  | 3651 | 0 \ | 
|  | 3652 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 3653 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 3654 | -c "0 bytes written in 1 fragments" | 
|  | 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 | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3657 | run_test    "Encrypt then MAC, DTLS: disabled, empty application data record" \ | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3658 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ | 
|  | 3659 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ | 
|  | 3660 | 0 \ | 
|  | 3661 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 3662 | -c "0 bytes written in 1 fragments" | 
|  | 3663 |  | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3664 | # Tests for CBC 1/n-1 record splitting | 
|  | 3665 |  | 
|  | 3666 | run_test    "CBC Record splitting: TLS 1.2, no splitting" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3667 | "$P_SRV force_version=tls12" \ | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3668 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3669 | request_size=123" \ | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3670 | 0 \ | 
|  | 3671 | -s "Read from client: 123 bytes read" \ | 
|  | 3672 | -S "Read from client: 1 bytes read" \ | 
|  | 3673 | -S "122 bytes read" | 
|  | 3674 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3675 | # Tests for Session Tickets | 
|  | 3676 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3677 | run_test    "Session resume using tickets: basic" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3678 | "$P_SRV debug_level=3 tickets=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3679 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3680 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3681 | -c "client hello, adding session ticket extension" \ | 
|  | 3682 | -s "found session ticket extension" \ | 
|  | 3683 | -s "server hello, adding session ticket extension" \ | 
|  | 3684 | -c "found session_ticket extension" \ | 
|  | 3685 | -c "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3686 | -S "session successfully restored from cache" \ | 
|  | 3687 | -s "session successfully restored from ticket" \ | 
|  | 3688 | -s "a session has been resumed" \ | 
|  | 3689 | -c "a session has been resumed" | 
|  | 3690 |  | 
| Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3691 | run_test    "Session resume using tickets: manual rotation" \ | 
|  | 3692 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3693 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3694 | 0 \ | 
|  | 3695 | -c "client hello, adding session ticket extension" \ | 
|  | 3696 | -s "found session ticket extension" \ | 
|  | 3697 | -s "server hello, adding session ticket extension" \ | 
|  | 3698 | -c "found session_ticket extension" \ | 
|  | 3699 | -c "parse new session ticket" \ | 
|  | 3700 | -S "session successfully restored from cache" \ | 
|  | 3701 | -s "session successfully restored from ticket" \ | 
|  | 3702 | -s "a session has been resumed" \ | 
|  | 3703 | -c "a session has been resumed" | 
|  | 3704 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3705 | run_test    "Session resume using tickets: cache disabled" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3706 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3707 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3708 | 0 \ | 
|  | 3709 | -c "client hello, adding session ticket extension" \ | 
|  | 3710 | -s "found session ticket extension" \ | 
|  | 3711 | -s "server hello, adding session ticket extension" \ | 
|  | 3712 | -c "found session_ticket extension" \ | 
|  | 3713 | -c "parse new session ticket" \ | 
|  | 3714 | -S "session successfully restored from cache" \ | 
|  | 3715 | -s "session successfully restored from ticket" \ | 
|  | 3716 | -s "a session has been resumed" \ | 
|  | 3717 | -c "a session has been resumed" | 
|  | 3718 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3719 | run_test    "Session resume using tickets: timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3720 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3721 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1 reco_delay=2000" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3722 | 0 \ | 
|  | 3723 | -c "client hello, adding session ticket extension" \ | 
|  | 3724 | -s "found session ticket extension" \ | 
|  | 3725 | -s "server hello, adding session ticket extension" \ | 
|  | 3726 | -c "found session_ticket extension" \ | 
|  | 3727 | -c "parse new session ticket" \ | 
|  | 3728 | -S "session successfully restored from cache" \ | 
|  | 3729 | -S "session successfully restored from ticket" \ | 
|  | 3730 | -S "a session has been resumed" \ | 
|  | 3731 | -C "a session has been resumed" | 
|  | 3732 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3733 | run_test    "Session resume using tickets: session copy" \ | 
|  | 3734 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3735 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3736 | 0 \ | 
|  | 3737 | -c "client hello, adding session ticket extension" \ | 
|  | 3738 | -s "found session ticket extension" \ | 
|  | 3739 | -s "server hello, adding session ticket extension" \ | 
|  | 3740 | -c "found session_ticket extension" \ | 
|  | 3741 | -c "parse new session ticket" \ | 
|  | 3742 | -S "session successfully restored from cache" \ | 
|  | 3743 | -s "session successfully restored from ticket" \ | 
|  | 3744 | -s "a session has been resumed" \ | 
|  | 3745 | -c "a session has been resumed" | 
|  | 3746 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3748 | run_test    "Session resume using tickets: openssl server" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3749 | "$O_SRV -tls1_2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3750 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3751 | 0 \ | 
|  | 3752 | -c "client hello, adding session ticket extension" \ | 
|  | 3753 | -c "found session_ticket extension" \ | 
|  | 3754 | -c "parse new session ticket" \ | 
|  | 3755 | -c "a session has been resumed" | 
|  | 3756 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3758 | run_test    "Session resume using tickets: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3759 | "$P_SRV debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3760 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 3761 | $O_CLI -sess_in $SESSION; \ | 
|  | 3762 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3763 | 0 \ | 
|  | 3764 | -s "found session ticket extension" \ | 
|  | 3765 | -s "server hello, adding session ticket extension" \ | 
|  | 3766 | -S "session successfully restored from cache" \ | 
|  | 3767 | -s "session successfully restored from ticket" \ | 
|  | 3768 | -s "a session has been resumed" | 
|  | 3769 |  | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3770 | run_test    "Session resume using tickets: AES-128-GCM" \ | 
|  | 3771 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3772 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 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 |  | 
|  | 3784 | run_test    "Session resume using tickets: AES-192-GCM" \ | 
|  | 3785 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3786 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3787 | 0 \ | 
|  | 3788 | -c "client hello, adding session ticket extension" \ | 
|  | 3789 | -s "found session ticket extension" \ | 
|  | 3790 | -s "server hello, adding session ticket extension" \ | 
|  | 3791 | -c "found session_ticket extension" \ | 
|  | 3792 | -c "parse new session ticket" \ | 
|  | 3793 | -S "session successfully restored from cache" \ | 
|  | 3794 | -s "session successfully restored from ticket" \ | 
|  | 3795 | -s "a session has been resumed" \ | 
|  | 3796 | -c "a session has been resumed" | 
|  | 3797 |  | 
|  | 3798 | run_test    "Session resume using tickets: AES-128-CCM" \ | 
|  | 3799 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3800 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3801 | 0 \ | 
|  | 3802 | -c "client hello, adding session ticket extension" \ | 
|  | 3803 | -s "found session ticket extension" \ | 
|  | 3804 | -s "server hello, adding session ticket extension" \ | 
|  | 3805 | -c "found session_ticket extension" \ | 
|  | 3806 | -c "parse new session ticket" \ | 
|  | 3807 | -S "session successfully restored from cache" \ | 
|  | 3808 | -s "session successfully restored from ticket" \ | 
|  | 3809 | -s "a session has been resumed" \ | 
|  | 3810 | -c "a session has been resumed" | 
|  | 3811 |  | 
|  | 3812 | run_test    "Session resume using tickets: AES-192-CCM" \ | 
|  | 3813 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3814 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3815 | 0 \ | 
|  | 3816 | -c "client hello, adding session ticket extension" \ | 
|  | 3817 | -s "found session ticket extension" \ | 
|  | 3818 | -s "server hello, adding session ticket extension" \ | 
|  | 3819 | -c "found session_ticket extension" \ | 
|  | 3820 | -c "parse new session ticket" \ | 
|  | 3821 | -S "session successfully restored from cache" \ | 
|  | 3822 | -s "session successfully restored from ticket" \ | 
|  | 3823 | -s "a session has been resumed" \ | 
|  | 3824 | -c "a session has been resumed" | 
|  | 3825 |  | 
|  | 3826 | run_test    "Session resume using tickets: AES-256-CCM" \ | 
|  | 3827 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3828 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3829 | 0 \ | 
|  | 3830 | -c "client hello, adding session ticket extension" \ | 
|  | 3831 | -s "found session ticket extension" \ | 
|  | 3832 | -s "server hello, adding session ticket extension" \ | 
|  | 3833 | -c "found session_ticket extension" \ | 
|  | 3834 | -c "parse new session ticket" \ | 
|  | 3835 | -S "session successfully restored from cache" \ | 
|  | 3836 | -s "session successfully restored from ticket" \ | 
|  | 3837 | -s "a session has been resumed" \ | 
|  | 3838 | -c "a session has been resumed" | 
|  | 3839 |  | 
|  | 3840 | run_test    "Session resume using tickets: CAMELLIA-128-CCM" \ | 
|  | 3841 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3842 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3843 | 0 \ | 
|  | 3844 | -c "client hello, adding session ticket extension" \ | 
|  | 3845 | -s "found session ticket extension" \ | 
|  | 3846 | -s "server hello, adding session ticket extension" \ | 
|  | 3847 | -c "found session_ticket extension" \ | 
|  | 3848 | -c "parse new session ticket" \ | 
|  | 3849 | -S "session successfully restored from cache" \ | 
|  | 3850 | -s "session successfully restored from ticket" \ | 
|  | 3851 | -s "a session has been resumed" \ | 
|  | 3852 | -c "a session has been resumed" | 
|  | 3853 |  | 
|  | 3854 | run_test    "Session resume using tickets: CAMELLIA-192-CCM" \ | 
|  | 3855 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3856 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3857 | 0 \ | 
|  | 3858 | -c "client hello, adding session ticket extension" \ | 
|  | 3859 | -s "found session ticket extension" \ | 
|  | 3860 | -s "server hello, adding session ticket extension" \ | 
|  | 3861 | -c "found session_ticket extension" \ | 
|  | 3862 | -c "parse new session ticket" \ | 
|  | 3863 | -S "session successfully restored from cache" \ | 
|  | 3864 | -s "session successfully restored from ticket" \ | 
|  | 3865 | -s "a session has been resumed" \ | 
|  | 3866 | -c "a session has been resumed" | 
|  | 3867 |  | 
|  | 3868 | run_test    "Session resume using tickets: CAMELLIA-256-CCM" \ | 
|  | 3869 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3870 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3871 | 0 \ | 
|  | 3872 | -c "client hello, adding session ticket extension" \ | 
|  | 3873 | -s "found session ticket extension" \ | 
|  | 3874 | -s "server hello, adding session ticket extension" \ | 
|  | 3875 | -c "found session_ticket extension" \ | 
|  | 3876 | -c "parse new session ticket" \ | 
|  | 3877 | -S "session successfully restored from cache" \ | 
|  | 3878 | -s "session successfully restored from ticket" \ | 
|  | 3879 | -s "a session has been resumed" \ | 
|  | 3880 | -c "a session has been resumed" | 
|  | 3881 |  | 
|  | 3882 | run_test    "Session resume using tickets: ARIA-128-GCM" \ | 
|  | 3883 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3884 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3885 | 0 \ | 
|  | 3886 | -c "client hello, adding session ticket extension" \ | 
|  | 3887 | -s "found session ticket extension" \ | 
|  | 3888 | -s "server hello, adding session ticket extension" \ | 
|  | 3889 | -c "found session_ticket extension" \ | 
|  | 3890 | -c "parse new session ticket" \ | 
|  | 3891 | -S "session successfully restored from cache" \ | 
|  | 3892 | -s "session successfully restored from ticket" \ | 
|  | 3893 | -s "a session has been resumed" \ | 
|  | 3894 | -c "a session has been resumed" | 
|  | 3895 |  | 
|  | 3896 | run_test    "Session resume using tickets: ARIA-192-GCM" \ | 
|  | 3897 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3898 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3899 | 0 \ | 
|  | 3900 | -c "client hello, adding session ticket extension" \ | 
|  | 3901 | -s "found session ticket extension" \ | 
|  | 3902 | -s "server hello, adding session ticket extension" \ | 
|  | 3903 | -c "found session_ticket extension" \ | 
|  | 3904 | -c "parse new session ticket" \ | 
|  | 3905 | -S "session successfully restored from cache" \ | 
|  | 3906 | -s "session successfully restored from ticket" \ | 
|  | 3907 | -s "a session has been resumed" \ | 
|  | 3908 | -c "a session has been resumed" | 
|  | 3909 |  | 
|  | 3910 | run_test    "Session resume using tickets: ARIA-256-GCM" \ | 
|  | 3911 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3912 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3913 | 0 \ | 
|  | 3914 | -c "client hello, adding session ticket extension" \ | 
|  | 3915 | -s "found session ticket extension" \ | 
|  | 3916 | -s "server hello, adding session ticket extension" \ | 
|  | 3917 | -c "found session_ticket extension" \ | 
|  | 3918 | -c "parse new session ticket" \ | 
|  | 3919 | -S "session successfully restored from cache" \ | 
|  | 3920 | -s "session successfully restored from ticket" \ | 
|  | 3921 | -s "a session has been resumed" \ | 
|  | 3922 | -c "a session has been resumed" | 
|  | 3923 |  | 
|  | 3924 | run_test    "Session resume using tickets: ARIA-128-CCM" \ | 
|  | 3925 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3926 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3927 | 0 \ | 
|  | 3928 | -c "client hello, adding session ticket extension" \ | 
|  | 3929 | -s "found session ticket extension" \ | 
|  | 3930 | -s "server hello, adding session ticket extension" \ | 
|  | 3931 | -c "found session_ticket extension" \ | 
|  | 3932 | -c "parse new session ticket" \ | 
|  | 3933 | -S "session successfully restored from cache" \ | 
|  | 3934 | -s "session successfully restored from ticket" \ | 
|  | 3935 | -s "a session has been resumed" \ | 
|  | 3936 | -c "a session has been resumed" | 
|  | 3937 |  | 
|  | 3938 | run_test    "Session resume using tickets: ARIA-192-CCM" \ | 
|  | 3939 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3940 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3941 | 0 \ | 
|  | 3942 | -c "client hello, adding session ticket extension" \ | 
|  | 3943 | -s "found session ticket extension" \ | 
|  | 3944 | -s "server hello, adding session ticket extension" \ | 
|  | 3945 | -c "found session_ticket extension" \ | 
|  | 3946 | -c "parse new session ticket" \ | 
|  | 3947 | -S "session successfully restored from cache" \ | 
|  | 3948 | -s "session successfully restored from ticket" \ | 
|  | 3949 | -s "a session has been resumed" \ | 
|  | 3950 | -c "a session has been resumed" | 
|  | 3951 |  | 
|  | 3952 | run_test    "Session resume using tickets: ARIA-256-CCM" \ | 
|  | 3953 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3954 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +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 |  | 
| Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3966 | run_test    "Session resume using tickets: CHACHA20-POLY1305" \ | 
|  | 3967 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3968 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3969 | 0 \ | 
|  | 3970 | -c "client hello, adding session ticket extension" \ | 
|  | 3971 | -s "found session ticket extension" \ | 
|  | 3972 | -s "server hello, adding session ticket extension" \ | 
|  | 3973 | -c "found session_ticket extension" \ | 
|  | 3974 | -c "parse new session ticket" \ | 
|  | 3975 | -S "session successfully restored from cache" \ | 
|  | 3976 | -s "session successfully restored from ticket" \ | 
|  | 3977 | -s "a session has been resumed" \ | 
|  | 3978 | -c "a session has been resumed" | 
|  | 3979 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3980 | # Tests for Session Tickets with DTLS | 
|  | 3981 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3983 | run_test    "Session resume using tickets, DTLS: basic" \ | 
|  | 3984 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3985 | "$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] | 3986 | 0 \ | 
|  | 3987 | -c "client hello, adding session ticket extension" \ | 
|  | 3988 | -s "found session ticket extension" \ | 
|  | 3989 | -s "server hello, adding session ticket extension" \ | 
|  | 3990 | -c "found session_ticket extension" \ | 
|  | 3991 | -c "parse new session ticket" \ | 
|  | 3992 | -S "session successfully restored from cache" \ | 
|  | 3993 | -s "session successfully restored from ticket" \ | 
|  | 3994 | -s "a session has been resumed" \ | 
|  | 3995 | -c "a session has been resumed" | 
|  | 3996 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3998 | run_test    "Session resume using tickets, DTLS: cache disabled" \ | 
|  | 3999 | "$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] | 4000 | "$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] | 4001 | 0 \ | 
|  | 4002 | -c "client hello, adding session ticket extension" \ | 
|  | 4003 | -s "found session ticket extension" \ | 
|  | 4004 | -s "server hello, adding session ticket extension" \ | 
|  | 4005 | -c "found session_ticket extension" \ | 
|  | 4006 | -c "parse new session ticket" \ | 
|  | 4007 | -S "session successfully restored from cache" \ | 
|  | 4008 | -s "session successfully restored from ticket" \ | 
|  | 4009 | -s "a session has been resumed" \ | 
|  | 4010 | -c "a session has been resumed" | 
|  | 4011 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4013 | run_test    "Session resume using tickets, DTLS: timeout" \ | 
|  | 4014 | "$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] | 4015 | "$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] | 4016 | 0 \ | 
|  | 4017 | -c "client hello, adding session ticket extension" \ | 
|  | 4018 | -s "found session ticket extension" \ | 
|  | 4019 | -s "server hello, adding session ticket extension" \ | 
|  | 4020 | -c "found session_ticket extension" \ | 
|  | 4021 | -c "parse new session ticket" \ | 
|  | 4022 | -S "session successfully restored from cache" \ | 
|  | 4023 | -S "session successfully restored from ticket" \ | 
|  | 4024 | -S "a session has been resumed" \ | 
|  | 4025 | -C "a session has been resumed" | 
|  | 4026 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4028 | run_test    "Session resume using tickets, DTLS: session copy" \ | 
|  | 4029 | "$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] | 4030 | "$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] | 4031 | 0 \ | 
|  | 4032 | -c "client hello, adding session ticket extension" \ | 
|  | 4033 | -s "found session ticket extension" \ | 
|  | 4034 | -s "server hello, adding session ticket extension" \ | 
|  | 4035 | -c "found session_ticket extension" \ | 
|  | 4036 | -c "parse new session ticket" \ | 
|  | 4037 | -S "session successfully restored from cache" \ | 
|  | 4038 | -s "session successfully restored from ticket" \ | 
|  | 4039 | -s "a session has been resumed" \ | 
|  | 4040 | -c "a session has been resumed" | 
|  | 4041 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4043 | run_test    "Session resume using tickets, DTLS: openssl server" \ | 
|  | 4044 | "$O_SRV -dtls" \ | 
|  | 4045 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ | 
|  | 4046 | 0 \ | 
|  | 4047 | -c "client hello, adding session ticket extension" \ | 
|  | 4048 | -c "found session_ticket extension" \ | 
|  | 4049 | -c "parse new session ticket" \ | 
|  | 4050 | -c "a session has been resumed" | 
|  | 4051 |  | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4052 | # 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] | 4053 | # 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] | 4054 | requires_openssl_next | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4056 | run_test    "Session resume using tickets, DTLS: openssl client" \ | 
|  | 4057 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4058 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ | 
|  | 4059 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4060 | rm -f $SESSION )" \ | 
|  | 4061 | 0 \ | 
|  | 4062 | -s "found session ticket extension" \ | 
|  | 4063 | -s "server hello, adding session ticket extension" \ | 
|  | 4064 | -S "session successfully restored from cache" \ | 
|  | 4065 | -s "session successfully restored from ticket" \ | 
|  | 4066 | -s "a session has been resumed" | 
|  | 4067 |  | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4068 | # Tests for Session Resume based on session-ID and cache | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4069 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4070 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4071 | run_test    "Session resume using cache: tickets enabled on client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4072 | "$P_SRV debug_level=3 tickets=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4073 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4074 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4075 | -c "client hello, adding session ticket extension" \ | 
|  | 4076 | -s "found session ticket extension" \ | 
|  | 4077 | -S "server hello, adding session ticket extension" \ | 
|  | 4078 | -C "found session_ticket extension" \ | 
|  | 4079 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4080 | -s "session successfully restored from cache" \ | 
|  | 4081 | -S "session successfully restored from ticket" \ | 
|  | 4082 | -s "a session has been resumed" \ | 
|  | 4083 | -c "a session has been resumed" | 
|  | 4084 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4085 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4086 | run_test    "Session resume using cache: tickets enabled on server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4087 | "$P_SRV debug_level=3 tickets=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4088 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4089 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4090 | -C "client hello, adding session ticket extension" \ | 
|  | 4091 | -S "found session ticket extension" \ | 
|  | 4092 | -S "server hello, adding session ticket extension" \ | 
|  | 4093 | -C "found session_ticket extension" \ | 
|  | 4094 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4095 | -s "session successfully restored from cache" \ | 
|  | 4096 | -S "session successfully restored from ticket" \ | 
|  | 4097 | -s "a session has been resumed" \ | 
|  | 4098 | -c "a session has been resumed" | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4099 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4100 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4101 | run_test    "Session resume using cache: cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4102 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4103 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4104 | 0 \ | 
|  | 4105 | -S "session successfully restored from cache" \ | 
|  | 4106 | -S "session successfully restored from ticket" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4107 | -S "a session has been resumed" \ | 
|  | 4108 | -C "a session has been resumed" | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4109 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4110 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4111 | run_test    "Session resume using cache: cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4112 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4113 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4114 | 0 \ | 
|  | 4115 | -s "session successfully restored from cache" \ | 
|  | 4116 | -S "session successfully restored from ticket" \ | 
|  | 4117 | -s "a session has been resumed" \ | 
|  | 4118 | -c "a session has been resumed" | 
|  | 4119 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4120 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4121 | run_test    "Session resume using cache: cache removed" \ | 
|  | 4122 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4123 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ | 
| Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4124 | 0 \ | 
|  | 4125 | -C "client hello, adding session ticket extension" \ | 
|  | 4126 | -S "found session ticket extension" \ | 
|  | 4127 | -S "server hello, adding session ticket extension" \ | 
|  | 4128 | -C "found session_ticket extension" \ | 
|  | 4129 | -C "parse new session ticket" \ | 
|  | 4130 | -S "session successfully restored from cache" \ | 
|  | 4131 | -S "session successfully restored from ticket" \ | 
|  | 4132 | -S "a session has been resumed" \ | 
|  | 4133 | -C "a session has been resumed" | 
|  | 4134 |  | 
|  | 4135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 4136 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4137 | run_test    "Session resume using cache: timeout > delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4138 | "$P_SRV debug_level=3 tickets=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4139 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4140 | 0 \ | 
|  | 4141 | -s "session successfully restored from cache" \ | 
|  | 4142 | -S "session successfully restored from ticket" \ | 
|  | 4143 | -s "a session has been resumed" \ | 
|  | 4144 | -c "a session has been resumed" | 
|  | 4145 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4146 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4147 | run_test    "Session resume using cache: timeout < delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4148 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4149 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4150 | 0 \ | 
|  | 4151 | -S "session successfully restored from cache" \ | 
|  | 4152 | -S "session successfully restored from ticket" \ | 
|  | 4153 | -S "a session has been resumed" \ | 
|  | 4154 | -C "a session has been resumed" | 
|  | 4155 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4156 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4157 | run_test    "Session resume using cache: no timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4158 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4159 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4160 | 0 \ | 
|  | 4161 | -s "session successfully restored from cache" \ | 
|  | 4162 | -S "session successfully restored from ticket" \ | 
|  | 4163 | -s "a session has been resumed" \ | 
|  | 4164 | -c "a session has been resumed" | 
|  | 4165 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4166 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4167 | run_test    "Session resume using cache: session copy" \ | 
|  | 4168 | "$P_SRV debug_level=3 tickets=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4169 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4170 | 0 \ | 
|  | 4171 | -s "session successfully restored from cache" \ | 
|  | 4172 | -S "session successfully restored from ticket" \ | 
|  | 4173 | -s "a session has been resumed" \ | 
|  | 4174 | -c "a session has been resumed" | 
|  | 4175 |  | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4176 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4177 | run_test    "Session resume using cache: openssl client" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4178 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4179 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 4180 | $O_CLI -sess_in $SESSION; \ | 
|  | 4181 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4182 | 0 \ | 
|  | 4183 | -s "found session ticket extension" \ | 
|  | 4184 | -S "server hello, adding session ticket extension" \ | 
|  | 4185 | -s "session successfully restored from cache" \ | 
|  | 4186 | -S "session successfully restored from ticket" \ | 
|  | 4187 | -s "a session has been resumed" | 
|  | 4188 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4190 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4191 | run_test    "Session resume using cache: openssl server" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4192 | "$O_SRV -tls1_2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4193 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4194 | 0 \ | 
|  | 4195 | -C "found session_ticket extension" \ | 
|  | 4196 | -C "parse new session ticket" \ | 
|  | 4197 | -c "a session has been resumed" | 
|  | 4198 |  | 
| Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4199 | # Tests for Session resume and extensions | 
|  | 4200 |  | 
|  | 4201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 4202 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 4203 | run_test    "Session resume and connection ID" \ | 
|  | 4204 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ | 
|  | 4205 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ | 
|  | 4206 | 0 \ | 
|  | 4207 | -c "Enable use of CID extension." \ | 
|  | 4208 | -s "Enable use of CID extension." \ | 
|  | 4209 | -c "client hello, adding CID extension" \ | 
|  | 4210 | -s "found CID extension"           \ | 
|  | 4211 | -s "Use of CID extension negotiated" \ | 
|  | 4212 | -s "server hello, adding CID extension" \ | 
|  | 4213 | -c "found CID extension" \ | 
|  | 4214 | -c "Use of CID extension negotiated" \ | 
|  | 4215 | -s "Copy CIDs into SSL transform" \ | 
|  | 4216 | -c "Copy CIDs into SSL transform" \ | 
|  | 4217 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 4218 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 4219 | -s "Use of Connection ID has been negotiated" \ | 
|  | 4220 | -c "Use of Connection ID has been negotiated" | 
|  | 4221 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4222 | # Tests for Session Resume based on session-ID and cache, DTLS | 
|  | 4223 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4225 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4226 | run_test    "Session resume using cache, DTLS: tickets enabled on client" \ | 
|  | 4227 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4228 | "$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] | 4229 | 0 \ | 
|  | 4230 | -c "client hello, adding session ticket extension" \ | 
|  | 4231 | -s "found session ticket extension" \ | 
|  | 4232 | -S "server hello, adding session ticket extension" \ | 
|  | 4233 | -C "found session_ticket extension" \ | 
|  | 4234 | -C "parse new session ticket" \ | 
|  | 4235 | -s "session successfully restored from cache" \ | 
|  | 4236 | -S "session successfully restored from ticket" \ | 
|  | 4237 | -s "a session has been resumed" \ | 
|  | 4238 | -c "a session has been resumed" | 
|  | 4239 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4241 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4242 | run_test    "Session resume using cache, DTLS: tickets enabled on server" \ | 
|  | 4243 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4244 | "$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] | 4245 | 0 \ | 
|  | 4246 | -C "client hello, adding session ticket extension" \ | 
|  | 4247 | -S "found session ticket extension" \ | 
|  | 4248 | -S "server hello, adding session ticket extension" \ | 
|  | 4249 | -C "found session_ticket extension" \ | 
|  | 4250 | -C "parse new session ticket" \ | 
|  | 4251 | -s "session successfully restored from cache" \ | 
|  | 4252 | -S "session successfully restored from ticket" \ | 
|  | 4253 | -s "a session has been resumed" \ | 
|  | 4254 | -c "a session has been resumed" | 
|  | 4255 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4257 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4258 | run_test    "Session resume using cache, DTLS: cache_max=0" \ | 
|  | 4259 | "$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] | 4260 | "$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] | 4261 | 0 \ | 
|  | 4262 | -S "session successfully restored from cache" \ | 
|  | 4263 | -S "session successfully restored from ticket" \ | 
|  | 4264 | -S "a session has been resumed" \ | 
|  | 4265 | -C "a session has been resumed" | 
|  | 4266 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4268 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4269 | run_test    "Session resume using cache, DTLS: cache_max=1" \ | 
|  | 4270 | "$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] | 4271 | "$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] | 4272 | 0 \ | 
|  | 4273 | -s "session successfully restored from cache" \ | 
|  | 4274 | -S "session successfully restored from ticket" \ | 
|  | 4275 | -s "a session has been resumed" \ | 
|  | 4276 | -c "a session has been resumed" | 
|  | 4277 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4279 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4280 | run_test    "Session resume using cache, DTLS: timeout > delay" \ | 
|  | 4281 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4282 | "$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] | 4283 | 0 \ | 
|  | 4284 | -s "session successfully restored from cache" \ | 
|  | 4285 | -S "session successfully restored from ticket" \ | 
|  | 4286 | -s "a session has been resumed" \ | 
|  | 4287 | -c "a session has been resumed" | 
|  | 4288 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4290 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4291 | run_test    "Session resume using cache, DTLS: timeout < delay" \ | 
|  | 4292 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ | 
| Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4293 | "$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] | 4294 | 0 \ | 
|  | 4295 | -S "session successfully restored from cache" \ | 
|  | 4296 | -S "session successfully restored from ticket" \ | 
|  | 4297 | -S "a session has been resumed" \ | 
|  | 4298 | -C "a session has been resumed" | 
|  | 4299 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4301 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4302 | run_test    "Session resume using cache, DTLS: no timeout" \ | 
|  | 4303 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ | 
| Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4304 | "$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] | 4305 | 0 \ | 
|  | 4306 | -s "session successfully restored from cache" \ | 
|  | 4307 | -S "session successfully restored from ticket" \ | 
|  | 4308 | -s "a session has been resumed" \ | 
|  | 4309 | -c "a session has been resumed" | 
|  | 4310 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4312 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4313 | run_test    "Session resume using cache, DTLS: session copy" \ | 
|  | 4314 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4315 | "$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] | 4316 | 0 \ | 
|  | 4317 | -s "session successfully restored from cache" \ | 
|  | 4318 | -S "session successfully restored from ticket" \ | 
|  | 4319 | -s "a session has been resumed" \ | 
|  | 4320 | -c "a session has been resumed" | 
|  | 4321 |  | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4322 | # 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] | 4323 | # 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] | 4324 | requires_openssl_next | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4326 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4327 | run_test    "Session resume using cache, DTLS: openssl client" \ | 
|  | 4328 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4329 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ | 
|  | 4330 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4331 | rm -f $SESSION )" \ | 
|  | 4332 | 0 \ | 
|  | 4333 | -s "found session ticket extension" \ | 
|  | 4334 | -S "server hello, adding session ticket extension" \ | 
|  | 4335 | -s "session successfully restored from cache" \ | 
|  | 4336 | -S "session successfully restored from ticket" \ | 
|  | 4337 | -s "a session has been resumed" | 
|  | 4338 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4340 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4341 | run_test    "Session resume using cache, DTLS: openssl server" \ | 
|  | 4342 | "$O_SRV -dtls" \ | 
|  | 4343 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ | 
|  | 4344 | 0 \ | 
|  | 4345 | -C "found session_ticket extension" \ | 
|  | 4346 | -C "parse new session ticket" \ | 
|  | 4347 | -c "a session has been resumed" | 
|  | 4348 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4349 | # Tests for Max Fragment Length extension | 
|  | 4350 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4351 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4353 | run_test    "Max fragment length: enabled, default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4354 | "$P_SRV debug_level=3" \ | 
|  | 4355 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4356 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4357 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4358 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4359 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4360 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4361 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 4362 | -S "found max fragment length extension" \ | 
|  | 4363 | -S "server hello, max_fragment_length extension" \ | 
|  | 4364 | -C "found max_fragment_length extension" | 
|  | 4365 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4366 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4368 | run_test    "Max fragment length: enabled, default, larger message" \ | 
|  | 4369 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4370 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4371 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4372 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4373 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4374 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4375 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4376 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 4377 | -S "found max fragment length extension" \ | 
|  | 4378 | -S "server hello, max_fragment_length extension" \ | 
|  | 4379 | -C "found max_fragment_length extension" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4380 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 4381 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4382 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4383 |  | 
|  | 4384 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4386 | run_test    "Max fragment length, DTLS: enabled, default, larger message" \ | 
|  | 4387 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4388 | "$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] | 4389 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4390 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4391 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4392 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4393 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4394 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 4395 | -S "found max fragment length extension" \ | 
|  | 4396 | -S "server hello, max_fragment_length extension" \ | 
|  | 4397 | -C "found max_fragment_length extension" \ | 
|  | 4398 | -c "fragment larger than.*maximum " | 
|  | 4399 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4400 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled | 
|  | 4401 | # (session fragment length will be 16384 regardless of mbedtls | 
|  | 4402 | # content length configuration.) | 
|  | 4403 |  | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4404 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4406 | run_test    "Max fragment length: disabled, larger message" \ | 
|  | 4407 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4408 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4409 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4410 | -C "Maximum incoming record payload length is 16384" \ | 
|  | 4411 | -C "Maximum outgoing record payload length is 16384" \ | 
|  | 4412 | -S "Maximum incoming record payload length is 16384" \ | 
|  | 4413 | -S "Maximum outgoing record payload length is 16384" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4414 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 4415 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4416 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4417 |  | 
|  | 4418 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4420 | run_test    "Max fragment length, DTLS: disabled, larger message" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4421 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4422 | "$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] | 4423 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4424 | -C "Maximum incoming record payload length is 16384" \ | 
|  | 4425 | -C "Maximum outgoing record payload length is 16384" \ | 
|  | 4426 | -S "Maximum incoming record payload length is 16384" \ | 
|  | 4427 | -S "Maximum outgoing record payload length is 16384" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4428 | -c "fragment larger than.*maximum " | 
|  | 4429 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4430 | requires_max_content_len 4096 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4431 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4432 | run_test    "Max fragment length: used by client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4433 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4434 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4435 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4436 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 4437 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 4438 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 4439 | -s "Maximum outgoing record payload length is 4096" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4440 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4441 | -s "found max fragment length extension" \ | 
|  | 4442 | -s "server hello, max_fragment_length extension" \ | 
|  | 4443 | -c "found max_fragment_length extension" | 
|  | 4444 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4445 | requires_max_content_len 1024 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4446 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4447 | run_test    "Max fragment length: client 512, server 1024" \ | 
|  | 4448 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4449 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4450 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4451 | -c "Maximum incoming record payload length is 512" \ | 
|  | 4452 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 4453 | -s "Maximum incoming record payload length is 512" \ | 
|  | 4454 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4455 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4456 | -s "found max fragment length extension" \ | 
|  | 4457 | -s "server hello, max_fragment_length extension" \ | 
|  | 4458 | -c "found max_fragment_length extension" | 
|  | 4459 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4460 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4461 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4462 | run_test    "Max fragment length: client 512, server 2048" \ | 
|  | 4463 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4464 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4465 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4466 | -c "Maximum incoming record payload length is 512" \ | 
|  | 4467 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 4468 | -s "Maximum incoming record payload length is 512" \ | 
|  | 4469 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4470 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4471 | -s "found max fragment length extension" \ | 
|  | 4472 | -s "server hello, max_fragment_length extension" \ | 
|  | 4473 | -c "found max_fragment_length extension" | 
|  | 4474 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4475 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4476 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4477 | run_test    "Max fragment length: client 512, server 4096" \ | 
|  | 4478 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4479 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4480 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4481 | -c "Maximum incoming record payload length is 512" \ | 
|  | 4482 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 4483 | -s "Maximum incoming record payload length is 512" \ | 
|  | 4484 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4485 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4486 | -s "found max fragment length extension" \ | 
|  | 4487 | -s "server hello, max_fragment_length extension" \ | 
|  | 4488 | -c "found max_fragment_length extension" | 
|  | 4489 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4490 | requires_max_content_len 1024 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4491 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4492 | run_test    "Max fragment length: client 1024, server 512" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4493 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 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 512" \ | 
| 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 | 
|  | 4507 | run_test    "Max fragment length: client 1024, server 2048" \ | 
|  | 4508 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4509 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4510 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4511 | -c "Maximum incoming record payload length is 1024" \ | 
|  | 4512 | -c "Maximum outgoing record payload length is 1024" \ | 
|  | 4513 | -s "Maximum incoming record payload length is 1024" \ | 
|  | 4514 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4515 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4516 | -s "found max fragment length extension" \ | 
|  | 4517 | -s "server hello, max_fragment_length extension" \ | 
|  | 4518 | -c "found max_fragment_length extension" | 
|  | 4519 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4520 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4521 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4522 | run_test    "Max fragment length: client 1024, server 4096" \ | 
|  | 4523 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4524 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4525 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4526 | -c "Maximum incoming record payload length is 1024" \ | 
|  | 4527 | -c "Maximum outgoing record payload length is 1024" \ | 
|  | 4528 | -s "Maximum incoming record payload length is 1024" \ | 
|  | 4529 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4530 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4531 | -s "found max fragment length extension" \ | 
|  | 4532 | -s "server hello, max_fragment_length extension" \ | 
|  | 4533 | -c "found max_fragment_length extension" | 
|  | 4534 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4535 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4536 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4537 | run_test    "Max fragment length: client 2048, server 512" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4538 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4539 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 4540 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4541 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 4542 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 4543 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 4544 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4545 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4546 | -s "found max fragment length extension" \ | 
|  | 4547 | -s "server hello, max_fragment_length extension" \ | 
|  | 4548 | -c "found max_fragment_length extension" | 
|  | 4549 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4550 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4551 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4552 | run_test    "Max fragment length: client 2048, server 1024" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4553 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4554 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 4555 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4556 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 4557 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 4558 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 4559 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4560 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4561 | -s "found max fragment length extension" \ | 
|  | 4562 | -s "server hello, max_fragment_length extension" \ | 
|  | 4563 | -c "found max_fragment_length extension" | 
|  | 4564 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4565 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4566 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4567 | run_test    "Max fragment length: client 2048, server 4096" \ | 
|  | 4568 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4569 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4570 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4571 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 4572 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 4573 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 4574 | -s "Maximum outgoing record payload length is 2048" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4575 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4576 | -s "found max fragment length extension" \ | 
|  | 4577 | -s "server hello, max_fragment_length extension" \ | 
|  | 4578 | -c "found max_fragment_length extension" | 
|  | 4579 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4580 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4581 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4582 | run_test    "Max fragment length: client 4096, server 512" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4583 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4584 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 4585 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4586 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 4587 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 4588 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 4589 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4590 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4591 | -s "found max fragment length extension" \ | 
|  | 4592 | -s "server hello, max_fragment_length extension" \ | 
|  | 4593 | -c "found max_fragment_length extension" | 
|  | 4594 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4595 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4596 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4597 | run_test    "Max fragment length: client 4096, server 1024" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4598 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4599 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 4600 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4601 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 4602 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 4603 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 4604 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4605 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4606 | -s "found max fragment length extension" \ | 
|  | 4607 | -s "server hello, max_fragment_length extension" \ | 
|  | 4608 | -c "found max_fragment_length extension" | 
|  | 4609 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4610 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4611 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 4612 | run_test    "Max fragment length: client 4096, server 2048" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4613 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4614 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 4615 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4616 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 4617 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 4618 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 4619 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4620 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4621 | -s "found max fragment length extension" \ | 
|  | 4622 | -s "server hello, max_fragment_length extension" \ | 
|  | 4623 | -c "found max_fragment_length extension" | 
|  | 4624 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4625 | requires_max_content_len 4096 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4626 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4627 | run_test    "Max fragment length: used by server" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4628 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4629 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4630 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4631 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4632 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4633 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 4634 | -s "Maximum outgoing record payload length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4635 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 4636 | -S "found max fragment length extension" \ | 
|  | 4637 | -S "server hello, max_fragment_length extension" \ | 
|  | 4638 | -C "found max_fragment_length extension" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4639 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4640 | requires_max_content_len 4096 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4641 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4642 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4644 | run_test    "Max fragment length: gnutls server" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4645 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4646 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4647 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4648 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 4649 | -c "Maximum outgoing record payload length is 4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4650 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4651 | -c "found max_fragment_length extension" | 
|  | 4652 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4653 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4654 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4655 | run_test    "Max fragment length: client, message just fits" \ | 
|  | 4656 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4657 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048 request_size=2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4658 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4659 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 4660 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 4661 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 4662 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4663 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4664 | -s "found max fragment length extension" \ | 
|  | 4665 | -s "server hello, max_fragment_length extension" \ | 
|  | 4666 | -c "found max_fragment_length extension" \ | 
|  | 4667 | -c "2048 bytes written in 1 fragments" \ | 
|  | 4668 | -s "2048 bytes read" | 
|  | 4669 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4670 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4671 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4672 | run_test    "Max fragment length: client, larger message" \ | 
|  | 4673 | "$P_SRV debug_level=3" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4674 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048 request_size=2345" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4675 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4676 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 4677 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 4678 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 4679 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4680 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4681 | -s "found max fragment length extension" \ | 
|  | 4682 | -s "server hello, max_fragment_length extension" \ | 
|  | 4683 | -c "found max_fragment_length extension" \ | 
|  | 4684 | -c "2345 bytes written in 2 fragments" \ | 
|  | 4685 | -s "2048 bytes read" \ | 
|  | 4686 | -s "297 bytes read" | 
|  | 4687 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4688 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4689 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4691 | run_test    "Max fragment length: DTLS client, larger message" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4692 | "$P_SRV debug_level=3 dtls=1" \ | 
|  | 4693 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ | 
|  | 4694 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4695 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 4696 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 4697 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 4698 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4699 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4700 | -s "found max fragment length extension" \ | 
|  | 4701 | -s "server hello, max_fragment_length extension" \ | 
|  | 4702 | -c "found max_fragment_length extension" \ | 
|  | 4703 | -c "fragment larger than.*maximum" | 
|  | 4704 |  | 
| Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4705 | # Tests for Record Size Limit extension | 
|  | 4706 |  | 
| Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4707 | requires_gnutls_tls1_3 | 
|  | 4708 | requires_gnutls_record_size_limit | 
| Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4709 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT | 
|  | 4710 | run_test    "Record Size Limit: TLS 1.3: Server-side parsing, debug output and fatal alert" \ | 
|  | 4711 | "$P_SRV debug_level=3 force_version=tls13" \ | 
| Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4712 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \ | 
| Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4713 | 1 \ | 
|  | 4714 | -c "Preparing extension (Record Size Limit/28) for 'client hello'" \ | 
|  | 4715 | -c "Sending extension Record Size Limit/28 (2 bytes)" \ | 
|  | 4716 | -s "ClientHello: record_size_limit(28) extension received."\ | 
|  | 4717 | -s "found record_size_limit extension" \ | 
|  | 4718 | -s "RecordSizeLimit: 16385 Bytes" \ | 
|  | 4719 | -c "Received alert \[110]: An unsupported extension was sent" | 
|  | 4720 |  | 
|  | 4721 | requires_gnutls_tls1_3 | 
|  | 4722 | requires_gnutls_record_size_limit | 
|  | 4723 | requires_gnutls_next_disable_tls13_compat | 
|  | 4724 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT | 
|  | 4725 | run_test    "Record Size Limit: TLS 1.3: Client-side parsing, debug output and fatal alert" \ | 
|  | 4726 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert -d 4" \ | 
|  | 4727 | "$P_CLI debug_level=4 force_version=tls13" \ | 
| Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4728 | 0 \ | 
| Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4729 | -s "Preparing extension (Record Size Limit/28) for 'encrypted extensions'" | 
|  | 4730 | # The P_CLI can not yet send the Record Size Limit extension. Thus, the G_NEXT_SRV does not send | 
|  | 4731 | # a response in its EncryptedExtensions record. | 
|  | 4732 | #            -s "Parsing extension 'Record Size Limit/28 (2 bytes)" \ | 
|  | 4733 | #            -s "Sending extension Record Size Limit/28 (2 bytes)" \ | 
|  | 4734 | #            -c "EncryptedExtensions: record_size_limit(28) extension received."\ | 
|  | 4735 | #            -c "found record_size_limit extension" \ | 
|  | 4736 | #            -c "RecordSizeLimit: 16385 Bytes" \ | 
|  | 4737 | #            -s "Received alert \[110]: An unsupported extension was sent" | 
| Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4738 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4739 | # Tests for renegotiation | 
|  | 4740 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4741 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4742 | run_test    "Renegotiation: none, for reference" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4743 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4744 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4745 | 0 \ | 
|  | 4746 | -C "client hello, adding renegotiation extension" \ | 
|  | 4747 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4748 | -S "found renegotiation extension" \ | 
|  | 4749 | -s "server hello, secure renegotiation extension" \ | 
|  | 4750 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4751 | -C "=> renegotiate" \ | 
|  | 4752 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4753 | -S "write hello request" | 
|  | 4754 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4755 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4756 | run_test    "Renegotiation: client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4757 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4758 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4759 | 0 \ | 
|  | 4760 | -c "client hello, adding renegotiation extension" \ | 
|  | 4761 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4762 | -s "found renegotiation extension" \ | 
|  | 4763 | -s "server hello, secure renegotiation extension" \ | 
|  | 4764 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4765 | -c "=> renegotiate" \ | 
|  | 4766 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4767 | -S "write hello request" | 
|  | 4768 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4770 | run_test    "Renegotiation: server-initiated" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4771 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4772 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4773 | 0 \ | 
|  | 4774 | -c "client hello, adding renegotiation extension" \ | 
|  | 4775 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4776 | -s "found renegotiation extension" \ | 
|  | 4777 | -s "server hello, secure renegotiation extension" \ | 
|  | 4778 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4779 | -c "=> renegotiate" \ | 
|  | 4780 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4781 | -s "write hello request" | 
|  | 4782 |  | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4783 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 4784 | # 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] | 4785 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4786 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4787 | run_test    "Renegotiation: Signature Algorithms parsing, client-initiated" \ | 
|  | 4788 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4789 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4790 | 0 \ | 
|  | 4791 | -c "client hello, adding renegotiation extension" \ | 
|  | 4792 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4793 | -s "found renegotiation extension" \ | 
|  | 4794 | -s "server hello, secure renegotiation extension" \ | 
|  | 4795 | -c "found renegotiation extension" \ | 
|  | 4796 | -c "=> renegotiate" \ | 
|  | 4797 | -s "=> renegotiate" \ | 
|  | 4798 | -S "write hello request" \ | 
|  | 4799 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 4800 |  | 
|  | 4801 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 4802 | # 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] | 4803 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4804 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4805 | run_test    "Renegotiation: Signature Algorithms parsing, server-initiated" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4806 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4807 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 4808 | 0 \ | 
|  | 4809 | -c "client hello, adding renegotiation extension" \ | 
|  | 4810 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4811 | -s "found renegotiation extension" \ | 
|  | 4812 | -s "server hello, secure renegotiation extension" \ | 
|  | 4813 | -c "found renegotiation extension" \ | 
|  | 4814 | -c "=> renegotiate" \ | 
|  | 4815 | -s "=> renegotiate" \ | 
|  | 4816 | -s "write hello request" \ | 
|  | 4817 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 4818 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4819 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4820 | run_test    "Renegotiation: double" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4821 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4822 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4823 | 0 \ | 
|  | 4824 | -c "client hello, adding renegotiation extension" \ | 
|  | 4825 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4826 | -s "found renegotiation extension" \ | 
|  | 4827 | -s "server hello, secure renegotiation extension" \ | 
|  | 4828 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4829 | -c "=> renegotiate" \ | 
|  | 4830 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4831 | -s "write hello request" | 
|  | 4832 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4833 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4834 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4835 | requires_max_content_len 2048 | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4836 | run_test    "Renegotiation with max fragment length: client 2048, server 512" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4837 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4838 | "$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" \ | 
|  | 4839 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4840 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 4841 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 4842 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 4843 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4844 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 4845 | -s "found max fragment length extension" \ | 
|  | 4846 | -s "server hello, max_fragment_length extension" \ | 
|  | 4847 | -c "found max_fragment_length extension" \ | 
|  | 4848 | -c "client hello, adding renegotiation extension" \ | 
|  | 4849 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4850 | -s "found renegotiation extension" \ | 
|  | 4851 | -s "server hello, secure renegotiation extension" \ | 
|  | 4852 | -c "found renegotiation extension" \ | 
|  | 4853 | -c "=> renegotiate" \ | 
|  | 4854 | -s "=> renegotiate" \ | 
|  | 4855 | -s "write hello request" | 
|  | 4856 |  | 
|  | 4857 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4858 | run_test    "Renegotiation: client-initiated, server-rejected" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4859 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4860 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4861 | 1 \ | 
|  | 4862 | -c "client hello, adding renegotiation extension" \ | 
|  | 4863 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4864 | -S "found renegotiation extension" \ | 
|  | 4865 | -s "server hello, secure renegotiation extension" \ | 
|  | 4866 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4867 | -c "=> renegotiate" \ | 
|  | 4868 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4869 | -S "write hello request" \ | 
| Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4870 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4871 | -c "failed" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4872 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4873 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4874 | run_test    "Renegotiation: server-initiated, client-rejected, default" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4875 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4876 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4877 | 0 \ | 
|  | 4878 | -C "client hello, adding renegotiation extension" \ | 
|  | 4879 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4880 | -S "found renegotiation extension" \ | 
|  | 4881 | -s "server hello, secure renegotiation extension" \ | 
|  | 4882 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4883 | -C "=> renegotiate" \ | 
|  | 4884 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4885 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4886 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4887 | -S "failed" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4888 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4889 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4890 | run_test    "Renegotiation: server-initiated, client-rejected, not enforced" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4891 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4892 | renego_delay=-1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4893 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4894 | 0 \ | 
|  | 4895 | -C "client hello, adding renegotiation extension" \ | 
|  | 4896 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4897 | -S "found renegotiation extension" \ | 
|  | 4898 | -s "server hello, secure renegotiation extension" \ | 
|  | 4899 | -c "found renegotiation extension" \ | 
|  | 4900 | -C "=> renegotiate" \ | 
|  | 4901 | -S "=> renegotiate" \ | 
|  | 4902 | -s "write hello request" \ | 
|  | 4903 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4904 | -S "failed" | 
|  | 4905 |  | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4906 | # delay 2 for 1 alert record + 1 application data record | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4907 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4908 | run_test    "Renegotiation: server-initiated, client-rejected, delay 2" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4909 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4910 | renego_delay=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4911 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4912 | 0 \ | 
|  | 4913 | -C "client hello, adding renegotiation extension" \ | 
|  | 4914 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4915 | -S "found renegotiation extension" \ | 
|  | 4916 | -s "server hello, secure renegotiation extension" \ | 
|  | 4917 | -c "found renegotiation extension" \ | 
|  | 4918 | -C "=> renegotiate" \ | 
|  | 4919 | -S "=> renegotiate" \ | 
|  | 4920 | -s "write hello request" \ | 
|  | 4921 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4922 | -S "failed" | 
|  | 4923 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4924 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4925 | run_test    "Renegotiation: server-initiated, client-rejected, delay 0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4926 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4927 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4928 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4929 | 0 \ | 
|  | 4930 | -C "client hello, adding renegotiation extension" \ | 
|  | 4931 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4932 | -S "found renegotiation extension" \ | 
|  | 4933 | -s "server hello, secure renegotiation extension" \ | 
|  | 4934 | -c "found renegotiation extension" \ | 
|  | 4935 | -C "=> renegotiate" \ | 
|  | 4936 | -S "=> renegotiate" \ | 
|  | 4937 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4938 | -s "SSL - An unexpected message was received from our peer" | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4939 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4940 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4941 | run_test    "Renegotiation: server-initiated, client-accepted, delay 0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4942 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4943 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4944 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4945 | 0 \ | 
|  | 4946 | -c "client hello, adding renegotiation extension" \ | 
|  | 4947 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4948 | -s "found renegotiation extension" \ | 
|  | 4949 | -s "server hello, secure renegotiation extension" \ | 
|  | 4950 | -c "found renegotiation extension" \ | 
|  | 4951 | -c "=> renegotiate" \ | 
|  | 4952 | -s "=> renegotiate" \ | 
|  | 4953 | -s "write hello request" \ | 
|  | 4954 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4955 | -S "failed" | 
|  | 4956 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4957 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4958 | run_test    "Renegotiation: periodic, just below period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4959 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4960 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4961 | 0 \ | 
|  | 4962 | -C "client hello, adding renegotiation extension" \ | 
|  | 4963 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4964 | -S "found renegotiation extension" \ | 
|  | 4965 | -s "server hello, secure renegotiation extension" \ | 
|  | 4966 | -c "found renegotiation extension" \ | 
|  | 4967 | -S "record counter limit reached: renegotiate" \ | 
|  | 4968 | -C "=> renegotiate" \ | 
|  | 4969 | -S "=> renegotiate" \ | 
|  | 4970 | -S "write hello request" \ | 
|  | 4971 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4972 | -S "failed" | 
|  | 4973 |  | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4974 | # one extra exchange to be able to complete renego | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4975 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4976 | run_test    "Renegotiation: periodic, just above period" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4977 | "$P_SRV force_version=tls12 debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4978 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4979 | 0 \ | 
|  | 4980 | -c "client hello, adding renegotiation extension" \ | 
|  | 4981 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4982 | -s "found renegotiation extension" \ | 
|  | 4983 | -s "server hello, secure renegotiation extension" \ | 
|  | 4984 | -c "found renegotiation extension" \ | 
|  | 4985 | -s "record counter limit reached: renegotiate" \ | 
|  | 4986 | -c "=> renegotiate" \ | 
|  | 4987 | -s "=> renegotiate" \ | 
|  | 4988 | -s "write hello request" \ | 
|  | 4989 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4990 | -S "failed" | 
|  | 4991 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4992 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4993 | run_test    "Renegotiation: periodic, two times period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4994 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4995 | "$P_CLI force_version=tls12 debug_level=3 exchanges=7 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4996 | 0 \ | 
|  | 4997 | -c "client hello, adding renegotiation extension" \ | 
|  | 4998 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4999 | -s "found renegotiation extension" \ | 
|  | 5000 | -s "server hello, secure renegotiation extension" \ | 
|  | 5001 | -c "found renegotiation extension" \ | 
|  | 5002 | -s "record counter limit reached: renegotiate" \ | 
|  | 5003 | -c "=> renegotiate" \ | 
|  | 5004 | -s "=> renegotiate" \ | 
|  | 5005 | -s "write hello request" \ | 
|  | 5006 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 5007 | -S "failed" | 
|  | 5008 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5009 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5010 | run_test    "Renegotiation: periodic, above period, disabled" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5011 | "$P_SRV force_version=tls12 debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5012 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
|  | 5013 | 0 \ | 
|  | 5014 | -C "client hello, adding renegotiation extension" \ | 
|  | 5015 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 5016 | -S "found renegotiation extension" \ | 
|  | 5017 | -s "server hello, secure renegotiation extension" \ | 
|  | 5018 | -c "found renegotiation extension" \ | 
|  | 5019 | -S "record counter limit reached: renegotiate" \ | 
|  | 5020 | -C "=> renegotiate" \ | 
|  | 5021 | -S "=> renegotiate" \ | 
|  | 5022 | -S "write hello request" \ | 
|  | 5023 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 5024 | -S "failed" | 
|  | 5025 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5026 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5027 | run_test    "Renegotiation: nbio, client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5028 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5029 | "$P_CLI force_version=tls12 debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 5030 | 0 \ | 
|  | 5031 | -c "client hello, adding renegotiation extension" \ | 
|  | 5032 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 5033 | -s "found renegotiation extension" \ | 
|  | 5034 | -s "server hello, secure renegotiation extension" \ | 
|  | 5035 | -c "found renegotiation extension" \ | 
|  | 5036 | -c "=> renegotiate" \ | 
|  | 5037 | -s "=> renegotiate" \ | 
|  | 5038 | -S "write hello request" | 
|  | 5039 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5040 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5041 | run_test    "Renegotiation: nbio, server-initiated" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5042 | "$P_SRV force_version=tls12 debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5043 | "$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] | 5044 | 0 \ | 
|  | 5045 | -c "client hello, adding renegotiation extension" \ | 
|  | 5046 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 5047 | -s "found renegotiation extension" \ | 
|  | 5048 | -s "server hello, secure renegotiation extension" \ | 
|  | 5049 | -c "found renegotiation extension" \ | 
|  | 5050 | -c "=> renegotiate" \ | 
|  | 5051 | -s "=> renegotiate" \ | 
|  | 5052 | -s "write hello request" | 
|  | 5053 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5054 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5056 | run_test    "Renegotiation: openssl server, client-initiated" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5057 | "$O_SRV -www -tls1_2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5058 | "$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] | 5059 | 0 \ | 
|  | 5060 | -c "client hello, adding renegotiation extension" \ | 
|  | 5061 | -c "found renegotiation extension" \ | 
|  | 5062 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5063 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5064 | -C "error" \ | 
|  | 5065 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 5066 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5067 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5068 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5070 | run_test    "Renegotiation: gnutls server strict, client-initiated" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5071 | "$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] | 5072 | "$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] | 5073 | 0 \ | 
|  | 5074 | -c "client hello, adding renegotiation extension" \ | 
|  | 5075 | -c "found renegotiation extension" \ | 
|  | 5076 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5077 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5078 | -C "error" \ | 
|  | 5079 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 5080 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5081 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5082 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5084 | run_test    "Renegotiation: gnutls server unsafe, client-initiated default" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5085 | "$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] | 5086 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 5087 | 1 \ | 
|  | 5088 | -c "client hello, adding renegotiation extension" \ | 
|  | 5089 | -C "found renegotiation extension" \ | 
|  | 5090 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5091 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5092 | -c "error" \ | 
|  | 5093 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 5094 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5095 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5096 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5098 | run_test    "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5099 | "$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] | 5100 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 5101 | allow_legacy=0" \ | 
|  | 5102 | 1 \ | 
|  | 5103 | -c "client hello, adding renegotiation extension" \ | 
|  | 5104 | -C "found renegotiation extension" \ | 
|  | 5105 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5106 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5107 | -c "error" \ | 
|  | 5108 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 5109 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5110 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5111 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5113 | run_test    "Renegotiation: gnutls server unsafe, client-inititated legacy" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5114 | "$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] | 5115 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 5116 | allow_legacy=1" \ | 
|  | 5117 | 0 \ | 
|  | 5118 | -c "client hello, adding renegotiation extension" \ | 
|  | 5119 | -C "found renegotiation extension" \ | 
|  | 5120 | -c "=> renegotiate" \ | 
|  | 5121 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5122 | -C "error" \ | 
|  | 5123 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 5124 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5125 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5127 | run_test    "Renegotiation: DTLS, client-initiated" \ | 
|  | 5128 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ | 
|  | 5129 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 5130 | 0 \ | 
|  | 5131 | -c "client hello, adding renegotiation extension" \ | 
|  | 5132 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 5133 | -s "found renegotiation extension" \ | 
|  | 5134 | -s "server hello, secure renegotiation extension" \ | 
|  | 5135 | -c "found renegotiation extension" \ | 
|  | 5136 | -c "=> renegotiate" \ | 
|  | 5137 | -s "=> renegotiate" \ | 
|  | 5138 | -S "write hello request" | 
|  | 5139 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5140 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5142 | run_test    "Renegotiation: DTLS, server-initiated" \ | 
|  | 5143 | "$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] | 5144 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ | 
|  | 5145 | read_timeout=1000 max_resend=2" \ | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5146 | 0 \ | 
|  | 5147 | -c "client hello, adding renegotiation extension" \ | 
|  | 5148 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 5149 | -s "found renegotiation extension" \ | 
|  | 5150 | -s "server hello, secure renegotiation extension" \ | 
|  | 5151 | -c "found renegotiation extension" \ | 
|  | 5152 | -c "=> renegotiate" \ | 
|  | 5153 | -s "=> renegotiate" \ | 
|  | 5154 | -s "write hello request" | 
|  | 5155 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5156 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5158 | run_test    "Renegotiation: DTLS, renego_period overflow" \ | 
|  | 5159 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ | 
|  | 5160 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ | 
|  | 5161 | 0 \ | 
|  | 5162 | -c "client hello, adding renegotiation extension" \ | 
|  | 5163 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 5164 | -s "found renegotiation extension" \ | 
|  | 5165 | -s "server hello, secure renegotiation extension" \ | 
|  | 5166 | -s "record counter limit reached: renegotiate" \ | 
|  | 5167 | -c "=> renegotiate" \ | 
|  | 5168 | -s "=> renegotiate" \ | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5169 | -s "write hello request" | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5170 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5171 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5172 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5174 | run_test    "Renegotiation: DTLS, gnutls server, client-initiated" \ | 
|  | 5175 | "$G_SRV -u --mtu 4096" \ | 
|  | 5176 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 5177 | 0 \ | 
|  | 5178 | -c "client hello, adding renegotiation extension" \ | 
|  | 5179 | -c "found renegotiation extension" \ | 
|  | 5180 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5181 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5182 | -C "error" \ | 
|  | 5183 | -s "Extra-header:" | 
|  | 5184 |  | 
| Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5185 | # Test for the "secure renegotiation" extension only (no actual renegotiation) | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5186 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5187 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5189 | run_test    "Renego ext: gnutls server strict, client default" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5190 | "$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] | 5191 | "$P_CLI debug_level=3" \ | 
|  | 5192 | 0 \ | 
|  | 5193 | -c "found renegotiation extension" \ | 
|  | 5194 | -C "error" \ | 
|  | 5195 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 5196 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5197 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5199 | run_test    "Renego ext: gnutls server unsafe, client default" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5200 | "$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] | 5201 | "$P_CLI debug_level=3" \ | 
|  | 5202 | 0 \ | 
|  | 5203 | -C "found renegotiation extension" \ | 
|  | 5204 | -C "error" \ | 
|  | 5205 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 5206 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5207 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5209 | run_test    "Renego ext: gnutls server unsafe, client break legacy" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5210 | "$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] | 5211 | "$P_CLI debug_level=3 allow_legacy=-1" \ | 
|  | 5212 | 1 \ | 
|  | 5213 | -C "found renegotiation extension" \ | 
|  | 5214 | -c "error" \ | 
|  | 5215 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 5216 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5217 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5219 | run_test    "Renego ext: gnutls client strict, server default" \ | 
|  | 5220 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5221 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5222 | 0 \ | 
|  | 5223 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 5224 | -s "server hello, secure renegotiation extension" | 
|  | 5225 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5226 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5228 | run_test    "Renego ext: gnutls client unsafe, server default" \ | 
|  | 5229 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5230 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5231 | 0 \ | 
|  | 5232 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 5233 | -S "server hello, secure renegotiation extension" | 
|  | 5234 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5235 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5237 | run_test    "Renego ext: gnutls client unsafe, server break legacy" \ | 
|  | 5238 | "$P_SRV debug_level=3 allow_legacy=-1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5239 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5240 | 1 \ | 
|  | 5241 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 5242 | -S "server hello, secure renegotiation extension" | 
|  | 5243 |  | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5244 | # Tests for silently dropping trailing extra bytes in .der certificates | 
|  | 5245 |  | 
|  | 5246 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5248 | run_test    "DER format: no trailing bytes" \ | 
|  | 5249 | "$P_SRV crt_file=data_files/server5-der0.crt \ | 
|  | 5250 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5251 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5252 | 0 \ | 
|  | 5253 | -c "Handshake was completed" \ | 
|  | 5254 |  | 
|  | 5255 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5257 | run_test    "DER format: with a trailing zero byte" \ | 
|  | 5258 | "$P_SRV crt_file=data_files/server5-der1a.crt \ | 
|  | 5259 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5260 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5261 | 0 \ | 
|  | 5262 | -c "Handshake was completed" \ | 
|  | 5263 |  | 
|  | 5264 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5266 | run_test    "DER format: with a trailing random byte" \ | 
|  | 5267 | "$P_SRV crt_file=data_files/server5-der1b.crt \ | 
|  | 5268 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5269 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5270 | 0 \ | 
|  | 5271 | -c "Handshake was completed" \ | 
|  | 5272 |  | 
|  | 5273 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5275 | run_test    "DER format: with 2 trailing random bytes" \ | 
|  | 5276 | "$P_SRV crt_file=data_files/server5-der2.crt \ | 
|  | 5277 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5278 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5279 | 0 \ | 
|  | 5280 | -c "Handshake was completed" \ | 
|  | 5281 |  | 
|  | 5282 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5284 | run_test    "DER format: with 4 trailing random bytes" \ | 
|  | 5285 | "$P_SRV crt_file=data_files/server5-der4.crt \ | 
|  | 5286 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5287 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5288 | 0 \ | 
|  | 5289 | -c "Handshake was completed" \ | 
|  | 5290 |  | 
|  | 5291 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5293 | run_test    "DER format: with 8 trailing random bytes" \ | 
|  | 5294 | "$P_SRV crt_file=data_files/server5-der8.crt \ | 
|  | 5295 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5296 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5297 | 0 \ | 
|  | 5298 | -c "Handshake was completed" \ | 
|  | 5299 |  | 
|  | 5300 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5302 | run_test    "DER format: with 9 trailing random bytes" \ | 
|  | 5303 | "$P_SRV crt_file=data_files/server5-der9.crt \ | 
|  | 5304 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5305 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5306 | 0 \ | 
|  | 5307 | -c "Handshake was completed" \ | 
|  | 5308 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5309 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication | 
|  | 5310 | # When updating these tests, modify the matching authentication tests accordingly | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5311 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5312 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5313 | run_test    "Authentication: server badcert, client required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5314 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 5315 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5316 | "$P_CLI debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5317 | 1 \ | 
|  | 5318 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5319 | -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] | 5320 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5321 | -c "X509 - Certificate verification failed" | 
|  | 5322 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5323 | run_test    "Authentication: server badcert, client optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5324 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 5325 | key_file=data_files/server5.key" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5326 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5327 | 0 \ | 
|  | 5328 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5329 | -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] | 5330 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5331 | -C "X509 - Certificate verification failed" | 
|  | 5332 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5333 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5334 | run_test    "Authentication: server goodcert, client optional, no trusted CA" \ | 
|  | 5335 | "$P_SRV" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5336 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5337 | 0 \ | 
|  | 5338 | -c "x509_verify_cert() returned" \ | 
|  | 5339 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5340 | -c "! Certificate verification flags"\ | 
|  | 5341 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 5342 | -C "X509 - Certificate verification failed" \ | 
|  | 5343 | -C "SSL - No CA Chain is set, but required to operate" | 
|  | 5344 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5345 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5346 | run_test    "Authentication: server goodcert, client required, no trusted CA" \ | 
|  | 5347 | "$P_SRV" \ | 
|  | 5348 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ | 
|  | 5349 | 1 \ | 
|  | 5350 | -c "x509_verify_cert() returned" \ | 
|  | 5351 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5352 | -c "! Certificate verification flags"\ | 
|  | 5353 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 5354 | -c "SSL - No CA Chain is set, but required to operate" | 
|  | 5355 |  | 
|  | 5356 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 5357 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 5358 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 5359 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 5360 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 5361 | # different means to have the server ignoring the client's supported curve list. | 
|  | 5362 |  | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5363 | run_test    "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 5364 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 5365 | crt_file=data_files/server5.ku-ka.crt" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5366 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required curves=secp521r1" \ | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5367 | 1 \ | 
|  | 5368 | -c "bad certificate (EC key curve)"\ | 
|  | 5369 | -c "! Certificate verification flags"\ | 
|  | 5370 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 5371 |  | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5372 | run_test    "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 5373 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 5374 | crt_file=data_files/server5.ku-ka.crt" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5375 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional curves=secp521r1" \ | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5376 | 1 \ | 
|  | 5377 | -c "bad certificate (EC key curve)"\ | 
|  | 5378 | -c "! Certificate verification flags"\ | 
|  | 5379 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 5380 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5381 | run_test    "Authentication: server badcert, client none" \ | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5382 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5383 | key_file=data_files/server5.key" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5384 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5385 | 0 \ | 
|  | 5386 | -C "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5387 | -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] | 5388 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5389 | -C "X509 - Certificate verification failed" | 
|  | 5390 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5391 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5392 | run_test    "Authentication: client SHA256, server required" \ | 
|  | 5393 | "$P_SRV auth_mode=required" \ | 
|  | 5394 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 5395 | key_file=data_files/server6.key \ | 
|  | 5396 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 5397 | 0 \ | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5398 | -c "Supported Signature Algorithm found: 04 " \ | 
|  | 5399 | -c "Supported Signature Algorithm found: 05 " | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5400 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5401 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5402 | run_test    "Authentication: client SHA384, server required" \ | 
|  | 5403 | "$P_SRV auth_mode=required" \ | 
|  | 5404 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 5405 | key_file=data_files/server6.key \ | 
|  | 5406 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 5407 | 0 \ | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5408 | -c "Supported Signature Algorithm found: 04 " \ | 
|  | 5409 | -c "Supported Signature Algorithm found: 05 " | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5410 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5411 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5412 | run_test    "Authentication: client has no cert, server required (TLS)" \ | 
|  | 5413 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 5414 | "$P_CLI debug_level=3 crt_file=none \ | 
|  | 5415 | key_file=data_files/server5.key" \ | 
|  | 5416 | 1 \ | 
|  | 5417 | -S "skip write certificate request" \ | 
|  | 5418 | -C "skip parse certificate request" \ | 
|  | 5419 | -c "got a certificate request" \ | 
|  | 5420 | -c "= write certificate$" \ | 
|  | 5421 | -C "skip write certificate$" \ | 
|  | 5422 | -S "x509_verify_cert() returned" \ | 
| Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5423 | -s "peer has no certificate" \ | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5424 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5425 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 5426 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5427 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5428 | run_test    "Authentication: client badcert, server required" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5429 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 5430 | "$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] | 5431 | key_file=data_files/server5.key" \ | 
|  | 5432 | 1 \ | 
|  | 5433 | -S "skip write certificate request" \ | 
|  | 5434 | -C "skip parse certificate request" \ | 
|  | 5435 | -c "got a certificate request" \ | 
|  | 5436 | -C "skip write certificate" \ | 
|  | 5437 | -C "skip write certificate verify" \ | 
|  | 5438 | -S "skip parse certificate verify" \ | 
|  | 5439 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5440 | -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] | 5441 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5442 | -s "send alert level=2 message=48" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5443 | -s "X509 - Certificate verification failed" | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5444 | # We don't check that the client receives the alert because it might | 
|  | 5445 | # detect that its write end of the connection is closed and abort | 
|  | 5446 | # before reading the alert message. | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5447 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5448 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5449 | run_test    "Authentication: client cert self-signed and trusted, server required" \ | 
|  | 5450 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ | 
|  | 5451 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 5452 | key_file=data_files/server5.key" \ | 
|  | 5453 | 0 \ | 
|  | 5454 | -S "skip write certificate request" \ | 
|  | 5455 | -C "skip parse certificate request" \ | 
|  | 5456 | -c "got a certificate request" \ | 
|  | 5457 | -C "skip write certificate" \ | 
|  | 5458 | -C "skip write certificate verify" \ | 
|  | 5459 | -S "skip parse certificate verify" \ | 
|  | 5460 | -S "x509_verify_cert() returned" \ | 
|  | 5461 | -S "! The certificate is not correctly signed" \ | 
|  | 5462 | -S "X509 - Certificate verification failed" | 
|  | 5463 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5464 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5465 | run_test    "Authentication: client cert not trusted, server required" \ | 
|  | 5466 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 5467 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 5468 | key_file=data_files/server5.key" \ | 
|  | 5469 | 1 \ | 
|  | 5470 | -S "skip write certificate request" \ | 
|  | 5471 | -C "skip parse certificate request" \ | 
|  | 5472 | -c "got a certificate request" \ | 
|  | 5473 | -C "skip write certificate" \ | 
|  | 5474 | -C "skip write certificate verify" \ | 
|  | 5475 | -S "skip parse certificate verify" \ | 
|  | 5476 | -s "x509_verify_cert() returned" \ | 
|  | 5477 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5478 | -s "! mbedtls_ssl_handshake returned" \ | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5479 | -s "X509 - Certificate verification failed" | 
|  | 5480 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5481 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5482 | run_test    "Authentication: client badcert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5483 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 5484 | "$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] | 5485 | key_file=data_files/server5.key" \ | 
|  | 5486 | 0 \ | 
|  | 5487 | -S "skip write certificate request" \ | 
|  | 5488 | -C "skip parse certificate request" \ | 
|  | 5489 | -c "got a certificate request" \ | 
|  | 5490 | -C "skip write certificate" \ | 
|  | 5491 | -C "skip write certificate verify" \ | 
|  | 5492 | -S "skip parse certificate verify" \ | 
|  | 5493 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5494 | -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] | 5495 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 5496 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5497 | -S "X509 - Certificate verification failed" | 
|  | 5498 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5499 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5500 | run_test    "Authentication: client badcert, server none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5501 | "$P_SRV debug_level=3 auth_mode=none" \ | 
|  | 5502 | "$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] | 5503 | key_file=data_files/server5.key" \ | 
|  | 5504 | 0 \ | 
|  | 5505 | -s "skip write certificate request" \ | 
|  | 5506 | -C "skip parse certificate request" \ | 
|  | 5507 | -c "got no certificate request" \ | 
|  | 5508 | -c "skip write certificate" \ | 
|  | 5509 | -c "skip write certificate verify" \ | 
|  | 5510 | -s "skip parse certificate verify" \ | 
|  | 5511 | -S "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5512 | -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] | 5513 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 5514 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5515 | -S "X509 - Certificate verification failed" | 
|  | 5516 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5517 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5518 | run_test    "Authentication: client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5519 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 5520 | "$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] | 5521 | 0 \ | 
|  | 5522 | -S "skip write certificate request" \ | 
|  | 5523 | -C "skip parse certificate request" \ | 
|  | 5524 | -c "got a certificate request" \ | 
|  | 5525 | -C "skip write certificate$" \ | 
|  | 5526 | -C "got no certificate to send" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5527 | -c "skip write certificate verify" \ | 
|  | 5528 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5529 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5530 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 5531 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5532 | -S "X509 - Certificate verification failed" | 
|  | 5533 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 5534 | requires_openssl_tls1_3 | 
|  | 5535 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5536 | run_test    "Authentication: openssl client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5537 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 5538 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5539 | 0 \ | 
|  | 5540 | -S "skip write certificate request" \ | 
|  | 5541 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5542 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5543 | -S "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5544 | -S "X509 - Certificate verification failed" | 
|  | 5545 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5547 | run_test    "Authentication: client no cert, openssl server optional" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5548 | "$O_SRV -verify 10 -tls1_2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5549 | "$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] | 5550 | 0 \ | 
|  | 5551 | -C "skip parse certificate request" \ | 
|  | 5552 | -c "got a certificate request" \ | 
|  | 5553 | -C "skip write certificate$" \ | 
|  | 5554 | -c "skip write certificate verify" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5555 | -C "! mbedtls_ssl_handshake returned" | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5556 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5558 | run_test    "Authentication: client no cert, openssl server required" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5559 | "$O_SRV -Verify 10 -tls1_2" \ | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5560 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
|  | 5561 | 1 \ | 
|  | 5562 | -C "skip parse certificate request" \ | 
|  | 5563 | -c "got a certificate request" \ | 
|  | 5564 | -C "skip write certificate$" \ | 
|  | 5565 | -c "skip write certificate verify" \ | 
|  | 5566 | -c "! mbedtls_ssl_handshake returned" | 
|  | 5567 |  | 
| Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5568 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default | 
|  | 5569 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the | 
|  | 5570 | # library is configured with a different value. | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5571 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5572 | MAX_IM_CA='8' | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5573 |  | 
| Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5574 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA | 
|  | 5575 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 | 
|  | 5576 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions | 
|  | 5577 | # 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] | 5578 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5579 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5580 | run_test    "Authentication: server max_int chain, client default" \ | 
|  | 5581 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 5582 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 5583 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 5584 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5585 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5586 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5587 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5588 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5589 | run_test    "Authentication: server max_int+1 chain, client default" \ | 
|  | 5590 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5591 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 5592 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 5593 | 1 \ | 
| 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 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5598 | run_test    "Authentication: server max_int+1 chain, client optional" \ | 
|  | 5599 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5600 | key_file=data_files/dir-maxpath/10.key" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5601 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5602 | auth_mode=optional" \ | 
|  | 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 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5608 | run_test    "Authentication: server max_int+1 chain, client none" \ | 
|  | 5609 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5610 | key_file=data_files/dir-maxpath/10.key" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5611 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5612 | auth_mode=none" \ | 
|  | 5613 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5614 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5615 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5616 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5617 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5618 | run_test    "Authentication: client max_int+1 chain, server default" \ | 
|  | 5619 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 5620 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5621 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 5622 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5623 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5624 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5625 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5626 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5627 | run_test    "Authentication: client max_int+1 chain, server optional" \ | 
|  | 5628 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 5629 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5630 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 5631 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5632 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5633 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5634 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5635 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5636 | run_test    "Authentication: client max_int+1 chain, server required" \ | 
|  | 5637 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 5638 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5639 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 5640 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5641 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5642 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5643 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5644 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5645 | run_test    "Authentication: client max_int chain, server required" \ | 
|  | 5646 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 5647 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 5648 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 5649 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5650 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5651 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5652 | # Tests for CA list in CertificateRequest messages | 
|  | 5653 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5654 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5655 | run_test    "Authentication: send CA list in CertificateRequest  (default)" \ | 
|  | 5656 | "$P_SRV debug_level=3 auth_mode=required" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5657 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5658 | key_file=data_files/server6.key" \ | 
|  | 5659 | 0 \ | 
|  | 5660 | -s "requested DN" | 
|  | 5661 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5662 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5663 | run_test    "Authentication: do not send CA list in CertificateRequest" \ | 
|  | 5664 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5665 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5666 | key_file=data_files/server6.key" \ | 
|  | 5667 | 0 \ | 
|  | 5668 | -S "requested DN" | 
|  | 5669 |  | 
|  | 5670 | run_test    "Authentication: send CA list in CertificateRequest, client self signed" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5671 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5672 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 5673 | key_file=data_files/server5.key" \ | 
|  | 5674 | 1 \ | 
|  | 5675 | -S "requested DN" \ | 
|  | 5676 | -s "x509_verify_cert() returned" \ | 
|  | 5677 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5678 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 5679 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 5680 | -s "X509 - Certificate verification failed" | 
|  | 5681 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5682 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5683 | run_test    "Authentication: send alt conf DN hints in CertificateRequest" \ | 
|  | 5684 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ | 
|  | 5685 | crt_file2=data_files/server1.crt \ | 
|  | 5686 | key_file2=data_files/server1.key" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5687 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ | 
| Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5688 | crt_file=data_files/server6.crt \ | 
|  | 5689 | key_file=data_files/server6.key" \ | 
|  | 5690 | 0 \ | 
|  | 5691 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" | 
|  | 5692 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5693 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5694 | run_test    "Authentication: send alt conf DN hints in CertificateRequest (2)" \ | 
|  | 5695 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ | 
|  | 5696 | crt_file2=data_files/server2.crt \ | 
|  | 5697 | key_file2=data_files/server2.key" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5698 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ | 
| Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5699 | crt_file=data_files/server6.crt \ | 
|  | 5700 | key_file=data_files/server6.key" \ | 
|  | 5701 | 0 \ | 
|  | 5702 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" | 
|  | 5703 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5704 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5705 | run_test    "Authentication: send alt hs DN hints in CertificateRequest" \ | 
|  | 5706 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ | 
|  | 5707 | crt_file2=data_files/server1.crt \ | 
|  | 5708 | key_file2=data_files/server1.key" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5709 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ | 
| Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5710 | crt_file=data_files/server6.crt \ | 
|  | 5711 | key_file=data_files/server6.key" \ | 
|  | 5712 | 0 \ | 
|  | 5713 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" | 
|  | 5714 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5715 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests | 
|  | 5716 | # When updating these tests, modify the matching authentication tests accordingly | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5717 |  | 
|  | 5718 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5719 | run_test    "Authentication, CA callback: server badcert, client required" \ | 
|  | 5720 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 5721 | key_file=data_files/server5.key" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5722 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5723 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5724 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5725 | -c "x509_verify_cert() returned" \ | 
|  | 5726 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5727 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 5728 | -c "X509 - Certificate verification failed" | 
|  | 5729 |  | 
|  | 5730 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5731 | run_test    "Authentication, CA callback: server badcert, client optional" \ | 
|  | 5732 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 5733 | key_file=data_files/server5.key" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5734 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5735 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5736 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5737 | -c "x509_verify_cert() returned" \ | 
|  | 5738 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5739 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 5740 | -C "X509 - Certificate verification failed" | 
|  | 5741 |  | 
|  | 5742 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 5743 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 5744 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 5745 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 5746 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 5747 | # different means to have the server ignoring the client's supported curve list. | 
|  | 5748 |  | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5749 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5750 | run_test    "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 5751 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 5752 | crt_file=data_files/server5.ku-ka.crt" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5753 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5754 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5755 | -c "use CA callback for X.509 CRT verification" \ | 
|  | 5756 | -c "bad certificate (EC key curve)" \ | 
|  | 5757 | -c "! Certificate verification flags" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5758 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 5759 |  | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5760 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5761 | run_test    "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
| Valerio Setti | a9aafd4 | 2023-04-11 12:30:45 +0200 | [diff] [blame] | 5762 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5763 | crt_file=data_files/server5.ku-ka.crt" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5764 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5765 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5766 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5767 | -c "bad certificate (EC key curve)"\ | 
|  | 5768 | -c "! Certificate verification flags"\ | 
|  | 5769 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 5770 |  | 
|  | 5771 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5772 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5773 | run_test    "Authentication, CA callback: client SHA256, server required" \ | 
|  | 5774 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 5775 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 5776 | key_file=data_files/server6.key \ | 
|  | 5777 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 5778 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5779 | -s "use CA callback for X.509 CRT verification" \ | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5780 | -c "Supported Signature Algorithm found: 04 " \ | 
|  | 5781 | -c "Supported Signature Algorithm found: 05 " | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5782 |  | 
|  | 5783 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5784 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5785 | run_test    "Authentication, CA callback: client SHA384, server required" \ | 
|  | 5786 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 5787 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 5788 | key_file=data_files/server6.key \ | 
|  | 5789 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 5790 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5791 | -s "use CA callback for X.509 CRT verification" \ | 
| Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5792 | -c "Supported Signature Algorithm found: 04 " \ | 
|  | 5793 | -c "Supported Signature Algorithm found: 05 " | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5794 |  | 
|  | 5795 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5796 | run_test    "Authentication, CA callback: client badcert, server required" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5797 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5798 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 5799 | key_file=data_files/server5.key" \ | 
|  | 5800 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5801 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5802 | -S "skip write certificate request" \ | 
|  | 5803 | -C "skip parse certificate request" \ | 
|  | 5804 | -c "got a certificate request" \ | 
|  | 5805 | -C "skip write certificate" \ | 
|  | 5806 | -C "skip write certificate verify" \ | 
|  | 5807 | -S "skip parse certificate verify" \ | 
|  | 5808 | -s "x509_verify_cert() returned" \ | 
|  | 5809 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5810 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 5811 | -s "send alert level=2 message=48" \ | 
|  | 5812 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 5813 | -s "X509 - Certificate verification failed" | 
|  | 5814 | # We don't check that the client receives the alert because it might | 
|  | 5815 | # detect that its write end of the connection is closed and abort | 
|  | 5816 | # before reading the alert message. | 
|  | 5817 |  | 
|  | 5818 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5819 | run_test    "Authentication, CA callback: client cert not trusted, server required" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5820 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5821 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 5822 | key_file=data_files/server5.key" \ | 
|  | 5823 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5824 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5825 | -S "skip write certificate request" \ | 
|  | 5826 | -C "skip parse certificate request" \ | 
|  | 5827 | -c "got a certificate request" \ | 
|  | 5828 | -C "skip write certificate" \ | 
|  | 5829 | -C "skip write certificate verify" \ | 
|  | 5830 | -S "skip parse certificate verify" \ | 
|  | 5831 | -s "x509_verify_cert() returned" \ | 
|  | 5832 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5833 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 5834 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 5835 | -s "X509 - Certificate verification failed" | 
|  | 5836 |  | 
|  | 5837 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5838 | run_test    "Authentication, CA callback: client badcert, server optional" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5839 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5840 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 5841 | key_file=data_files/server5.key" \ | 
|  | 5842 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5843 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5844 | -S "skip write certificate request" \ | 
|  | 5845 | -C "skip parse certificate request" \ | 
|  | 5846 | -c "got a certificate request" \ | 
|  | 5847 | -C "skip write certificate" \ | 
|  | 5848 | -C "skip write certificate verify" \ | 
|  | 5849 | -S "skip parse certificate verify" \ | 
|  | 5850 | -s "x509_verify_cert() returned" \ | 
|  | 5851 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5852 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 5853 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 5854 | -S "X509 - Certificate verification failed" | 
|  | 5855 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5856 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5857 | requires_full_size_output_buffer | 
|  | 5858 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5859 | run_test    "Authentication, CA callback: server max_int chain, client default" \ | 
|  | 5860 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 5861 | key_file=data_files/dir-maxpath/09.key" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5862 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5863 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5864 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5865 | -C "X509 - A fatal error occurred" | 
|  | 5866 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5867 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5868 | requires_full_size_output_buffer | 
|  | 5869 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5870 | run_test    "Authentication, CA callback: server max_int+1 chain, client default" \ | 
|  | 5871 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5872 | key_file=data_files/dir-maxpath/10.key" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5873 | "$P_CLI force_version=tls12 debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5874 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5875 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5876 | -c "X509 - A fatal error occurred" | 
|  | 5877 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5878 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5879 | requires_full_size_output_buffer | 
|  | 5880 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5881 | run_test    "Authentication, CA callback: server max_int+1 chain, client optional" \ | 
|  | 5882 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5883 | key_file=data_files/dir-maxpath/10.key" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5884 | "$P_CLI force_version=tls12 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5885 | debug_level=3 auth_mode=optional" \ | 
|  | 5886 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5887 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5888 | -c "X509 - A fatal error occurred" | 
|  | 5889 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5890 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5891 | requires_full_size_output_buffer | 
|  | 5892 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5893 | run_test    "Authentication, CA callback: client max_int+1 chain, server optional" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5894 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5895 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5896 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 5897 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5898 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5899 | -s "X509 - A fatal error occurred" | 
|  | 5900 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5901 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5902 | requires_full_size_output_buffer | 
|  | 5903 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 5904 | run_test    "Authentication, CA callback: client max_int+1 chain, server required" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5905 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5906 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 5907 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 5908 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5909 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5910 | -s "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 | 
|  | 5915 | run_test    "Authentication, CA callback: client max_int chain, server required" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5916 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5917 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 5918 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 5919 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5920 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5921 | -S "X509 - A fatal error occurred" | 
|  | 5922 |  | 
| Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5923 | # Tests for certificate selection based on SHA version | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5924 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5925 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5926 | run_test    "Certificate hash: client TLS 1.2 -> SHA-2" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5927 | "$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] | 5928 | key_file=data_files/server5.key \ | 
|  | 5929 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 5930 | key_file2=data_files/server5.key" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5931 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5932 | 0 \ | 
|  | 5933 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 5934 | -C "signed using.*ECDSA with SHA1" | 
|  | 5935 |  | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5936 | # tests for SNI | 
|  | 5937 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5938 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5939 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5940 | run_test    "SNI: no SNI callback" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5941 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5942 | 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] | 5943 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5944 | 0 \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5945 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 5946 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5947 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5948 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5949 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5950 | run_test    "SNI: matching cert 1" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5951 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5952 | 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] | 5953 | 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] | 5954 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5955 | 0 \ | 
|  | 5956 | -s "parse ServerName extension" \ | 
|  | 5957 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 5958 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5959 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5960 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5961 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5962 | run_test    "SNI: matching cert 2" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5963 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5964 | 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] | 5965 | 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] | 5966 | "$P_CLI server_name=polarssl.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5967 | 0 \ | 
|  | 5968 | -s "parse ServerName extension" \ | 
|  | 5969 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 5970 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5971 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5972 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5973 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5974 | run_test    "SNI: no matching cert" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5975 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5976 | 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] | 5977 | 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] | 5978 | "$P_CLI server_name=nonesuch.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5979 | 1 \ | 
|  | 5980 | -s "parse ServerName extension" \ | 
|  | 5981 | -s "ssl_sni_wrapper() returned" \ | 
|  | 5982 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 5983 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 5984 | -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] | 5985 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5986 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5987 | run_test    "SNI: client auth no override: optional" \ | 
|  | 5988 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 5989 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5990 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 5991 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5992 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5993 | -S "skip write certificate request" \ | 
|  | 5994 | -C "skip parse certificate request" \ | 
|  | 5995 | -c "got a certificate request" \ | 
|  | 5996 | -C "skip write certificate" \ | 
|  | 5997 | -C "skip write certificate verify" \ | 
|  | 5998 | -S "skip parse certificate verify" | 
|  | 5999 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6000 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6001 | run_test    "SNI: client auth override: none -> optional" \ | 
|  | 6002 | "$P_SRV debug_level=3 auth_mode=none \ | 
|  | 6003 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6004 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 6005 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6006 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6007 | -S "skip write certificate request" \ | 
|  | 6008 | -C "skip parse certificate request" \ | 
|  | 6009 | -c "got a certificate request" \ | 
|  | 6010 | -C "skip write certificate" \ | 
|  | 6011 | -C "skip write certificate verify" \ | 
|  | 6012 | -S "skip parse certificate verify" | 
|  | 6013 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6014 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6015 | run_test    "SNI: client auth override: optional -> none" \ | 
|  | 6016 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 6017 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6018 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 6019 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6020 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6021 | -s "skip write certificate request" \ | 
|  | 6022 | -C "skip parse certificate request" \ | 
|  | 6023 | -c "got no certificate request" \ | 
| XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6024 | -c "skip write certificate" | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6025 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6026 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6027 | run_test    "SNI: CA no override" \ | 
|  | 6028 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 6029 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6030 | ca_file=data_files/test-ca.crt \ | 
|  | 6031 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 6032 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 6033 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 6034 | 1 \ | 
|  | 6035 | -S "skip write certificate request" \ | 
|  | 6036 | -C "skip parse certificate request" \ | 
|  | 6037 | -c "got a certificate request" \ | 
|  | 6038 | -C "skip write certificate" \ | 
|  | 6039 | -C "skip write certificate verify" \ | 
|  | 6040 | -S "skip parse certificate verify" \ | 
|  | 6041 | -s "x509_verify_cert() returned" \ | 
|  | 6042 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6043 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 6044 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6045 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6046 | run_test    "SNI: CA override" \ | 
|  | 6047 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 6048 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6049 | ca_file=data_files/test-ca.crt \ | 
|  | 6050 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 6051 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 6052 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 6053 | 0 \ | 
|  | 6054 | -S "skip write certificate request" \ | 
|  | 6055 | -C "skip parse certificate request" \ | 
|  | 6056 | -c "got a certificate request" \ | 
|  | 6057 | -C "skip write certificate" \ | 
|  | 6058 | -C "skip write certificate verify" \ | 
|  | 6059 | -S "skip parse certificate verify" \ | 
|  | 6060 | -S "x509_verify_cert() returned" \ | 
|  | 6061 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6062 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 6063 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6064 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6065 | run_test    "SNI: CA override with CRL" \ | 
|  | 6066 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 6067 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6068 | ca_file=data_files/test-ca.crt \ | 
|  | 6069 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 6070 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 6071 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 6072 | 1 \ | 
|  | 6073 | -S "skip write certificate request" \ | 
|  | 6074 | -C "skip parse certificate request" \ | 
|  | 6075 | -c "got a certificate request" \ | 
|  | 6076 | -C "skip write certificate" \ | 
|  | 6077 | -C "skip write certificate verify" \ | 
|  | 6078 | -S "skip parse certificate verify" \ | 
|  | 6079 | -s "x509_verify_cert() returned" \ | 
|  | 6080 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6081 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 6082 |  | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6083 | # Tests for SNI and DTLS | 
|  | 6084 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6085 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6087 | run_test    "SNI: DTLS, no SNI callback" \ | 
|  | 6088 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 6089 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 6090 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 6091 | 0 \ | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6092 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 6093 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 6094 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6095 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6097 | run_test    "SNI: DTLS, matching cert 1" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6098 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 6099 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6100 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 6101 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 6102 | 0 \ | 
|  | 6103 | -s "parse ServerName extension" \ | 
|  | 6104 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 6105 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 6106 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6107 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6109 | run_test    "SNI: DTLS, matching cert 2" \ | 
|  | 6110 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 6111 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6112 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 6113 | "$P_CLI server_name=polarssl.example dtls=1" \ | 
|  | 6114 | 0 \ | 
|  | 6115 | -s "parse ServerName extension" \ | 
|  | 6116 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 6117 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 6118 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6120 | run_test    "SNI: DTLS, no matching cert" \ | 
|  | 6121 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 6122 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6123 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 6124 | "$P_CLI server_name=nonesuch.example dtls=1" \ | 
|  | 6125 | 1 \ | 
|  | 6126 | -s "parse ServerName extension" \ | 
|  | 6127 | -s "ssl_sni_wrapper() returned" \ | 
|  | 6128 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 6129 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 6130 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 6131 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6133 | run_test    "SNI: DTLS, client auth no override: optional" \ | 
|  | 6134 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 6135 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6136 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 6137 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 6138 | 0 \ | 
|  | 6139 | -S "skip write certificate request" \ | 
|  | 6140 | -C "skip parse certificate request" \ | 
|  | 6141 | -c "got a certificate request" \ | 
|  | 6142 | -C "skip write certificate" \ | 
|  | 6143 | -C "skip write certificate verify" \ | 
|  | 6144 | -S "skip parse certificate verify" | 
|  | 6145 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6147 | run_test    "SNI: DTLS, client auth override: none -> optional" \ | 
|  | 6148 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ | 
|  | 6149 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6150 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 6151 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 6152 | 0 \ | 
|  | 6153 | -S "skip write certificate request" \ | 
|  | 6154 | -C "skip parse certificate request" \ | 
|  | 6155 | -c "got a certificate request" \ | 
|  | 6156 | -C "skip write certificate" \ | 
|  | 6157 | -C "skip write certificate verify" \ | 
|  | 6158 | -S "skip parse certificate verify" | 
|  | 6159 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6161 | run_test    "SNI: DTLS, client auth override: optional -> none" \ | 
|  | 6162 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 6163 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6164 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 6165 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 6166 | 0 \ | 
|  | 6167 | -s "skip write certificate request" \ | 
|  | 6168 | -C "skip parse certificate request" \ | 
|  | 6169 | -c "got no certificate request" \ | 
|  | 6170 | -c "skip write certificate" \ | 
|  | 6171 | -c "skip write certificate verify" \ | 
|  | 6172 | -s "skip parse certificate verify" | 
|  | 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, CA no override" \ | 
|  | 6176 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 6177 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6178 | ca_file=data_files/test-ca.crt \ | 
|  | 6179 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 6180 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 6181 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 6182 | 1 \ | 
|  | 6183 | -S "skip write certificate request" \ | 
|  | 6184 | -C "skip parse certificate request" \ | 
|  | 6185 | -c "got a certificate request" \ | 
|  | 6186 | -C "skip write certificate" \ | 
|  | 6187 | -C "skip write certificate verify" \ | 
|  | 6188 | -S "skip parse certificate verify" \ | 
|  | 6189 | -s "x509_verify_cert() returned" \ | 
|  | 6190 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6191 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 6192 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6194 | run_test    "SNI: DTLS, CA override" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6195 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 6196 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6197 | ca_file=data_files/test-ca.crt \ | 
|  | 6198 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 6199 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 6200 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 6201 | 0 \ | 
|  | 6202 | -S "skip write certificate request" \ | 
|  | 6203 | -C "skip parse certificate request" \ | 
|  | 6204 | -c "got a certificate request" \ | 
|  | 6205 | -C "skip write certificate" \ | 
|  | 6206 | -C "skip write certificate verify" \ | 
|  | 6207 | -S "skip parse certificate verify" \ | 
|  | 6208 | -S "x509_verify_cert() returned" \ | 
|  | 6209 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6210 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 6211 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6213 | run_test    "SNI: DTLS, CA override with CRL" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6214 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 6215 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ | 
|  | 6216 | ca_file=data_files/test-ca.crt \ | 
|  | 6217 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 6218 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 6219 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 6220 | 1 \ | 
|  | 6221 | -S "skip write certificate request" \ | 
|  | 6222 | -C "skip parse certificate request" \ | 
|  | 6223 | -c "got a certificate request" \ | 
|  | 6224 | -C "skip write certificate" \ | 
|  | 6225 | -C "skip write certificate verify" \ | 
|  | 6226 | -S "skip parse certificate verify" \ | 
|  | 6227 | -s "x509_verify_cert() returned" \ | 
|  | 6228 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6229 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 6230 |  | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6231 | # Tests for non-blocking I/O: exercise a variety of handshake flows | 
|  | 6232 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6233 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6234 | run_test    "Non-blocking I/O: basic handshake" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6235 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 6236 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 6237 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6238 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6239 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6240 | -c "Read from server: .* bytes read" | 
|  | 6241 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6242 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6243 | run_test    "Non-blocking I/O: client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6244 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ | 
|  | 6245 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 6246 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6247 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6248 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6249 | -c "Read from server: .* bytes read" | 
|  | 6250 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6251 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6252 | run_test    "Non-blocking I/O: ticket" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6253 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 6254 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 6255 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6256 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6257 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6258 | -c "Read from server: .* bytes read" | 
|  | 6259 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6260 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6261 | run_test    "Non-blocking I/O: ticket + client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6262 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 6263 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 6264 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6265 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6266 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6267 | -c "Read from server: .* bytes read" | 
|  | 6268 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6269 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6270 | run_test    "Non-blocking I/O: TLS 1.2 + ticket + client auth + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6271 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6272 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6273 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6274 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6275 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6276 | -c "Read from server: .* bytes read" | 
|  | 6277 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 6279 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
|  | 6280 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
|  | 6281 | run_test    "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ | 
|  | 6282 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6283 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6284 | 0 \ | 
|  | 6285 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6286 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6287 | -c "Read from server: .* bytes read" | 
|  | 6288 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6289 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6290 | run_test    "Non-blocking I/O: TLS 1.2 + ticket + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6291 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6292 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ | 
|  | 6293 | 0 \ | 
|  | 6294 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6295 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6296 | -c "Read from server: .* bytes read" | 
|  | 6297 |  | 
|  | 6298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 6299 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
|  | 6300 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
|  | 6301 | run_test    "Non-blocking I/O: TLS 1.3 + ticket + resume" \ | 
|  | 6302 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6303 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6304 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6305 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6306 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6307 | -c "Read from server: .* bytes read" | 
|  | 6308 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6309 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6310 | run_test    "Non-blocking I/O: session-id resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6311 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6312 | "$P_CLI force_version=tls12 nbio=2 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6313 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6314 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6315 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6316 | -c "Read from server: .* bytes read" | 
|  | 6317 |  | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6318 | # Tests for event-driven I/O: exercise a variety of handshake flows | 
|  | 6319 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6320 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6321 | run_test    "Event-driven I/O: basic handshake" \ | 
|  | 6322 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 6323 | "$P_CLI event=1 tickets=0" \ | 
|  | 6324 | 0 \ | 
|  | 6325 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6326 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6327 | -c "Read from server: .* bytes read" | 
|  | 6328 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6329 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6330 | run_test    "Event-driven I/O: client auth" \ | 
|  | 6331 | "$P_SRV event=1 tickets=0 auth_mode=required" \ | 
|  | 6332 | "$P_CLI event=1 tickets=0" \ | 
|  | 6333 | 0 \ | 
|  | 6334 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6335 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6336 | -c "Read from server: .* bytes read" | 
|  | 6337 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6338 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6339 | run_test    "Event-driven I/O: ticket" \ | 
|  | 6340 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 6341 | "$P_CLI event=1 tickets=1" \ | 
|  | 6342 | 0 \ | 
|  | 6343 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6344 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6345 | -c "Read from server: .* bytes read" | 
|  | 6346 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6347 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6348 | run_test    "Event-driven I/O: ticket + client auth" \ | 
|  | 6349 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 6350 | "$P_CLI event=1 tickets=1" \ | 
|  | 6351 | 0 \ | 
|  | 6352 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6353 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6354 | -c "Read from server: .* bytes read" | 
|  | 6355 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6356 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6357 | run_test    "Event-driven I/O: TLS 1.2 + ticket + client auth + resume" \ | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6358 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6359 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6360 | 0 \ | 
|  | 6361 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6362 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6363 | -c "Read from server: .* bytes read" | 
|  | 6364 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 6366 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
|  | 6367 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
|  | 6368 | run_test    "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ | 
|  | 6369 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6370 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6371 | 0 \ | 
|  | 6372 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6373 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6374 | -c "Read from server: .* bytes read" | 
|  | 6375 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6376 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6377 | run_test    "Event-driven I/O: TLS 1.2 + ticket + resume" \ | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6378 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6379 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ | 
|  | 6380 | 0 \ | 
|  | 6381 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6382 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6383 | -c "Read from server: .* bytes read" | 
|  | 6384 |  | 
|  | 6385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 6386 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
|  | 6387 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
|  | 6388 | run_test    "Event-driven I/O: TLS 1.3 + ticket + resume" \ | 
|  | 6389 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6390 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6391 | 0 \ | 
|  | 6392 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6393 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6394 | -c "Read from server: .* bytes read" | 
|  | 6395 |  | 
| Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6396 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6397 | run_test    "Event-driven I/O: session-id resume" \ | 
|  | 6398 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6399 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6400 | 0 \ | 
|  | 6401 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6402 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 6403 | -c "Read from server: .* bytes read" | 
|  | 6404 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6406 | run_test    "Event-driven I/O, DTLS: basic handshake" \ | 
|  | 6407 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 6408 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 6409 | 0 \ | 
|  | 6410 | -c "Read from server: .* bytes read" | 
|  | 6411 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6413 | run_test    "Event-driven I/O, DTLS: client auth" \ | 
|  | 6414 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 6415 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 6416 | 0 \ | 
|  | 6417 | -c "Read from server: .* bytes read" | 
|  | 6418 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6420 | run_test    "Event-driven I/O, DTLS: ticket" \ | 
|  | 6421 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 6422 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 6423 | 0 \ | 
|  | 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: ticket + client auth" \ | 
|  | 6428 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 6429 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 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: ticket + client auth + resume" \ | 
|  | 6435 | "$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] | 6436 | "$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] | 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 + resume" \ | 
|  | 6442 | "$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] | 6443 | "$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] | 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: session-id resume" \ | 
|  | 6449 | "$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] | 6450 | "$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] | 6451 | 0 \ | 
|  | 6452 | -c "Read from server: .* bytes read" | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6453 |  | 
|  | 6454 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. | 
|  | 6455 | # During session resumption, the client will send its ApplicationData record | 
|  | 6456 | # within the same datagram as the Finished messages. In this situation, the | 
|  | 6457 | # server MUST NOT idle on the underlying transport after handshake completion, | 
|  | 6458 | # because the ApplicationData request has already been queued internally. | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6460 | run_test    "Event-driven I/O, DTLS: session-id resume, UDP packing" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6461 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6462 | "$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] | 6463 | "$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] | 6464 | 0 \ | 
|  | 6465 | -c "Read from server: .* bytes read" | 
|  | 6466 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6467 | # Tests for version negotiation | 
|  | 6468 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6469 | run_test    "Version check: all -> 1.2" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6470 | "$P_SRV" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6471 | "$P_CLI force_version=tls12" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6472 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6473 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 6474 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6475 | -s "Protocol is TLSv1.2" \ | 
|  | 6476 | -c "Protocol is TLSv1.2" | 
|  | 6477 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6479 | run_test    "Not supported version check: cli TLS 1.0" \ | 
|  | 6480 | "$P_SRV" \ | 
|  | 6481 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ | 
|  | 6482 | 1 \ | 
|  | 6483 | -s "Handshake protocol not within min/max boundaries" \ | 
|  | 6484 | -c "Error in protocol version" \ | 
|  | 6485 | -S "Protocol is TLSv1.0" \ | 
|  | 6486 | -C "Handshake was completed" | 
|  | 6487 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6489 | run_test    "Not supported version check: cli TLS 1.1" \ | 
|  | 6490 | "$P_SRV" \ | 
|  | 6491 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ | 
|  | 6492 | 1 \ | 
|  | 6493 | -s "Handshake protocol not within min/max boundaries" \ | 
|  | 6494 | -c "Error in protocol version" \ | 
|  | 6495 | -S "Protocol is TLSv1.1" \ | 
|  | 6496 | -C "Handshake was completed" | 
|  | 6497 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6499 | run_test    "Not supported version check: srv max TLS 1.0" \ | 
|  | 6500 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ | 
|  | 6501 | "$P_CLI" \ | 
|  | 6502 | 1 \ | 
|  | 6503 | -s "Error in protocol version" \ | 
|  | 6504 | -c "Handshake protocol not within min/max boundaries" \ | 
|  | 6505 | -S "Version: TLS1.0" \ | 
|  | 6506 | -C "Protocol is TLSv1.0" | 
|  | 6507 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6509 | run_test    "Not supported version check: srv max TLS 1.1" \ | 
|  | 6510 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ | 
|  | 6511 | "$P_CLI" \ | 
|  | 6512 | 1 \ | 
|  | 6513 | -s "Error in protocol version" \ | 
|  | 6514 | -c "Handshake protocol not within min/max boundaries" \ | 
|  | 6515 | -S "Version: TLS1.1" \ | 
|  | 6516 | -C "Protocol is TLSv1.1" | 
|  | 6517 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6518 | # Tests for ALPN extension | 
|  | 6519 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6520 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6521 | run_test    "ALPN: none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6522 | "$P_SRV debug_level=3" \ | 
|  | 6523 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6524 | 0 \ | 
|  | 6525 | -C "client hello, adding alpn extension" \ | 
|  | 6526 | -S "found alpn extension" \ | 
|  | 6527 | -C "got an alert message, type: \\[2:120]" \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6528 | -S "server side, adding alpn extension" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6529 | -C "found alpn extension " \ | 
|  | 6530 | -C "Application Layer Protocol is" \ | 
|  | 6531 | -S "Application Layer Protocol is" | 
|  | 6532 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6533 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6534 | run_test    "ALPN: client only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6535 | "$P_SRV debug_level=3" \ | 
|  | 6536 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6537 | 0 \ | 
|  | 6538 | -c "client hello, adding alpn extension" \ | 
|  | 6539 | -s "found alpn extension" \ | 
|  | 6540 | -C "got an alert message, type: \\[2:120]" \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6541 | -S "server side, adding alpn extension" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6542 | -C "found alpn extension " \ | 
|  | 6543 | -c "Application Layer Protocol is (none)" \ | 
|  | 6544 | -S "Application Layer Protocol is" | 
|  | 6545 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6546 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6547 | run_test    "ALPN: server only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6548 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 6549 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6550 | 0 \ | 
|  | 6551 | -C "client hello, adding alpn extension" \ | 
|  | 6552 | -S "found alpn extension" \ | 
|  | 6553 | -C "got an alert message, type: \\[2:120]" \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6554 | -S "server side, adding alpn extension" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6555 | -C "found alpn extension " \ | 
|  | 6556 | -C "Application Layer Protocol is" \ | 
|  | 6557 | -s "Application Layer Protocol is (none)" | 
|  | 6558 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6559 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6560 | run_test    "ALPN: both, common cli1-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6561 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 6562 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6563 | 0 \ | 
|  | 6564 | -c "client hello, adding alpn extension" \ | 
|  | 6565 | -s "found alpn extension" \ | 
|  | 6566 | -C "got an alert message, type: \\[2:120]" \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6567 | -s "server side, adding alpn extension" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6568 | -c "found alpn extension" \ | 
|  | 6569 | -c "Application Layer Protocol is abc" \ | 
|  | 6570 | -s "Application Layer Protocol is abc" | 
|  | 6571 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6572 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6573 | run_test    "ALPN: both, common cli2-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6574 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 6575 | "$P_CLI debug_level=3 alpn=1234,abc" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6576 | 0 \ | 
|  | 6577 | -c "client hello, adding alpn extension" \ | 
|  | 6578 | -s "found alpn extension" \ | 
|  | 6579 | -C "got an alert message, type: \\[2:120]" \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6580 | -s "server side, adding alpn extension" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6581 | -c "found alpn extension" \ | 
|  | 6582 | -c "Application Layer Protocol is abc" \ | 
|  | 6583 | -s "Application Layer Protocol is abc" | 
|  | 6584 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6585 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6586 | run_test    "ALPN: both, common cli1-srv2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6587 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 6588 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6589 | 0 \ | 
|  | 6590 | -c "client hello, adding alpn extension" \ | 
|  | 6591 | -s "found alpn extension" \ | 
|  | 6592 | -C "got an alert message, type: \\[2:120]" \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6593 | -s "server side, adding alpn extension" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6594 | -c "found alpn extension" \ | 
|  | 6595 | -c "Application Layer Protocol is 1234" \ | 
|  | 6596 | -s "Application Layer Protocol is 1234" | 
|  | 6597 |  | 
| Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6598 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6599 | run_test    "ALPN: both, no common" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6600 | "$P_SRV debug_level=3 alpn=abc,123" \ | 
|  | 6601 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6602 | 1 \ | 
|  | 6603 | -c "client hello, adding alpn extension" \ | 
|  | 6604 | -s "found alpn extension" \ | 
|  | 6605 | -c "got an alert message, type: \\[2:120]" \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6606 | -S "server side, adding alpn extension" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6607 | -C "found alpn extension" \ | 
|  | 6608 | -C "Application Layer Protocol is 1234" \ | 
|  | 6609 | -S "Application Layer Protocol is 1234" | 
|  | 6610 |  | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6611 |  | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6612 | # Tests for keyUsage in leaf certificates, part 1: | 
|  | 6613 | # server-side certificate/suite selection | 
|  | 6614 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6615 | run_test    "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6616 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6617 | crt_file=data_files/server2.ku-ds.crt" \ | 
|  | 6618 | "$P_CLI" \ | 
|  | 6619 | 0 \ | 
| Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6620 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6621 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6622 | run_test    "keyUsage srv: RSA, keyEncipherment -> RSA" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6623 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6624 | crt_file=data_files/server2.ku-ke.crt" \ | 
|  | 6625 | "$P_CLI" \ | 
|  | 6626 | 0 \ | 
|  | 6627 | -c "Ciphersuite is TLS-RSA-WITH-" | 
|  | 6628 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6629 | run_test    "keyUsage srv: RSA, keyAgreement -> fail" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6630 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6631 | crt_file=data_files/server2.ku-ka.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6632 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6633 | 1 \ | 
|  | 6634 | -C "Ciphersuite is " | 
|  | 6635 |  | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 6636 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6637 | run_test    "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6638 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6639 | crt_file=data_files/server5.ku-ds.crt" \ | 
|  | 6640 | "$P_CLI" \ | 
|  | 6641 | 0 \ | 
|  | 6642 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" | 
|  | 6643 |  | 
|  | 6644 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6645 | run_test    "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6646 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6647 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 6648 | "$P_CLI" \ | 
|  | 6649 | 0 \ | 
|  | 6650 | -c "Ciphersuite is TLS-ECDH-" | 
|  | 6651 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6652 | run_test    "keyUsage srv: ECDSA, keyEncipherment -> fail" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6653 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6654 | crt_file=data_files/server5.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6655 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6656 | 1 \ | 
|  | 6657 | -C "Ciphersuite is " | 
|  | 6658 |  | 
|  | 6659 | # Tests for keyUsage in leaf certificates, part 2: | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6660 | # client-side checking of server cert | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6661 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6662 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6663 | "$O_SRV -tls1_2 -key data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6664 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6665 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6666 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6667 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6668 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6669 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6670 | -c "Ciphersuite is TLS-" | 
|  | 6671 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6672 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6673 | "$O_SRV -tls1_2 -key data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6674 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6675 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6676 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6677 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6678 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6679 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6680 | -c "Ciphersuite is TLS-" | 
|  | 6681 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6682 | run_test    "keyUsage cli: KeyEncipherment, RSA: OK" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6683 | "$O_SRV -tls1_2 -key data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6684 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6685 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6686 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6687 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6688 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6689 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6690 | -c "Ciphersuite is TLS-" | 
|  | 6691 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6692 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6693 | "$O_SRV -tls1_2 -key data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6694 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6695 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6696 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6697 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6698 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6699 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 6700 | -C "Ciphersuite is TLS-" | 
|  | 6701 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6702 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6703 | "$O_SRV -tls1_2 -key data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6704 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 6705 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 6706 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6707 | 0 \ | 
|  | 6708 | -c "bad certificate (usage extensions)" \ | 
|  | 6709 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6710 | -c "Ciphersuite is TLS-" \ | 
|  | 6711 | -c "! Usage does not match the keyUsage extension" | 
|  | 6712 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6713 | run_test    "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6714 | "$O_SRV -tls1_2 -key data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6715 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6716 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6717 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6718 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6719 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6720 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6721 | -c "Ciphersuite is TLS-" | 
|  | 6722 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6723 | run_test    "keyUsage cli: DigitalSignature, 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-ds.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-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 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6733 | run_test    "keyUsage cli: DigitalSignature, RSA: fail, soft" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6734 | "$O_SRV -tls1_2 -key data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6735 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 6736 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 6737 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6738 | 0 \ | 
|  | 6739 | -c "bad certificate (usage extensions)" \ | 
|  | 6740 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6741 | -c "Ciphersuite is TLS-" \ | 
|  | 6742 | -c "! Usage does not match the keyUsage extension" | 
|  | 6743 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6744 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6745 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6746 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6747 | run_test    "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
|  | 6748 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ | 
|  | 6749 | -cert data_files/server2.ku-ds_ke.crt" \ | 
|  | 6750 | "$P_CLI debug_level=3" \ | 
|  | 6751 | 0 \ | 
|  | 6752 | -C "bad certificate (usage extensions)" \ | 
|  | 6753 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6754 | -c "Ciphersuite is" | 
|  | 6755 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6756 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6757 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6758 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6759 | run_test    "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6760 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ | 
|  | 6761 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 6762 | "$P_CLI debug_level=1" \ | 
|  | 6763 | 1 \ | 
|  | 6764 | -c "bad certificate (usage extensions)" \ | 
|  | 6765 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 6766 | -C "Ciphersuite is" | 
|  | 6767 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6768 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6769 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6770 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6771 | run_test    "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6772 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ | 
|  | 6773 | -cert data_files/server2.ku-ka.crt" \ | 
|  | 6774 | "$P_CLI debug_level=1" \ | 
|  | 6775 | 1 \ | 
|  | 6776 | -c "bad certificate (usage extensions)" \ | 
|  | 6777 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 6778 | -C "Ciphersuite is" | 
|  | 6779 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6780 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6781 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6782 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6783 | run_test    "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ | 
|  | 6784 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ | 
|  | 6785 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 6786 | "$P_CLI debug_level=3" \ | 
|  | 6787 | 0 \ | 
|  | 6788 | -C "bad certificate (usage extensions)" \ | 
|  | 6789 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6790 | -c "Ciphersuite is" | 
|  | 6791 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6792 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6793 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6794 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6795 | run_test    "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6796 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ | 
|  | 6797 | -cert data_files/server5.ku-ke.crt" \ | 
|  | 6798 | "$P_CLI debug_level=1" \ | 
|  | 6799 | 1 \ | 
|  | 6800 | -c "bad certificate (usage extensions)" \ | 
|  | 6801 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 6802 | -C "Ciphersuite is" | 
|  | 6803 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6804 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6805 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6806 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6807 | run_test    "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6808 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ | 
|  | 6809 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 6810 | "$P_CLI debug_level=1" \ | 
|  | 6811 | 1 \ | 
|  | 6812 | -c "bad certificate (usage extensions)" \ | 
|  | 6813 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 6814 | -C "Ciphersuite is" | 
|  | 6815 |  | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6816 | # Tests for keyUsage in leaf certificates, part 3: | 
|  | 6817 | # server-side checking of client cert | 
|  | 6818 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6820 | run_test    "keyUsage cli-auth: RSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6821 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6822 | "$O_CLI -key data_files/server2.key \ | 
|  | 6823 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 6824 | 0 \ | 
| Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6825 | -s "Verifying peer X.509 certificate... ok" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6826 | -S "bad certificate (usage extensions)" \ | 
|  | 6827 | -S "Processing of the Certificate handshake message failed" | 
|  | 6828 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6830 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6831 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6832 | "$O_CLI -key data_files/server2.key \ | 
|  | 6833 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 6834 | 0 \ | 
|  | 6835 | -s "bad certificate (usage extensions)" \ | 
|  | 6836 | -S "Processing of the Certificate handshake message failed" | 
|  | 6837 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6839 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6840 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6841 | "$O_CLI -key data_files/server2.key \ | 
|  | 6842 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 6843 | 1 \ | 
|  | 6844 | -s "bad certificate (usage extensions)" \ | 
|  | 6845 | -s "Processing of the Certificate handshake message failed" | 
|  | 6846 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6848 | run_test    "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6849 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6850 | "$O_CLI -key data_files/server5.key \ | 
|  | 6851 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 6852 | 0 \ | 
| Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6853 | -s "Verifying peer X.509 certificate... ok" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6854 | -S "bad certificate (usage extensions)" \ | 
|  | 6855 | -S "Processing of the Certificate handshake message failed" | 
|  | 6856 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6858 | run_test    "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6859 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6860 | "$O_CLI -key data_files/server5.key \ | 
|  | 6861 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 6862 | 0 \ | 
|  | 6863 | -s "bad certificate (usage extensions)" \ | 
|  | 6864 | -S "Processing of the Certificate handshake message failed" | 
|  | 6865 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6866 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6867 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6868 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6869 | run_test    "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ | 
| Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6870 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6871 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ | 
|  | 6872 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 6873 | 0 \ | 
| Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6874 | -s "Verifying peer X.509 certificate... ok" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6875 | -S "bad certificate (usage extensions)" \ | 
|  | 6876 | -S "Processing of the Certificate handshake message failed" | 
|  | 6877 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6878 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6879 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6880 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6881 | run_test    "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ | 
| Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6882 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6883 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ | 
|  | 6884 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 6885 | 0 \ | 
|  | 6886 | -s "bad certificate (usage extensions)" \ | 
|  | 6887 | -S "Processing of the Certificate handshake message failed" | 
|  | 6888 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6889 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6890 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6891 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6892 | run_test    "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ | 
| Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6893 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6894 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ | 
|  | 6895 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 6896 | 0 \ | 
| Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6897 | -s "Verifying peer X.509 certificate... ok" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 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: ECDSA, KeyAgreement: fail (soft)" \ | 
| 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/server5.key \ | 
|  | 6907 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 6908 | 0 \ | 
|  | 6909 | -s "bad certificate (usage extensions)" \ | 
|  | 6910 | -S "Processing of the Certificate handshake message failed" | 
|  | 6911 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6912 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection | 
|  | 6913 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6914 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6915 | run_test    "extKeyUsage srv: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6916 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 6917 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 6918 | "$P_CLI" \ | 
|  | 6919 | 0 | 
|  | 6920 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6921 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6922 | run_test    "extKeyUsage srv: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6923 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 6924 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 6925 | "$P_CLI" \ | 
|  | 6926 | 0 | 
|  | 6927 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6928 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6929 | run_test    "extKeyUsage srv: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6930 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 6931 | crt_file=data_files/server5.eku-cs_any.crt" \ | 
|  | 6932 | "$P_CLI" \ | 
|  | 6933 | 0 | 
|  | 6934 |  | 
| Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6935 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6936 | run_test    "extKeyUsage srv: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6937 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6938 | crt_file=data_files/server5.eku-cli.crt" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6939 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6940 | 1 | 
|  | 6941 |  | 
|  | 6942 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert | 
|  | 6943 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6945 | run_test    "extKeyUsage cli: serverAuth -> OK" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6946 | "$O_SRV -tls1_2 -key data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6947 | -cert data_files/server5.eku-srv.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6948 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6949 | 0 \ | 
|  | 6950 | -C "bad certificate (usage extensions)" \ | 
|  | 6951 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6952 | -c "Ciphersuite is TLS-" | 
|  | 6953 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6955 | run_test    "extKeyUsage cli: serverAuth,clientAuth -> OK" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6956 | "$O_SRV -tls1_2 -key data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6957 | -cert data_files/server5.eku-srv_cli.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6958 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6959 | 0 \ | 
|  | 6960 | -C "bad certificate (usage extensions)" \ | 
|  | 6961 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6962 | -c "Ciphersuite is TLS-" | 
|  | 6963 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6965 | run_test    "extKeyUsage cli: codeSign,anyEKU -> OK" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6966 | "$O_SRV -tls1_2 -key data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6967 | -cert data_files/server5.eku-cs_any.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6968 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6969 | 0 \ | 
|  | 6970 | -C "bad certificate (usage extensions)" \ | 
|  | 6971 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6972 | -c "Ciphersuite is TLS-" | 
|  | 6973 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6975 | run_test    "extKeyUsage cli: codeSign -> fail" \ | 
| Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6976 | "$O_SRV -tls1_2 -key data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6977 | -cert data_files/server5.eku-cs.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6978 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6979 | 1 \ | 
|  | 6980 | -c "bad certificate (usage extensions)" \ | 
|  | 6981 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 6982 | -C "Ciphersuite is TLS-" | 
|  | 6983 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6984 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6985 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6986 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6987 | run_test    "extKeyUsage cli 1.3: serverAuth -> OK" \ | 
|  | 6988 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ | 
|  | 6989 | -cert data_files/server5.eku-srv.crt" \ | 
|  | 6990 | "$P_CLI debug_level=1" \ | 
|  | 6991 | 0 \ | 
|  | 6992 | -C "bad certificate (usage extensions)" \ | 
|  | 6993 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 6994 | -c "Ciphersuite is" | 
|  | 6995 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6996 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6997 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 6998 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6999 | run_test    "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ | 
|  | 7000 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ | 
|  | 7001 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 7002 | "$P_CLI debug_level=1" \ | 
|  | 7003 | 0 \ | 
|  | 7004 | -C "bad certificate (usage extensions)" \ | 
|  | 7005 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 7006 | -c "Ciphersuite is" | 
|  | 7007 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7008 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7009 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 7010 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7011 | run_test    "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ | 
|  | 7012 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ | 
|  | 7013 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 7014 | "$P_CLI debug_level=1" \ | 
|  | 7015 | 0 \ | 
|  | 7016 | -C "bad certificate (usage extensions)" \ | 
|  | 7017 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 7018 | -c "Ciphersuite is" | 
|  | 7019 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7020 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7021 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 7022 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7023 | run_test    "extKeyUsage cli 1.3: codeSign -> fail" \ | 
|  | 7024 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ | 
|  | 7025 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 7026 | "$P_CLI debug_level=1" \ | 
|  | 7027 | 1 \ | 
|  | 7028 | -c "bad certificate (usage extensions)" \ | 
|  | 7029 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 7030 | -C "Ciphersuite is" | 
|  | 7031 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7032 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert | 
|  | 7033 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7035 | run_test    "extKeyUsage cli-auth: clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7036 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7037 | "$O_CLI -key data_files/server5.key \ | 
|  | 7038 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 7039 | 0 \ | 
|  | 7040 | -S "bad certificate (usage extensions)" \ | 
|  | 7041 | -S "Processing of the Certificate handshake message failed" | 
|  | 7042 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7044 | run_test    "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7045 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7046 | "$O_CLI -key data_files/server5.key \ | 
|  | 7047 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 7048 | 0 \ | 
|  | 7049 | -S "bad certificate (usage extensions)" \ | 
|  | 7050 | -S "Processing of the Certificate handshake message failed" | 
|  | 7051 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7053 | run_test    "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7054 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7055 | "$O_CLI -key data_files/server5.key \ | 
|  | 7056 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 7057 | 0 \ | 
|  | 7058 | -S "bad certificate (usage extensions)" \ | 
|  | 7059 | -S "Processing of the Certificate handshake message failed" | 
|  | 7060 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7062 | run_test    "extKeyUsage cli-auth: codeSign -> fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7063 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7064 | "$O_CLI -key data_files/server5.key \ | 
|  | 7065 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 7066 | 0 \ | 
|  | 7067 | -s "bad certificate (usage extensions)" \ | 
|  | 7068 | -S "Processing of the Certificate handshake message failed" | 
|  | 7069 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7071 | run_test    "extKeyUsage cli-auth: codeSign -> fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7072 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7073 | "$O_CLI -key data_files/server5.key \ | 
|  | 7074 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 7075 | 1 \ | 
|  | 7076 | -s "bad certificate (usage extensions)" \ | 
|  | 7077 | -s "Processing of the Certificate handshake message failed" | 
|  | 7078 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7079 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7080 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 7081 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7082 | run_test    "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ | 
| Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7083 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7084 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ | 
|  | 7085 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 7086 | 0 \ | 
|  | 7087 | -S "bad certificate (usage extensions)" \ | 
|  | 7088 | -S "Processing of the Certificate handshake message failed" | 
|  | 7089 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7090 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7091 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 7092 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7093 | run_test    "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ | 
| Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7094 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7095 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ | 
|  | 7096 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 7097 | 0 \ | 
|  | 7098 | -S "bad certificate (usage extensions)" \ | 
|  | 7099 | -S "Processing of the Certificate handshake message failed" | 
|  | 7100 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7101 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7102 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 7103 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7104 | run_test    "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ | 
| Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7105 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7106 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ | 
|  | 7107 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 7108 | 0 \ | 
|  | 7109 | -S "bad certificate (usage extensions)" \ | 
|  | 7110 | -S "Processing of the Certificate handshake message failed" | 
|  | 7111 |  | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7112 | requires_openssl_tls1_3 | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7113 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 7114 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7115 | run_test    "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ | 
| Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7116 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ | 
| Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7117 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ | 
|  | 7118 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 7119 | 0 \ | 
|  | 7120 | -s "bad certificate (usage extensions)" \ | 
|  | 7121 | -S "Processing of the Certificate handshake message failed" | 
|  | 7122 |  | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7123 | # Tests for DHM parameters loading | 
|  | 7124 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7125 | run_test    "DHM parameters: reference" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7126 | "$P_SRV" \ | 
|  | 7127 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7128 | debug_level=3" \ | 
|  | 7129 | 0 \ | 
|  | 7130 | -c "value of 'DHM: P ' (2048 bits)" \ | 
| Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7131 | -c "value of 'DHM: G ' (2 bits)" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7132 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7133 | run_test    "DHM parameters: other parameters" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7134 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 7135 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7136 | debug_level=3" \ | 
|  | 7137 | 0 \ | 
|  | 7138 | -c "value of 'DHM: P ' (1024 bits)" \ | 
|  | 7139 | -c "value of 'DHM: G ' (2 bits)" | 
|  | 7140 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7141 | # Tests for DHM client-side size checking | 
|  | 7142 |  | 
|  | 7143 | run_test    "DHM size: server default, client default, OK" \ | 
|  | 7144 | "$P_SRV" \ | 
|  | 7145 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7146 | debug_level=1" \ | 
|  | 7147 | 0 \ | 
|  | 7148 | -C "DHM prime too short:" | 
|  | 7149 |  | 
|  | 7150 | run_test    "DHM size: server default, client 2048, OK" \ | 
|  | 7151 | "$P_SRV" \ | 
|  | 7152 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7153 | debug_level=1 dhmlen=2048" \ | 
|  | 7154 | 0 \ | 
|  | 7155 | -C "DHM prime too short:" | 
|  | 7156 |  | 
|  | 7157 | run_test    "DHM size: server 1024, client default, OK" \ | 
|  | 7158 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 7159 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7160 | debug_level=1" \ | 
|  | 7161 | 0 \ | 
|  | 7162 | -C "DHM prime too short:" | 
|  | 7163 |  | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7164 | run_test    "DHM size: server 999, client 999, OK" \ | 
|  | 7165 | "$P_SRV dhm_file=data_files/dh.999.pem" \ | 
|  | 7166 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7167 | debug_level=1 dhmlen=999" \ | 
|  | 7168 | 0 \ | 
|  | 7169 | -C "DHM prime too short:" | 
|  | 7170 |  | 
|  | 7171 | run_test    "DHM size: server 1000, client 1000, OK" \ | 
|  | 7172 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 7173 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7174 | debug_level=1 dhmlen=1000" \ | 
|  | 7175 | 0 \ | 
|  | 7176 | -C "DHM prime too short:" | 
|  | 7177 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7178 | run_test    "DHM size: server 1000, client default, rejected" \ | 
|  | 7179 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 7180 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7181 | debug_level=1" \ | 
|  | 7182 | 1 \ | 
|  | 7183 | -c "DHM prime too short:" | 
|  | 7184 |  | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7185 | run_test    "DHM size: server 1000, client 1001, rejected" \ | 
|  | 7186 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 7187 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7188 | debug_level=1 dhmlen=1001" \ | 
|  | 7189 | 1 \ | 
|  | 7190 | -c "DHM prime too short:" | 
|  | 7191 |  | 
|  | 7192 | run_test    "DHM size: server 999, client 1000, rejected" \ | 
|  | 7193 | "$P_SRV dhm_file=data_files/dh.999.pem" \ | 
|  | 7194 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7195 | debug_level=1 dhmlen=1000" \ | 
|  | 7196 | 1 \ | 
|  | 7197 | -c "DHM prime too short:" | 
|  | 7198 |  | 
|  | 7199 | run_test    "DHM size: server 998, client 999, rejected" \ | 
|  | 7200 | "$P_SRV dhm_file=data_files/dh.998.pem" \ | 
|  | 7201 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7202 | debug_level=1 dhmlen=999" \ | 
|  | 7203 | 1 \ | 
|  | 7204 | -c "DHM prime too short:" | 
|  | 7205 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7206 | run_test    "DHM size: server default, client 2049, rejected" \ | 
|  | 7207 | "$P_SRV" \ | 
|  | 7208 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 7209 | debug_level=1 dhmlen=2049" \ | 
|  | 7210 | 1 \ | 
|  | 7211 | -c "DHM prime too short:" | 
|  | 7212 |  | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7213 | # Tests for PSK callback | 
|  | 7214 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7215 | run_test    "PSK callback: psk, no callback" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7216 | "$P_SRV psk=abc123 psk_identity=foo" \ | 
|  | 7217 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7218 | psk_identity=foo psk=abc123" \ | 
|  | 7219 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7220 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7221 | -S "SSL - Unknown identity received" \ | 
|  | 7222 | -S "SSL - Verification of the message MAC failed" | 
|  | 7223 |  | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7224 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7225 | run_test    "PSK callback: opaque psk on client, no callback" \ | 
|  | 7226 | "$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] | 7227 | "$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] | 7228 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7229 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7230 | -C "session hash for extended master secret"\ | 
|  | 7231 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7232 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7233 | -S "SSL - Unknown identity received" \ | 
|  | 7234 | -S "SSL - Verification of the message MAC failed" | 
|  | 7235 |  | 
|  | 7236 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7237 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384" \ | 
|  | 7238 | "$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] | 7239 | "$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] | 7240 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7241 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7242 | -C "session hash for extended master secret"\ | 
|  | 7243 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7244 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7245 | -S "SSL - Unknown identity received" \ | 
|  | 7246 | -S "SSL - Verification of the message MAC failed" | 
|  | 7247 |  | 
|  | 7248 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7249 | run_test    "PSK callback: opaque psk on client, no callback, EMS" \ | 
|  | 7250 | "$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] | 7251 | "$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] | 7252 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7253 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7254 | -c "session hash for extended master secret"\ | 
|  | 7255 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7256 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7257 | -S "SSL - Unknown identity received" \ | 
|  | 7258 | -S "SSL - Verification of the message MAC failed" | 
|  | 7259 |  | 
|  | 7260 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7261 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ | 
|  | 7262 | "$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] | 7263 | "$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] | 7264 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7265 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7266 | -c "session hash for extended master secret"\ | 
|  | 7267 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7268 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7269 | -S "SSL - Unknown identity received" \ | 
|  | 7270 | -S "SSL - Verification of the message MAC failed" | 
|  | 7271 |  | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7272 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7273 | run_test    "PSK callback: opaque rsa-psk on client, no callback" \ | 
|  | 7274 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 7275 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ | 
|  | 7276 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7277 | 0 \ | 
| Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7278 | -C "session hash for extended master secret"\ | 
|  | 7279 | -S "session hash for extended master secret"\ | 
|  | 7280 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7281 | -S "SSL - Unknown identity received" \ | 
|  | 7282 | -S "SSL - Verification of the message MAC failed" | 
|  | 7283 |  | 
|  | 7284 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7285 | run_test    "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ | 
|  | 7286 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 7287 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7288 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7289 | 0 \ | 
| Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7290 | -C "session hash for extended master secret"\ | 
|  | 7291 | -S "session hash for extended master secret"\ | 
|  | 7292 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7293 | -S "SSL - Unknown identity received" \ | 
|  | 7294 | -S "SSL - Verification of the message MAC failed" | 
|  | 7295 |  | 
|  | 7296 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7297 | run_test    "PSK callback: opaque rsa-psk on client, no callback, EMS" \ | 
|  | 7298 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 7299 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7300 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7301 | 0 \ | 
| Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7302 | -c "session hash for extended master secret"\ | 
|  | 7303 | -s "session hash for extended master secret"\ | 
|  | 7304 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7305 | -S "SSL - Unknown identity received" \ | 
|  | 7306 | -S "SSL - Verification of the message MAC failed" | 
|  | 7307 |  | 
|  | 7308 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7309 | run_test    "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ | 
|  | 7310 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 7311 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7312 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7313 | 0 \ | 
| Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7314 | -c "session hash for extended master secret"\ | 
|  | 7315 | -s "session hash for extended master secret"\ | 
|  | 7316 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7317 | -S "SSL - Unknown identity received" \ | 
|  | 7318 | -S "SSL - Verification of the message MAC failed" | 
|  | 7319 |  | 
|  | 7320 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7321 | run_test    "PSK callback: opaque ecdhe-psk on client, no callback" \ | 
|  | 7322 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 7323 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ | 
|  | 7324 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7325 | 0 \ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7326 | -C "session hash for extended master secret"\ | 
|  | 7327 | -S "session hash for extended master secret"\ | 
|  | 7328 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7329 | -S "SSL - Unknown identity received" \ | 
|  | 7330 | -S "SSL - Verification of the message MAC failed" | 
|  | 7331 |  | 
|  | 7332 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7333 | run_test    "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ | 
|  | 7334 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 7335 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7336 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7337 | 0 \ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7338 | -C "session hash for extended master secret"\ | 
|  | 7339 | -S "session hash for extended master secret"\ | 
|  | 7340 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7341 | -S "SSL - Unknown identity received" \ | 
|  | 7342 | -S "SSL - Verification of the message MAC failed" | 
|  | 7343 |  | 
|  | 7344 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7345 | run_test    "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ | 
|  | 7346 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 7347 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7348 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7349 | 0 \ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7350 | -c "session hash for extended master secret"\ | 
|  | 7351 | -s "session hash for extended master secret"\ | 
|  | 7352 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7353 | -S "SSL - Unknown identity received" \ | 
|  | 7354 | -S "SSL - Verification of the message MAC failed" | 
|  | 7355 |  | 
|  | 7356 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7357 | run_test    "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ | 
|  | 7358 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 7359 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7360 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7361 | 0 \ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7362 | -c "session hash for extended master secret"\ | 
|  | 7363 | -s "session hash for extended master secret"\ | 
|  | 7364 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7365 | -S "SSL - Unknown identity received" \ | 
|  | 7366 | -S "SSL - Verification of the message MAC failed" | 
|  | 7367 |  | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7368 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7369 | run_test    "PSK callback: opaque dhe-psk on client, no callback" \ | 
|  | 7370 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 7371 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ | 
|  | 7372 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7373 | 0 \ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7374 | -C "session hash for extended master secret"\ | 
|  | 7375 | -S "session hash for extended master secret"\ | 
|  | 7376 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7377 | -S "SSL - Unknown identity received" \ | 
|  | 7378 | -S "SSL - Verification of the message MAC failed" | 
|  | 7379 |  | 
|  | 7380 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7381 | run_test    "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ | 
|  | 7382 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 7383 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7384 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7385 | 0 \ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7386 | -C "session hash for extended master secret"\ | 
|  | 7387 | -S "session hash for extended master secret"\ | 
|  | 7388 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7389 | -S "SSL - Unknown identity received" \ | 
|  | 7390 | -S "SSL - Verification of the message MAC failed" | 
|  | 7391 |  | 
|  | 7392 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7393 | run_test    "PSK callback: opaque dhe-psk on client, no callback, EMS" \ | 
|  | 7394 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 7395 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7396 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7397 | 0 \ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7398 | -c "session hash for extended master secret"\ | 
|  | 7399 | -s "session hash for extended master secret"\ | 
|  | 7400 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7401 | -S "SSL - Unknown identity received" \ | 
|  | 7402 | -S "SSL - Verification of the message MAC failed" | 
|  | 7403 |  | 
|  | 7404 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7405 | run_test    "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ | 
|  | 7406 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 7407 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7408 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
|  | 7409 | 0 \ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7410 | -c "session hash for extended master secret"\ | 
|  | 7411 | -s "session hash for extended master secret"\ | 
|  | 7412 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7413 | -S "SSL - Unknown identity received" \ | 
|  | 7414 | -S "SSL - Verification of the message MAC failed" | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7415 |  | 
|  | 7416 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7417 | 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] | 7418 | "$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" \ | 
|  | 7419 | "$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] | 7420 | psk_identity=foo psk=abc123" \ | 
|  | 7421 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7422 | -C "session hash for extended master secret"\ | 
|  | 7423 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7424 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7425 | -S "SSL - Unknown identity received" \ | 
|  | 7426 | -S "SSL - Verification of the message MAC failed" | 
|  | 7427 |  | 
|  | 7428 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7429 | 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] | 7430 | "$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" \ | 
|  | 7431 | "$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] | 7432 | psk_identity=foo psk=abc123" \ | 
|  | 7433 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7434 | -C "session hash for extended master secret"\ | 
|  | 7435 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7436 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7437 | -S "SSL - Unknown identity received" \ | 
|  | 7438 | -S "SSL - Verification of the message MAC failed" | 
|  | 7439 |  | 
|  | 7440 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7441 | 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] | 7442 | "$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] | 7443 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7444 | "$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] | 7445 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 7446 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7447 | -c "session hash for extended master secret"\ | 
|  | 7448 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7449 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7450 | -S "SSL - Unknown identity received" \ | 
|  | 7451 | -S "SSL - Verification of the message MAC failed" | 
|  | 7452 |  | 
|  | 7453 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7454 | 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] | 7455 | "$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] | 7456 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7457 | "$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] | 7458 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 7459 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7460 | -c "session hash for extended master secret"\ | 
|  | 7461 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7462 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7463 | -S "SSL - Unknown identity received" \ | 
|  | 7464 | -S "SSL - Verification of the message MAC failed" | 
|  | 7465 |  | 
|  | 7466 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7467 | run_test    "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ | 
|  | 7468 | "$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" \ | 
|  | 7469 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7470 | psk_identity=foo psk=abc123" \ | 
|  | 7471 | 0 \ | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7472 | -C "session hash for extended master secret"\ | 
|  | 7473 | -S "session hash for extended master secret"\ | 
|  | 7474 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7475 | -S "SSL - Unknown identity received" \ | 
|  | 7476 | -S "SSL - Verification of the message MAC failed" | 
|  | 7477 |  | 
|  | 7478 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7479 | run_test    "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ | 
|  | 7480 | "$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" \ | 
|  | 7481 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7482 | psk_identity=foo psk=abc123" \ | 
|  | 7483 | 0 \ | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7484 | -C "session hash for extended master secret"\ | 
|  | 7485 | -S "session hash for extended master secret"\ | 
|  | 7486 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7487 | -S "SSL - Unknown identity received" \ | 
|  | 7488 | -S "SSL - Verification of the message MAC failed" | 
|  | 7489 |  | 
|  | 7490 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7491 | run_test    "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ | 
|  | 7492 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ | 
|  | 7493 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 7494 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7495 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 7496 | 0 \ | 
|  | 7497 | -c "session hash for extended master secret"\ | 
|  | 7498 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7499 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7500 | -S "SSL - Unknown identity received" \ | 
|  | 7501 | -S "SSL - Verification of the message MAC failed" | 
|  | 7502 |  | 
|  | 7503 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7504 | run_test    "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ | 
|  | 7505 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ | 
|  | 7506 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 7507 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7508 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 7509 | 0 \ | 
|  | 7510 | -c "session hash for extended master secret"\ | 
|  | 7511 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7512 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7513 | -S "SSL - Unknown identity received" \ | 
|  | 7514 | -S "SSL - Verification of the message MAC failed" | 
|  | 7515 |  | 
|  | 7516 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7517 | run_test    "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ | 
|  | 7518 | "$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" \ | 
|  | 7519 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7520 | psk_identity=foo psk=abc123" \ | 
|  | 7521 | 0 \ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7522 | -C "session hash for extended master secret"\ | 
|  | 7523 | -S "session hash for extended master secret"\ | 
|  | 7524 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7525 | -S "SSL - Unknown identity received" \ | 
|  | 7526 | -S "SSL - Verification of the message MAC failed" | 
|  | 7527 |  | 
|  | 7528 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7529 | run_test    "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ | 
|  | 7530 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ | 
|  | 7531 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7532 | psk_identity=foo psk=abc123" \ | 
|  | 7533 | 0 \ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7534 | -C "session hash for extended master secret"\ | 
|  | 7535 | -S "session hash for extended master secret"\ | 
|  | 7536 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7537 | -S "SSL - Unknown identity received" \ | 
|  | 7538 | -S "SSL - Verification of the message MAC failed" | 
|  | 7539 |  | 
|  | 7540 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7541 | run_test    "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ | 
|  | 7542 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ | 
|  | 7543 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 7544 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7545 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 7546 | 0 \ | 
|  | 7547 | -c "session hash for extended master secret"\ | 
|  | 7548 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7549 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7550 | -S "SSL - Unknown identity received" \ | 
|  | 7551 | -S "SSL - Verification of the message MAC failed" | 
|  | 7552 |  | 
|  | 7553 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7554 | run_test    "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ | 
|  | 7555 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ | 
|  | 7556 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 7557 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7558 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 7559 | 0 \ | 
|  | 7560 | -c "session hash for extended master secret"\ | 
|  | 7561 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7562 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7563 | -S "SSL - Unknown identity received" \ | 
|  | 7564 | -S "SSL - Verification of the message MAC failed" | 
|  | 7565 |  | 
|  | 7566 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7567 | run_test    "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ | 
|  | 7568 | "$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" \ | 
|  | 7569 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7570 | psk_identity=foo psk=abc123" \ | 
|  | 7571 | 0 \ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7572 | -C "session hash for extended master secret"\ | 
|  | 7573 | -S "session hash for extended master secret"\ | 
|  | 7574 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7575 | -S "SSL - Unknown identity received" \ | 
|  | 7576 | -S "SSL - Verification of the message MAC failed" | 
|  | 7577 |  | 
|  | 7578 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7579 | run_test    "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ | 
|  | 7580 | "$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" \ | 
|  | 7581 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7582 | psk_identity=foo psk=abc123" \ | 
|  | 7583 | 0 \ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7584 | -C "session hash for extended master secret"\ | 
|  | 7585 | -S "session hash for extended master secret"\ | 
|  | 7586 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7587 | -S "SSL - Unknown identity received" \ | 
|  | 7588 | -S "SSL - Verification of the message MAC failed" | 
|  | 7589 |  | 
|  | 7590 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7591 | run_test    "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ | 
|  | 7592 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ | 
|  | 7593 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 7594 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7595 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 7596 | 0 \ | 
|  | 7597 | -c "session hash for extended master secret"\ | 
|  | 7598 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7599 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7600 | -S "SSL - Unknown identity received" \ | 
|  | 7601 | -S "SSL - Verification of the message MAC failed" | 
|  | 7602 |  | 
|  | 7603 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7604 | run_test    "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ | 
|  | 7605 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ | 
|  | 7606 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 7607 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7608 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 7609 | 0 \ | 
|  | 7610 | -c "session hash for extended master secret"\ | 
|  | 7611 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7612 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7613 | -S "SSL - Unknown identity received" \ | 
|  | 7614 | -S "SSL - Verification of the message MAC failed" | 
|  | 7615 |  | 
|  | 7616 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7617 | 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] | 7618 | "$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" \ | 
|  | 7619 | "$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] | 7620 | psk_identity=def psk=beef" \ | 
|  | 7621 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7622 | -C "session hash for extended master secret"\ | 
|  | 7623 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7624 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 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 | 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] | 7630 | "$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" \ | 
|  | 7631 | "$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] | 7632 | psk_identity=def psk=beef" \ | 
|  | 7633 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7634 | -C "session hash for extended master secret"\ | 
|  | 7635 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7636 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7637 | -S "SSL - Unknown identity received" \ | 
|  | 7638 | -S "SSL - Verification of the message MAC failed" | 
|  | 7639 |  | 
|  | 7640 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7641 | 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] | 7642 | "$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] | 7643 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7644 | "$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] | 7645 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 7646 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7647 | -c "session hash for extended master secret"\ | 
|  | 7648 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7649 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7650 | -S "SSL - Unknown identity received" \ | 
|  | 7651 | -S "SSL - Verification of the message MAC failed" | 
|  | 7652 |  | 
|  | 7653 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7654 | 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] | 7655 | "$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] | 7656 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7657 | "$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] | 7658 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 7659 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7660 | -c "session hash for extended master secret"\ | 
|  | 7661 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7662 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7663 | -S "SSL - Unknown identity received" \ | 
|  | 7664 | -S "SSL - Verification of the message MAC failed" | 
|  | 7665 |  | 
|  | 7666 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7667 | run_test    "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ | 
|  | 7668 | "$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" \ | 
|  | 7669 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7670 | psk_identity=def psk=beef" \ | 
|  | 7671 | 0 \ | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7672 | -C "session hash for extended master secret"\ | 
|  | 7673 | -S "session hash for extended master secret"\ | 
|  | 7674 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7675 | -S "SSL - Unknown identity received" \ | 
|  | 7676 | -S "SSL - Verification of the message MAC failed" | 
|  | 7677 |  | 
|  | 7678 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7679 | run_test    "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ | 
|  | 7680 | "$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" \ | 
|  | 7681 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7682 | psk_identity=def psk=beef" \ | 
|  | 7683 | 0 \ | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7684 | -C "session hash for extended master secret"\ | 
|  | 7685 | -S "session hash for extended master secret"\ | 
|  | 7686 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7687 | -S "SSL - Unknown identity received" \ | 
|  | 7688 | -S "SSL - Verification of the message MAC failed" | 
|  | 7689 |  | 
|  | 7690 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7691 | run_test    "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ | 
|  | 7692 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ | 
|  | 7693 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 7694 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7695 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 7696 | 0 \ | 
|  | 7697 | -c "session hash for extended master secret"\ | 
|  | 7698 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7699 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7700 | -S "SSL - Unknown identity received" \ | 
|  | 7701 | -S "SSL - Verification of the message MAC failed" | 
|  | 7702 |  | 
|  | 7703 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7704 | run_test    "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ | 
|  | 7705 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ | 
|  | 7706 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 7707 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7708 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 7709 | 0 \ | 
|  | 7710 | -c "session hash for extended master secret"\ | 
|  | 7711 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7712 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7713 | -S "SSL - Unknown identity received" \ | 
|  | 7714 | -S "SSL - Verification of the message MAC failed" | 
|  | 7715 |  | 
|  | 7716 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7717 | run_test    "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ | 
|  | 7718 | "$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" \ | 
|  | 7719 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7720 | psk_identity=def psk=beef" \ | 
|  | 7721 | 0 \ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7722 | -C "session hash for extended master secret"\ | 
|  | 7723 | -S "session hash for extended master secret"\ | 
|  | 7724 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7725 | -S "SSL - Unknown identity received" \ | 
|  | 7726 | -S "SSL - Verification of the message MAC failed" | 
|  | 7727 |  | 
|  | 7728 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7729 | run_test    "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ | 
|  | 7730 | "$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" \ | 
|  | 7731 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7732 | psk_identity=def psk=beef" \ | 
|  | 7733 | 0 \ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7734 | -C "session hash for extended master secret"\ | 
|  | 7735 | -S "session hash for extended master secret"\ | 
|  | 7736 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7737 | -S "SSL - Unknown identity received" \ | 
|  | 7738 | -S "SSL - Verification of the message MAC failed" | 
|  | 7739 |  | 
|  | 7740 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7741 | run_test    "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ | 
|  | 7742 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ | 
|  | 7743 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 7744 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7745 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 7746 | 0 \ | 
|  | 7747 | -c "session hash for extended master secret"\ | 
|  | 7748 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7749 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7750 | -S "SSL - Unknown identity received" \ | 
|  | 7751 | -S "SSL - Verification of the message MAC failed" | 
|  | 7752 |  | 
|  | 7753 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7754 | run_test    "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ | 
|  | 7755 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ | 
|  | 7756 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 7757 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7758 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 7759 | 0 \ | 
|  | 7760 | -c "session hash for extended master secret"\ | 
|  | 7761 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7762 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7763 | -S "SSL - Unknown identity received" \ | 
|  | 7764 | -S "SSL - Verification of the message MAC failed" | 
|  | 7765 |  | 
|  | 7766 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7767 | run_test    "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ | 
|  | 7768 | "$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" \ | 
|  | 7769 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7770 | psk_identity=def psk=beef" \ | 
|  | 7771 | 0 \ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7772 | -C "session hash for extended master secret"\ | 
|  | 7773 | -S "session hash for extended master secret"\ | 
|  | 7774 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7775 | -S "SSL - Unknown identity received" \ | 
|  | 7776 | -S "SSL - Verification of the message MAC failed" | 
|  | 7777 |  | 
|  | 7778 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7779 | run_test    "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ | 
|  | 7780 | "$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" \ | 
|  | 7781 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7782 | psk_identity=def psk=beef" \ | 
|  | 7783 | 0 \ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7784 | -C "session hash for extended master secret"\ | 
|  | 7785 | -S "session hash for extended master secret"\ | 
|  | 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 | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7791 | run_test    "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ | 
|  | 7792 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ | 
|  | 7793 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 7794 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7795 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 7796 | 0 \ | 
|  | 7797 | -c "session hash for extended master secret"\ | 
|  | 7798 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7799 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7800 | -S "SSL - Unknown identity received" \ | 
|  | 7801 | -S "SSL - Verification of the message MAC failed" | 
|  | 7802 |  | 
|  | 7803 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7804 | run_test    "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ | 
|  | 7805 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ | 
|  | 7806 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 7807 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 7808 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 7809 | 0 \ | 
|  | 7810 | -c "session hash for extended master secret"\ | 
|  | 7811 | -s "session hash for extended master secret"\ | 
| Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7812 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7813 | -S "SSL - Unknown identity received" \ | 
|  | 7814 | -S "SSL - Verification of the message MAC failed" | 
|  | 7815 |  | 
|  | 7816 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7817 | 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] | 7818 | "$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" \ | 
|  | 7819 | "$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] | 7820 | psk_identity=def psk=beef" \ | 
|  | 7821 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7822 | -C "session hash for extended master secret"\ | 
|  | 7823 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7824 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7825 | -S "SSL - Unknown identity received" \ | 
|  | 7826 | -S "SSL - Verification of the message MAC failed" | 
|  | 7827 |  | 
|  | 7828 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7829 | 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] | 7830 | "$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" \ | 
|  | 7831 | "$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] | 7832 | psk_identity=def psk=beef" \ | 
|  | 7833 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7834 | -C "session hash for extended master secret"\ | 
|  | 7835 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7836 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7837 | -S "SSL - Unknown identity received" \ | 
|  | 7838 | -S "SSL - Verification of the message MAC failed" | 
|  | 7839 |  | 
|  | 7840 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7841 | 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] | 7842 | "$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" \ | 
|  | 7843 | "$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] | 7844 | psk_identity=def psk=beef" \ | 
|  | 7845 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7846 | -C "session hash for extended master secret"\ | 
|  | 7847 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7848 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7849 | -S "SSL - Unknown identity received" \ | 
|  | 7850 | -S "SSL - Verification of the message MAC failed" | 
|  | 7851 |  | 
|  | 7852 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7853 | 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] | 7854 | "$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" \ | 
|  | 7855 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7856 | psk_identity=def psk=beef" \ | 
|  | 7857 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7858 | -C "session hash for extended master secret"\ | 
|  | 7859 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7860 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7861 | -S "SSL - Unknown identity received" \ | 
|  | 7862 | -S "SSL - Verification of the message MAC failed" | 
|  | 7863 |  | 
|  | 7864 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 7865 | 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] | 7866 | "$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" \ | 
|  | 7867 | "$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] | 7868 | psk_identity=def psk=beef" \ | 
|  | 7869 | 1 \ | 
|  | 7870 | -s "SSL - Verification of the message MAC failed" | 
|  | 7871 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7872 | run_test    "PSK callback: no psk, no callback" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7873 | "$P_SRV" \ | 
|  | 7874 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7875 | psk_identity=foo psk=abc123" \ | 
|  | 7876 | 1 \ | 
| Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7877 | -s "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7878 | -S "SSL - Unknown identity received" \ | 
|  | 7879 | -S "SSL - Verification of the message MAC failed" | 
|  | 7880 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7881 | run_test    "PSK callback: callback overrides other settings" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7882 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ | 
|  | 7883 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7884 | psk_identity=foo psk=abc123" \ | 
|  | 7885 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7886 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7887 | -s "SSL - Unknown identity received" \ | 
|  | 7888 | -S "SSL - Verification of the message MAC failed" | 
|  | 7889 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7890 | run_test    "PSK callback: first id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7891 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 7892 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7893 | psk_identity=abc psk=dead" \ | 
|  | 7894 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7895 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7896 | -S "SSL - Unknown identity received" \ | 
|  | 7897 | -S "SSL - Verification of the message MAC failed" | 
|  | 7898 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7899 | run_test    "PSK callback: second id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7900 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 7901 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7902 | psk_identity=def psk=beef" \ | 
|  | 7903 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7904 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7905 | -S "SSL - Unknown identity received" \ | 
|  | 7906 | -S "SSL - Verification of the message MAC failed" | 
|  | 7907 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7908 | run_test    "PSK callback: no match" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7909 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 7910 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7911 | psk_identity=ghi psk=beef" \ | 
|  | 7912 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7913 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7914 | -s "SSL - Unknown identity received" \ | 
|  | 7915 | -S "SSL - Verification of the message MAC failed" | 
|  | 7916 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7917 | run_test    "PSK callback: wrong key" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7918 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 7919 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 7920 | psk_identity=abc psk=beef" \ | 
|  | 7921 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7922 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7923 | -S "SSL - Unknown identity received" \ | 
|  | 7924 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7925 |  | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7926 | # Tests for EC J-PAKE | 
|  | 7927 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7928 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7930 | run_test    "ECJPAKE: client not configured" \ | 
|  | 7931 | "$P_SRV debug_level=3" \ | 
|  | 7932 | "$P_CLI debug_level=3" \ | 
|  | 7933 | 0 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7934 | -C "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7935 | -C "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7936 | -S "found ecjpake kkpp extension" \ | 
|  | 7937 | -S "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7938 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7939 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7940 | -C "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7941 | -S "SSL - The handshake negotiation failed" | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7942 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7943 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7944 | run_test    "ECJPAKE: server not configured" \ | 
|  | 7945 | "$P_SRV debug_level=3" \ | 
|  | 7946 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 7947 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 7948 | 1 \ | 
| Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7949 | -c "add ciphersuite: c0ff" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7950 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7951 | -s "found ecjpake kkpp extension" \ | 
|  | 7952 | -s "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7953 | -s "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7954 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7955 | -C "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7956 | -s "SSL - The handshake negotiation failed" | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7957 |  | 
| Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 7958 | # Note: if the name of this test is changed, then please adjust the corresponding | 
|  | 7959 | #       filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7960 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7961 | run_test    "ECJPAKE: working, TLS" \ | 
|  | 7962 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 7963 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 7964 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
| Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7965 | 0 \ | 
| Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7966 | -c "add ciphersuite: c0ff" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7967 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7968 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7969 | -s "found ecjpake kkpp extension" \ | 
|  | 7970 | -S "skip ecjpake kkpp extension" \ | 
|  | 7971 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7972 | -s "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7973 | -c "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7974 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7975 | -S "SSL - Verification of the message MAC failed" | 
|  | 7976 |  | 
| Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 7977 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 7978 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 7979 | run_test    "ECJPAKE: opaque password client+server, working, TLS" \ | 
| Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 7980 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ | 
|  | 7981 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ | 
|  | 7982 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 7983 | 0 \ | 
|  | 7984 | -c "add ciphersuite: c0ff" \ | 
|  | 7985 | -c "adding ecjpake_kkpp extension" \ | 
| Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 7986 | -c "using opaque password" \ | 
|  | 7987 | -s "using opaque password" \ | 
| Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 7988 | -C "re-using cached ecjpake parameters" \ | 
|  | 7989 | -s "found ecjpake kkpp extension" \ | 
|  | 7990 | -S "skip ecjpake kkpp extension" \ | 
|  | 7991 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
|  | 7992 | -s "server hello, ecjpake kkpp extension" \ | 
|  | 7993 | -c "found ecjpake_kkpp extension" \ | 
|  | 7994 | -S "SSL - The handshake negotiation failed" \ | 
|  | 7995 | -S "SSL - Verification of the message MAC failed" | 
|  | 7996 |  | 
| Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 7997 | # Note: if the name of this test is changed, then please adjust the corresponding | 
|  | 7998 | #       filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") | 
| Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 7999 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
|  | 8000 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8001 | run_test    "ECJPAKE: opaque password client only, working, TLS" \ | 
| Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8002 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 8003 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ | 
|  | 8004 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 8005 | 0 \ | 
|  | 8006 | -c "add ciphersuite: c0ff" \ | 
|  | 8007 | -c "adding ecjpake_kkpp extension" \ | 
|  | 8008 | -c "using opaque password" \ | 
|  | 8009 | -S "using opaque password" \ | 
|  | 8010 | -C "re-using cached ecjpake parameters" \ | 
|  | 8011 | -s "found ecjpake kkpp extension" \ | 
|  | 8012 | -S "skip ecjpake kkpp extension" \ | 
|  | 8013 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
|  | 8014 | -s "server hello, ecjpake kkpp extension" \ | 
|  | 8015 | -c "found ecjpake_kkpp extension" \ | 
|  | 8016 | -S "SSL - The handshake negotiation failed" \ | 
|  | 8017 | -S "SSL - Verification of the message MAC failed" | 
|  | 8018 |  | 
| Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8019 | # Note: if the name of this test is changed, then please adjust the corresponding | 
|  | 8020 | #       filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") | 
| Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8021 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
|  | 8022 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8023 | run_test    "ECJPAKE: opaque password server only, working, TLS" \ | 
| Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8024 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ | 
|  | 8025 | "$P_CLI debug_level=3 ecjpake_pw=bla\ | 
|  | 8026 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 8027 | 0 \ | 
|  | 8028 | -c "add ciphersuite: c0ff" \ | 
|  | 8029 | -c "adding ecjpake_kkpp extension" \ | 
|  | 8030 | -C "using opaque password" \ | 
|  | 8031 | -s "using opaque password" \ | 
|  | 8032 | -C "re-using cached ecjpake parameters" \ | 
|  | 8033 | -s "found ecjpake kkpp extension" \ | 
|  | 8034 | -S "skip ecjpake kkpp extension" \ | 
|  | 8035 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
|  | 8036 | -s "server hello, ecjpake kkpp extension" \ | 
|  | 8037 | -c "found ecjpake_kkpp extension" \ | 
|  | 8038 | -S "SSL - The handshake negotiation failed" \ | 
|  | 8039 | -S "SSL - Verification of the message MAC failed" | 
|  | 8040 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8041 | server_needs_more_time 1 | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8042 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8043 | run_test    "ECJPAKE: password mismatch, TLS" \ | 
|  | 8044 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 8045 | "$P_CLI debug_level=3 ecjpake_pw=bad \ | 
|  | 8046 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 8047 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8048 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8049 | -s "SSL - Verification of the message MAC failed" | 
|  | 8050 |  | 
| Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8051 | server_needs_more_time 1 | 
|  | 8052 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
|  | 8053 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8054 | run_test    "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ | 
|  | 8055 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ | 
|  | 8056 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ | 
|  | 8057 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 8058 | 1 \ | 
|  | 8059 | -c "using opaque password" \ | 
|  | 8060 | -s "using opaque password" \ | 
|  | 8061 | -C "re-using cached ecjpake parameters" \ | 
|  | 8062 | -s "SSL - Verification of the message MAC failed" | 
|  | 8063 |  | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8064 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8065 | run_test    "ECJPAKE: working, DTLS" \ | 
|  | 8066 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 8067 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 8068 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 8069 | 0 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8070 | -c "re-using cached ecjpake parameters" \ | 
|  | 8071 | -S "SSL - Verification of the message MAC failed" | 
|  | 8072 |  | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8073 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8074 | run_test    "ECJPAKE: working, DTLS, no cookie" \ | 
|  | 8075 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ | 
|  | 8076 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 8077 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 8078 | 0 \ | 
|  | 8079 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8080 | -S "SSL - Verification of the message MAC failed" | 
|  | 8081 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8082 | server_needs_more_time 1 | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8083 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8084 | run_test    "ECJPAKE: password mismatch, DTLS" \ | 
|  | 8085 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 8086 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ | 
|  | 8087 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 8088 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8089 | -c "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8090 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8091 |  | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8092 | # for tests with configs/config-thread.h | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8093 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8094 | run_test    "ECJPAKE: working, DTLS, nolog" \ | 
|  | 8095 | "$P_SRV dtls=1 ecjpake_pw=bla" \ | 
|  | 8096 | "$P_CLI dtls=1 ecjpake_pw=bla \ | 
|  | 8097 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 8098 | 0 | 
|  | 8099 |  | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8100 | # Test for ClientHello without extensions | 
|  | 8101 |  | 
| Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8102 | requires_gnutls | 
| Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8103 | run_test    "ClientHello without extensions" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 8104 | "$P_SRV force_version=tls12 debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8105 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8106 | 0 \ | 
|  | 8107 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 8108 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8109 | # Tests for mbedtls_ssl_get_bytes_avail() | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8110 |  | 
| Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8111 | # The server first reads buffer_size-1 bytes, then reads the remainder. | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8113 | run_test    "mbedtls_ssl_get_bytes_avail: no extra data" \ | 
| Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8114 | "$P_SRV buffer_size=100" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8115 | "$P_CLI request_size=100" \ | 
|  | 8116 | 0 \ | 
|  | 8117 | -s "Read from client: 100 bytes read$" | 
|  | 8118 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8120 | run_test    "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ | 
|  | 8121 | "$P_SRV buffer_size=100" \ | 
|  | 8122 | "$P_CLI request_size=101" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8123 | 0 \ | 
| Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8124 | -s "Read from client: 101 bytes read (100 + 1)" | 
|  | 8125 |  | 
|  | 8126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8127 | requires_max_content_len 200 | 
|  | 8128 | run_test    "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ | 
|  | 8129 | "$P_SRV buffer_size=100" \ | 
|  | 8130 | "$P_CLI request_size=200" \ | 
|  | 8131 | 0 \ | 
|  | 8132 | -s "Read from client: 200 bytes read (100 + 100)" | 
|  | 8133 |  | 
|  | 8134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8135 | run_test    "mbedtls_ssl_get_bytes_avail: extra data (max)" \ | 
|  | 8136 | "$P_SRV buffer_size=100" \ | 
|  | 8137 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ | 
|  | 8138 | 0 \ | 
|  | 8139 | -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] | 8140 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8141 | # Tests for small client packets | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8142 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8143 | run_test    "Small client packet TLS 1.2 BlockCipher" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8144 | "$P_SRV force_version=tls12" \ | 
|  | 8145 | "$P_CLI request_size=1 \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8146 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 8147 | 0 \ | 
|  | 8148 | -s "Read from client: 1 bytes read" | 
|  | 8149 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8150 | run_test    "Small client packet TLS 1.2 BlockCipher, without EtM" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8151 | "$P_SRV force_version=tls12" \ | 
|  | 8152 | "$P_CLI request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8153 | 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] | 8154 | 0 \ | 
|  | 8155 | -s "Read from client: 1 bytes read" | 
|  | 8156 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8157 | run_test    "Small client packet TLS 1.2 BlockCipher larger MAC" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8158 | "$P_SRV force_version=tls12" \ | 
|  | 8159 | "$P_CLI request_size=1 \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8160 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8161 | 0 \ | 
|  | 8162 | -s "Read from client: 1 bytes read" | 
|  | 8163 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8164 | run_test    "Small client packet TLS 1.2 AEAD" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8165 | "$P_SRV force_version=tls12" \ | 
|  | 8166 | "$P_CLI request_size=1 \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8167 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 8168 | 0 \ | 
|  | 8169 | -s "Read from client: 1 bytes read" | 
|  | 8170 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8171 | run_test    "Small client packet TLS 1.2 AEAD shorter tag" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8172 | "$P_SRV force_version=tls12" \ | 
|  | 8173 | "$P_CLI request_size=1 \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8174 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 8175 | 0 \ | 
|  | 8176 | -s "Read from client: 1 bytes read" | 
|  | 8177 |  | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8178 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8179 | run_test    "Small client packet TLS 1.3 AEAD" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8180 | "$P_SRV" \ | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8181 | "$P_CLI request_size=1 \ | 
|  | 8182 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ | 
|  | 8183 | 0 \ | 
|  | 8184 | -s "Read from client: 1 bytes read" | 
|  | 8185 |  | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8186 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8187 | run_test    "Small client packet TLS 1.3 AEAD shorter tag" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8188 | "$P_SRV" \ | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8189 | "$P_CLI request_size=1 \ | 
|  | 8190 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ | 
|  | 8191 | 0 \ | 
|  | 8192 | -s "Read from client: 1 bytes read" | 
|  | 8193 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8194 | # Tests for small client packets in DTLS | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8195 |  | 
|  | 8196 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8197 | run_test    "Small client packet DTLS 1.2" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8198 | "$P_SRV dtls=1 force_version=dtls12" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8199 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 8200 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 8201 | 0 \ | 
|  | 8202 | -s "Read from client: 1 bytes read" | 
|  | 8203 |  | 
|  | 8204 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8205 | run_test    "Small client packet DTLS 1.2, without EtM" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8206 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8207 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 8208 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 8209 | 0 \ | 
|  | 8210 | -s "Read from client: 1 bytes read" | 
|  | 8211 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8212 | # Tests for small server packets | 
|  | 8213 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8214 | run_test    "Small server packet TLS 1.2 BlockCipher" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8215 | "$P_SRV response_size=1 force_version=tls12" \ | 
|  | 8216 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8217 | 0 \ | 
|  | 8218 | -c "Read from server: 1 bytes read" | 
|  | 8219 |  | 
|  | 8220 | run_test    "Small server packet TLS 1.2 BlockCipher, without EtM" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8221 | "$P_SRV response_size=1 force_version=tls12" \ | 
|  | 8222 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8223 | 0 \ | 
|  | 8224 | -c "Read from server: 1 bytes read" | 
|  | 8225 |  | 
|  | 8226 | run_test    "Small server packet TLS 1.2 BlockCipher larger MAC" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8227 | "$P_SRV response_size=1 force_version=tls12" \ | 
|  | 8228 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8229 | 0 \ | 
|  | 8230 | -c "Read from server: 1 bytes read" | 
|  | 8231 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8232 | run_test    "Small server packet TLS 1.2 AEAD" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8233 | "$P_SRV response_size=1 force_version=tls12" \ | 
|  | 8234 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8235 | 0 \ | 
|  | 8236 | -c "Read from server: 1 bytes read" | 
|  | 8237 |  | 
|  | 8238 | run_test    "Small server packet TLS 1.2 AEAD shorter tag" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8239 | "$P_SRV response_size=1 force_version=tls12" \ | 
|  | 8240 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8241 | 0 \ | 
|  | 8242 | -c "Read from server: 1 bytes read" | 
|  | 8243 |  | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8244 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8245 | run_test    "Small server packet TLS 1.3 AEAD" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8246 | "$P_SRV response_size=1" \ | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8247 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ | 
|  | 8248 | 0 \ | 
|  | 8249 | -c "Read from server: 1 bytes read" | 
|  | 8250 |  | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8251 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8252 | run_test    "Small server packet TLS 1.3 AEAD shorter tag" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8253 | "$P_SRV response_size=1" \ | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8254 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ | 
|  | 8255 | 0 \ | 
|  | 8256 | -c "Read from server: 1 bytes read" | 
|  | 8257 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8258 | # Tests for small server packets in DTLS | 
|  | 8259 |  | 
|  | 8260 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8261 | run_test    "Small server packet DTLS 1.2" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8262 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8263 | "$P_CLI dtls=1 \ | 
|  | 8264 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 8265 | 0 \ | 
|  | 8266 | -c "Read from server: 1 bytes read" | 
|  | 8267 |  | 
|  | 8268 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8269 | run_test    "Small server packet DTLS 1.2, without EtM" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8270 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8271 | "$P_CLI dtls=1 \ | 
|  | 8272 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 8273 | 0 \ | 
|  | 8274 | -c "Read from server: 1 bytes read" | 
|  | 8275 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8276 | # Test for large client packets | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8277 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8278 | # How many fragments do we expect to write $1 bytes? | 
|  | 8279 | fragments_for_write() { | 
|  | 8280 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" | 
|  | 8281 | } | 
|  | 8282 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8283 | run_test    "Large client packet TLS 1.2 BlockCipher" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8284 | "$P_SRV force_version=tls12" \ | 
|  | 8285 | "$P_CLI request_size=16384 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8286 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 8287 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8288 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 8289 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8290 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8291 | run_test    "Large client packet TLS 1.2 BlockCipher, without EtM" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8292 | "$P_SRV force_version=tls12" \ | 
|  | 8293 | "$P_CLI request_size=16384 etm=0 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8294 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 8295 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8296 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8297 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8298 | run_test    "Large client packet TLS 1.2 BlockCipher larger MAC" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8299 | "$P_SRV force_version=tls12" \ | 
|  | 8300 | "$P_CLI request_size=16384 \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8301 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8302 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8303 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 8304 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8305 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8306 | run_test    "Large client packet TLS 1.2 AEAD" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8307 | "$P_SRV force_version=tls12" \ | 
|  | 8308 | "$P_CLI request_size=16384 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8309 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 8310 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8311 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 8312 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8313 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8314 | run_test    "Large client packet TLS 1.2 AEAD shorter tag" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8315 | "$P_SRV force_version=tls12" \ | 
|  | 8316 | "$P_CLI request_size=16384 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8317 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 8318 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8319 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 8320 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8321 |  | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8322 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8323 | run_test    "Large client packet TLS 1.3 AEAD" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8324 | "$P_SRV" \ | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8325 | "$P_CLI request_size=16384 \ | 
|  | 8326 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ | 
|  | 8327 | 0 \ | 
|  | 8328 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 8329 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
|  | 8330 |  | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8331 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8332 | run_test    "Large client packet TLS 1.3 AEAD shorter tag" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8333 | "$P_SRV" \ | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8334 | "$P_CLI request_size=16384 \ | 
|  | 8335 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ | 
|  | 8336 | 0 \ | 
|  | 8337 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 8338 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
|  | 8339 |  | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8340 | # 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] | 8341 | run_test    "Large server packet TLS 1.2 BlockCipher" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8342 | "$P_SRV response_size=16384 force_version=tls12" \ | 
|  | 8343 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8344 | 0 \ | 
|  | 8345 | -c "Read from server: 16384 bytes read" | 
|  | 8346 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8347 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8348 | "$P_SRV response_size=16384 force_version=tls12" \ | 
|  | 8349 | "$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] | 8350 | 0 \ | 
|  | 8351 | -s "16384 bytes written in 1 fragments" \ | 
|  | 8352 | -c "Read from server: 16384 bytes read" | 
|  | 8353 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8354 | run_test    "Large server packet TLS 1.2 BlockCipher larger MAC" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8355 | "$P_SRV response_size=16384 force_version=tls12" \ | 
|  | 8356 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8357 | 0 \ | 
|  | 8358 | -c "Read from server: 16384 bytes read" | 
|  | 8359 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8360 | 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] | 8361 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ | 
|  | 8362 | "$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] | 8363 | 0 \ | 
|  | 8364 | -s "16384 bytes written in 1 fragments" \ | 
|  | 8365 | -c "Read from server: 16384 bytes read" | 
|  | 8366 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8367 | run_test    "Large server packet TLS 1.2 AEAD" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8368 | "$P_SRV response_size=16384 force_version=tls12" \ | 
|  | 8369 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8370 | 0 \ | 
|  | 8371 | -c "Read from server: 16384 bytes read" | 
|  | 8372 |  | 
|  | 8373 | run_test    "Large server packet TLS 1.2 AEAD shorter tag" \ | 
| Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8374 | "$P_SRV response_size=16384 force_version=tls12" \ | 
|  | 8375 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8376 | 0 \ | 
|  | 8377 | -c "Read from server: 16384 bytes read" | 
|  | 8378 |  | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8379 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8380 | run_test    "Large server packet TLS 1.3 AEAD" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8381 | "$P_SRV response_size=16384" \ | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8382 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ | 
|  | 8383 | 0 \ | 
|  | 8384 | -c "Read from server: 16384 bytes read" | 
|  | 8385 |  | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8386 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8387 | run_test    "Large server packet TLS 1.3 AEAD shorter tag" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8388 | "$P_SRV response_size=16384" \ | 
| Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8389 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ | 
|  | 8390 | 0 \ | 
|  | 8391 | -c "Read from server: 16384 bytes read" | 
|  | 8392 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8393 | # Tests for restartable ECC | 
|  | 8394 |  | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8395 | # Force the use of a curve that supports restartable ECC (secp256r1). | 
|  | 8396 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8397 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8398 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8399 | run_test    "EC restart: TLS, default" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8400 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8401 | "$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] | 8402 | 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] | 8403 | debug_level=1" \ | 
|  | 8404 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8405 | -C "x509_verify_cert.*4b00" \ | 
|  | 8406 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 8407 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8408 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8409 |  | 
|  | 8410 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8411 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8412 | run_test    "EC restart: TLS, max_ops=0" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8413 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8414 | "$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] | 8415 | 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] | 8416 | debug_level=1 ec_max_ops=0" \ | 
|  | 8417 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8418 | -C "x509_verify_cert.*4b00" \ | 
|  | 8419 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 8420 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8421 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8422 |  | 
|  | 8423 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8424 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8425 | run_test    "EC restart: TLS, max_ops=65535" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8426 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8427 | "$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] | 8428 | 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] | 8429 | debug_level=1 ec_max_ops=65535" \ | 
|  | 8430 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8431 | -C "x509_verify_cert.*4b00" \ | 
|  | 8432 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 8433 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8434 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8435 |  | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8436 | # With USE_PSA disabled we expect full restartable behaviour. | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8437 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8438 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8439 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8440 | run_test    "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8441 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8442 | "$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] | 8443 | 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] | 8444 | debug_level=1 ec_max_ops=1000" \ | 
|  | 8445 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8446 | -c "x509_verify_cert.*4b00" \ | 
|  | 8447 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8448 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8449 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8450 |  | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8451 | # With USE_PSA enabled we expect only partial restartable behaviour: | 
|  | 8452 | # everything except ECDH (where TLS calls PSA directly). | 
|  | 8453 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 8454 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8455 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8456 | run_test    "EC restart: TLS, max_ops=1000 (USE_PSA)" \ | 
|  | 8457 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
|  | 8458 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8459 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 8460 | debug_level=1 ec_max_ops=1000" \ | 
|  | 8461 | 0 \ | 
|  | 8462 | -c "x509_verify_cert.*4b00" \ | 
|  | 8463 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8464 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8465 | -c "mbedtls_pk_sign.*4b00" | 
|  | 8466 |  | 
|  | 8467 | # This works the same with & without USE_PSA as we never get to ECDH: | 
|  | 8468 | # 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] | 8469 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8470 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8471 | run_test    "EC restart: TLS, max_ops=1000, badsign" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8472 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8473 | crt_file=data_files/server5-badsign.crt \ | 
|  | 8474 | key_file=data_files/server5.key" \ | 
|  | 8475 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8476 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 8477 | debug_level=1 ec_max_ops=1000" \ | 
|  | 8478 | 1 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8479 | -c "x509_verify_cert.*4b00" \ | 
|  | 8480 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 8481 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8482 | -C "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8483 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 8484 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 8485 | -c "X509 - Certificate verification failed" | 
|  | 8486 |  | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8487 | # With USE_PSA disabled we expect full restartable behaviour. | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8488 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8489 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8490 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8491 | 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] | 8492 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8493 | crt_file=data_files/server5-badsign.crt \ | 
|  | 8494 | key_file=data_files/server5.key" \ | 
|  | 8495 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8496 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 8497 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ | 
|  | 8498 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8499 | -c "x509_verify_cert.*4b00" \ | 
|  | 8500 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8501 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8502 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8503 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 8504 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 8505 | -C "X509 - Certificate verification failed" | 
|  | 8506 |  | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8507 | # With USE_PSA enabled we expect only partial restartable behaviour: | 
|  | 8508 | # everything except ECDH (where TLS calls PSA directly). | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8509 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8510 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8511 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8512 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (USE_PSA)" \ | 
|  | 8513 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
|  | 8514 | crt_file=data_files/server5-badsign.crt \ | 
|  | 8515 | key_file=data_files/server5.key" \ | 
|  | 8516 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8517 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 8518 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ | 
|  | 8519 | 0 \ | 
|  | 8520 | -c "x509_verify_cert.*4b00" \ | 
|  | 8521 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8522 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8523 | -c "mbedtls_pk_sign.*4b00" \ | 
|  | 8524 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 8525 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 8526 | -C "X509 - Certificate verification failed" | 
|  | 8527 |  | 
|  | 8528 | # With USE_PSA disabled we expect full restartable behaviour. | 
|  | 8529 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 8530 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8531 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8532 | 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] | 8533 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8534 | crt_file=data_files/server5-badsign.crt \ | 
|  | 8535 | key_file=data_files/server5.key" \ | 
|  | 8536 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8537 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 8538 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ | 
|  | 8539 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8540 | -C "x509_verify_cert.*4b00" \ | 
|  | 8541 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8542 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8543 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8544 | -C "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 8545 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 8546 | -C "X509 - Certificate verification failed" | 
|  | 8547 |  | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8548 | # With USE_PSA enabled we expect only partial restartable behaviour: | 
|  | 8549 | # everything except ECDH (where TLS calls PSA directly). | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8550 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8551 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8552 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8553 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=none badsign (USE_PSA)" \ | 
|  | 8554 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
|  | 8555 | crt_file=data_files/server5-badsign.crt \ | 
|  | 8556 | key_file=data_files/server5.key" \ | 
|  | 8557 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8558 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 8559 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ | 
|  | 8560 | 0 \ | 
|  | 8561 | -C "x509_verify_cert.*4b00" \ | 
|  | 8562 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8563 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8564 | -c "mbedtls_pk_sign.*4b00" \ | 
|  | 8565 | -C "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 8566 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 8567 | -C "X509 - Certificate verification failed" | 
|  | 8568 |  | 
|  | 8569 | # With USE_PSA disabled we expect full restartable behaviour. | 
|  | 8570 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 8571 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8572 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8573 | run_test    "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8574 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8575 | "$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] | 8576 | 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] | 8577 | dtls=1 debug_level=1 ec_max_ops=1000" \ | 
|  | 8578 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8579 | -c "x509_verify_cert.*4b00" \ | 
|  | 8580 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8581 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8582 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8583 |  | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8584 | # With USE_PSA enabled we expect only partial restartable behaviour: | 
|  | 8585 | # everything except ECDH (where TLS calls PSA directly). | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8586 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8587 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8589 | run_test    "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ | 
|  | 8590 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ | 
|  | 8591 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8592 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 8593 | dtls=1 debug_level=1 ec_max_ops=1000" \ | 
|  | 8594 | 0 \ | 
|  | 8595 | -c "x509_verify_cert.*4b00" \ | 
|  | 8596 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8597 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8598 | -c "mbedtls_pk_sign.*4b00" | 
|  | 8599 |  | 
|  | 8600 | # With USE_PSA disabled we expect full restartable behaviour. | 
|  | 8601 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 8602 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8603 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8604 | run_test    "EC restart: TLS, max_ops=1000 no client auth (no USE_PSA)" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8605 | "$P_SRV curves=secp256r1" \ | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8606 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8607 | debug_level=1 ec_max_ops=1000" \ | 
|  | 8608 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8609 | -c "x509_verify_cert.*4b00" \ | 
|  | 8610 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 8611 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8612 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8613 |  | 
| Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8614 |  | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8615 | # With USE_PSA enabled we expect only partial restartable behaviour: | 
|  | 8616 | # everything except ECDH (where TLS calls PSA directly). | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8617 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8618 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8619 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 8620 | run_test    "EC restart: TLS, max_ops=1000 no client auth (USE_PSA)" \ | 
|  | 8621 | "$P_SRV curves=secp256r1" \ | 
|  | 8622 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8623 | debug_level=1 ec_max_ops=1000" \ | 
|  | 8624 | 0 \ | 
|  | 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" | 
|  | 8629 |  | 
| Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8630 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no | 
|  | 8631 | # restartable behaviour at all (not even client auth). | 
|  | 8632 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, | 
|  | 8633 | # and all 4 assertions negated. | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8634 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 8635 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8636 | run_test    "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ | 
|  | 8637 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
|  | 8638 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8639 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 8640 | debug_level=1 ec_max_ops=1000" \ | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8641 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8642 | -C "x509_verify_cert.*4b00" \ | 
|  | 8643 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 8644 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 8645 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8646 |  | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8647 | # Tests of asynchronous private key support in SSL | 
|  | 8648 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8649 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8650 | run_test    "SSL async private: sign, delay=0" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8651 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8652 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8653 | "$P_CLI" \ | 
|  | 8654 | 0 \ | 
|  | 8655 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8656 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8657 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8658 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8659 | run_test    "SSL async private: sign, delay=1" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8660 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8661 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8662 | "$P_CLI" \ | 
|  | 8663 | 0 \ | 
|  | 8664 | -s "Async sign callback: using key slot " \ | 
|  | 8665 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8666 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 8667 |  | 
| Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8668 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 8669 | run_test    "SSL async private: sign, delay=2" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8670 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8671 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ | 
|  | 8672 | "$P_CLI" \ | 
|  | 8673 | 0 \ | 
|  | 8674 | -s "Async sign callback: using key slot " \ | 
|  | 8675 | -U "Async sign callback: using key slot " \ | 
|  | 8676 | -s "Async resume (slot [0-9]): call 1 more times." \ | 
|  | 8677 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 8678 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 8679 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8680 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8681 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8682 | run_test    "SSL async private: sign, SNI" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8683 | "$P_SRV force_version=tls12 debug_level=3 \ | 
| Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8684 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ | 
|  | 8685 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 8686 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 8687 | "$P_CLI server_name=polarssl.example" \ | 
|  | 8688 | 0 \ | 
|  | 8689 | -s "Async sign callback: using key slot " \ | 
|  | 8690 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 8691 | -s "parse ServerName extension" \ | 
|  | 8692 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 8693 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 8694 |  | 
|  | 8695 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8696 | run_test    "SSL async private: decrypt, delay=0" \ | 
|  | 8697 | "$P_SRV \ | 
|  | 8698 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 8699 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8700 | 0 \ | 
|  | 8701 | -s "Async decrypt callback: using key slot " \ | 
|  | 8702 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 8703 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8704 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8705 | run_test    "SSL async private: decrypt, delay=1" \ | 
|  | 8706 | "$P_SRV \ | 
|  | 8707 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 8708 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8709 | 0 \ | 
|  | 8710 | -s "Async decrypt callback: using key slot " \ | 
|  | 8711 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 8712 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 8713 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8714 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8715 | run_test    "SSL async private: decrypt RSA-PSK, delay=0" \ | 
|  | 8716 | "$P_SRV psk=abc123 \ | 
|  | 8717 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 8718 | "$P_CLI psk=abc123 \ | 
|  | 8719 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 8720 | 0 \ | 
|  | 8721 | -s "Async decrypt callback: using key slot " \ | 
|  | 8722 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 8723 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8724 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8725 | run_test    "SSL async private: decrypt RSA-PSK, delay=1" \ | 
|  | 8726 | "$P_SRV psk=abc123 \ | 
|  | 8727 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 8728 | "$P_CLI psk=abc123 \ | 
|  | 8729 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 8730 | 0 \ | 
|  | 8731 | -s "Async decrypt callback: using key slot " \ | 
|  | 8732 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 8733 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 8734 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8735 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8736 | run_test    "SSL async private: sign callback not present" \ | 
|  | 8737 | "$P_SRV \ | 
|  | 8738 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8739 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8740 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8741 | 0 \ | 
|  | 8742 | -S "Async sign callback" \ | 
|  | 8743 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 8744 | -s "The own private key or pre-shared key is not set, but needed" \ | 
|  | 8745 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ | 
|  | 8746 | -s "Successful connection" | 
|  | 8747 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8748 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8749 | run_test    "SSL async private: decrypt callback not present" \ | 
|  | 8750 | "$P_SRV debug_level=1 \ | 
|  | 8751 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
|  | 8752 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; | 
| Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 8753 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8754 | 0 \ | 
|  | 8755 | -S "Async decrypt callback" \ | 
|  | 8756 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 8757 | -s "got no RSA private key" \ | 
|  | 8758 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 8759 | -s "Successful connection" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8760 |  | 
|  | 8761 | # key1: ECDSA, key2: RSA; use key1 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8762 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8763 | run_test    "SSL async private: slot 0 used with key1" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8764 | "$P_SRV \ | 
|  | 8765 | async_operations=s async_private_delay1=1 \ | 
|  | 8766 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 8767 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8768 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 8769 | 0 \ | 
|  | 8770 | -s "Async sign callback: using key slot 0," \ | 
|  | 8771 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8772 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8773 |  | 
|  | 8774 | # key1: ECDSA, key2: RSA; use key2 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8775 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8776 | run_test    "SSL async private: slot 0 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8777 | "$P_SRV \ | 
|  | 8778 | async_operations=s async_private_delay2=1 \ | 
|  | 8779 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 8780 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8781 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 8782 | 0 \ | 
|  | 8783 | -s "Async sign callback: using key slot 0," \ | 
|  | 8784 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8785 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8786 |  | 
|  | 8787 | # key1: ECDSA, key2: RSA; use key2 from slot 1 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8788 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8789 | run_test    "SSL async private: slot 1 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8790 | "$P_SRV \ | 
| Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8791 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8792 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 8793 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8794 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 8795 | 0 \ | 
|  | 8796 | -s "Async sign callback: using key slot 1," \ | 
|  | 8797 | -s "Async resume (slot 1): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8798 | -s "Async resume (slot 1): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8799 |  | 
|  | 8800 | # key1: ECDSA, key2: RSA; use key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8801 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8802 | run_test    "SSL async private: fall back to transparent key" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8803 | "$P_SRV \ | 
|  | 8804 | async_operations=s async_private_delay1=1 \ | 
|  | 8805 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 8806 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8807 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 8808 | 0 \ | 
|  | 8809 | -s "Async sign callback: no key matches this certificate." | 
|  | 8810 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8811 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8812 | run_test    "SSL async private: sign, error in start" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8813 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8814 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8815 | async_private_error=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8816 | "$P_CLI" \ | 
|  | 8817 | 1 \ | 
|  | 8818 | -s "Async sign callback: injected error" \ | 
|  | 8819 | -S "Async resume" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8820 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8821 | -s "! mbedtls_ssl_handshake returned" | 
|  | 8822 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8823 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8824 | run_test    "SSL async private: sign, cancel after start" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8825 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8826 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8827 | async_private_error=2" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8828 | "$P_CLI" \ | 
|  | 8829 | 1 \ | 
|  | 8830 | -s "Async sign callback: using key slot " \ | 
|  | 8831 | -S "Async resume" \ | 
|  | 8832 | -s "Async cancel" | 
|  | 8833 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8834 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8835 | run_test    "SSL async private: sign, error in resume" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8836 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8837 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8838 | async_private_error=3" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8839 | "$P_CLI" \ | 
|  | 8840 | 1 \ | 
|  | 8841 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8842 | -s "Async resume callback: sign done but injected error" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8843 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8844 | -s "! mbedtls_ssl_handshake returned" | 
|  | 8845 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8846 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8847 | run_test    "SSL async private: decrypt, error in start" \ | 
|  | 8848 | "$P_SRV \ | 
|  | 8849 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8850 | async_private_error=1" \ | 
|  | 8851 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8852 | 1 \ | 
|  | 8853 | -s "Async decrypt callback: injected error" \ | 
|  | 8854 | -S "Async resume" \ | 
|  | 8855 | -S "Async cancel" \ | 
|  | 8856 | -s "! mbedtls_ssl_handshake returned" | 
|  | 8857 |  | 
|  | 8858 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 8859 | run_test    "SSL async private: decrypt, cancel after start" \ | 
|  | 8860 | "$P_SRV \ | 
|  | 8861 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8862 | async_private_error=2" \ | 
|  | 8863 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8864 | 1 \ | 
|  | 8865 | -s "Async decrypt callback: using key slot " \ | 
|  | 8866 | -S "Async resume" \ | 
|  | 8867 | -s "Async cancel" | 
|  | 8868 |  | 
|  | 8869 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 8870 | run_test    "SSL async private: decrypt, error in resume" \ | 
|  | 8871 | "$P_SRV \ | 
|  | 8872 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8873 | async_private_error=3" \ | 
|  | 8874 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8875 | 1 \ | 
|  | 8876 | -s "Async decrypt callback: using key slot " \ | 
|  | 8877 | -s "Async resume callback: decrypt done but injected error" \ | 
|  | 8878 | -S "Async cancel" \ | 
|  | 8879 | -s "! mbedtls_ssl_handshake returned" | 
|  | 8880 |  | 
|  | 8881 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8882 | run_test    "SSL async private: cancel after start then operate correctly" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8883 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8884 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8885 | async_private_error=-2" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8886 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 8887 | 0 \ | 
|  | 8888 | -s "Async cancel" \ | 
|  | 8889 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 8890 | -s "Async resume" \ | 
|  | 8891 | -s "Successful connection" | 
|  | 8892 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8893 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8894 | run_test    "SSL async private: error in resume then operate correctly" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8895 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8896 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8897 | async_private_error=-3" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8898 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 8899 | 0 \ | 
|  | 8900 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 8901 | -s "Async resume" \ | 
|  | 8902 | -s "Successful connection" | 
|  | 8903 |  | 
|  | 8904 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8905 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 8906 | # Note: the function "detect_required_features()" is not able to detect more than | 
|  | 8907 | #       one "force_ciphersuite" per client/server and it only picks the 2nd one. | 
|  | 8908 | #       Therefore the 1st one is added explicitly here | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 8909 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8910 | 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] | 8911 | "$P_SRV \ | 
|  | 8912 | async_operations=s async_private_delay1=1 async_private_error=-2 \ | 
|  | 8913 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 8914 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8915 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 8916 | [ \$? -eq 1 ] && | 
|  | 8917 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 8918 | 0 \ | 
| Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8919 | -s "Async sign callback: using key slot 0" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8920 | -S "Async resume" \ | 
|  | 8921 | -s "Async cancel" \ | 
|  | 8922 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 8923 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 8924 | -s "Successful connection" | 
|  | 8925 |  | 
|  | 8926 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8927 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 8928 | # Note: the function "detect_required_features()" is not able to detect more than | 
|  | 8929 | #       one "force_ciphersuite" per client/server and it only picks the 2nd one. | 
|  | 8930 | #       Therefore the 1st one is added explicitly here | 
| Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 8931 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8932 | 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] | 8933 | "$P_SRV \ | 
|  | 8934 | async_operations=s async_private_delay1=1 async_private_error=-3 \ | 
|  | 8935 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 8936 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8937 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 8938 | [ \$? -eq 1 ] && | 
|  | 8939 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 8940 | 0 \ | 
|  | 8941 | -s "Async resume" \ | 
|  | 8942 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 8943 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 8944 | -s "Successful connection" | 
|  | 8945 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8946 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8947 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8948 | run_test    "SSL async private: renegotiation: client-initiated, sign" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8949 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8950 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8951 | exchanges=2 renegotiation=1" \ | 
|  | 8952 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 8953 | 0 \ | 
|  | 8954 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8955 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8956 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8957 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8958 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8959 | run_test    "SSL async private: renegotiation: server-initiated, sign" \ | 
| Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8960 | "$P_SRV force_version=tls12 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8961 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8962 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 8963 | "$P_CLI exchanges=2 renegotiation=1" \ | 
|  | 8964 | 0 \ | 
|  | 8965 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8966 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 8967 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8968 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8969 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8970 | run_test    "SSL async private: renegotiation: client-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8971 | "$P_SRV \ | 
|  | 8972 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8973 | exchanges=2 renegotiation=1" \ | 
|  | 8974 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 8975 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8976 | 0 \ | 
|  | 8977 | -s "Async decrypt callback: using key slot " \ | 
|  | 8978 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 8979 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8980 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8981 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8982 | run_test    "SSL async private: renegotiation: server-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8983 | "$P_SRV \ | 
|  | 8984 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 8985 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 8986 | "$P_CLI exchanges=2 renegotiation=1 \ | 
|  | 8987 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8988 | 0 \ | 
|  | 8989 | -s "Async decrypt callback: using key slot " \ | 
|  | 8990 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8991 |  | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8992 | # Tests for ECC extensions (rfc 4492) | 
|  | 8993 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8994 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8995 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8996 | requires_hash_alg SHA_256 | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8997 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8998 | run_test    "Force a non ECC ciphersuite in the client side" \ | 
|  | 8999 | "$P_SRV debug_level=3" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9000 | "$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] | 9001 | 0 \ | 
| Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9002 | -C "client hello, adding supported_groups extension" \ | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9003 | -C "client hello, adding supported_point_formats extension" \ | 
|  | 9004 | -S "found supported elliptic curves extension" \ | 
|  | 9005 | -S "found supported point formats extension" | 
|  | 9006 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9007 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9008 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9009 | requires_hash_alg SHA_256 | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9010 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9011 | run_test    "Force a non ECC ciphersuite in the server side" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9012 | "$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] | 9013 | "$P_CLI debug_level=3" \ | 
|  | 9014 | 0 \ | 
|  | 9015 | -C "found supported_point_formats extension" \ | 
|  | 9016 | -S "server hello, supported_point_formats extension" | 
|  | 9017 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9018 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9019 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9020 | requires_hash_alg SHA_256 | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9021 | run_test    "Force an ECC ciphersuite in the client side" \ | 
|  | 9022 | "$P_SRV debug_level=3" \ | 
|  | 9023 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 9024 | 0 \ | 
| Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9025 | -c "client hello, adding supported_groups extension" \ | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9026 | -c "client hello, adding supported_point_formats extension" \ | 
|  | 9027 | -s "found supported elliptic curves extension" \ | 
|  | 9028 | -s "found supported point formats extension" | 
|  | 9029 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9030 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9031 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9032 | requires_hash_alg SHA_256 | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9033 | run_test    "Force an ECC ciphersuite in the server side" \ | 
|  | 9034 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 9035 | "$P_CLI debug_level=3" \ | 
|  | 9036 | 0 \ | 
|  | 9037 | -c "found supported_point_formats extension" \ | 
|  | 9038 | -s "server hello, supported_point_formats extension" | 
|  | 9039 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9040 | # Tests for DTLS HelloVerifyRequest | 
|  | 9041 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9043 | run_test    "DTLS cookie: enabled" \ | 
|  | 9044 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 9045 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 9046 | 0 \ | 
|  | 9047 | -s "cookie verification failed" \ | 
|  | 9048 | -s "cookie verification passed" \ | 
|  | 9049 | -S "cookie verification skipped" \ | 
|  | 9050 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9051 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9052 | -S "SSL - The requested feature is not available" | 
|  | 9053 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9055 | run_test    "DTLS cookie: disabled" \ | 
|  | 9056 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ | 
|  | 9057 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 9058 | 0 \ | 
|  | 9059 | -S "cookie verification failed" \ | 
|  | 9060 | -S "cookie verification passed" \ | 
|  | 9061 | -s "cookie verification skipped" \ | 
|  | 9062 | -C "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9063 | -S "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9064 | -S "SSL - The requested feature is not available" | 
|  | 9065 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9066 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9067 | run_test    "DTLS cookie: default (failing)" \ | 
|  | 9068 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ | 
|  | 9069 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ | 
|  | 9070 | 1 \ | 
|  | 9071 | -s "cookie verification failed" \ | 
|  | 9072 | -S "cookie verification passed" \ | 
|  | 9073 | -S "cookie verification skipped" \ | 
|  | 9074 | -C "received hello verify request" \ | 
|  | 9075 | -S "hello verification requested" \ | 
|  | 9076 | -s "SSL - The requested feature is not available" | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9077 |  | 
|  | 9078 | requires_ipv6 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9080 | run_test    "DTLS cookie: enabled, IPv6" \ | 
|  | 9081 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 9082 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 9083 | 0 \ | 
|  | 9084 | -s "cookie verification failed" \ | 
|  | 9085 | -s "cookie verification passed" \ | 
|  | 9086 | -S "cookie verification skipped" \ | 
|  | 9087 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9088 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9089 | -S "SSL - The requested feature is not available" | 
|  | 9090 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9092 | run_test    "DTLS cookie: enabled, nbio" \ | 
|  | 9093 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ | 
|  | 9094 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 9095 | 0 \ | 
|  | 9096 | -s "cookie verification failed" \ | 
|  | 9097 | -s "cookie verification passed" \ | 
|  | 9098 | -S "cookie verification skipped" \ | 
|  | 9099 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9100 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9101 | -S "SSL - The requested feature is not available" | 
|  | 9102 |  | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9103 | # Tests for client reconnecting from the same port with DTLS | 
|  | 9104 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9105 | not_with_valgrind # spurious resend | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9107 | run_test    "DTLS client reconnect from same port: reference" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9108 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ | 
|  | 9109 | "$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] | 9110 | 0 \ | 
|  | 9111 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9112 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9113 | -S "Client initiated reconnection from same port" | 
|  | 9114 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9115 | not_with_valgrind # spurious resend | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9117 | run_test    "DTLS client reconnect from same port: reconnect" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9118 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ | 
|  | 9119 | "$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] | 9120 | 0 \ | 
|  | 9121 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9122 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9123 | -s "Client initiated reconnection from same port" | 
|  | 9124 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9125 | 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] | 9126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9127 | 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] | 9128 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ | 
|  | 9129 | "$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] | 9130 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9131 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9132 | -s "Client initiated reconnection from same port" | 
|  | 9133 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9134 | 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] | 9135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9136 | run_test    "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ | 
|  | 9137 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ | 
|  | 9138 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ | 
|  | 9139 | 0 \ | 
|  | 9140 | -S "The operation timed out" \ | 
|  | 9141 | -s "Client initiated reconnection from same port" | 
|  | 9142 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9144 | run_test    "DTLS client reconnect from same port: no cookies" \ | 
|  | 9145 | "$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] | 9146 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ | 
|  | 9147 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9148 | -s "The operation timed out" \ | 
|  | 9149 | -S "Client initiated reconnection from same port" | 
|  | 9150 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9152 | run_test    "DTLS client reconnect from same port: attacker-injected" \ | 
|  | 9153 | -p "$P_PXY inject_clihlo=1" \ | 
|  | 9154 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ | 
|  | 9155 | "$P_CLI dtls=1 exchanges=2" \ | 
|  | 9156 | 0 \ | 
|  | 9157 | -s "possible client reconnect from the same port" \ | 
|  | 9158 | -S "Client initiated reconnection from same port" | 
|  | 9159 |  | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9160 | # Tests for various cases of client authentication with DTLS | 
|  | 9161 | # (focused on handshake flows and message parsing) | 
|  | 9162 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9164 | run_test    "DTLS client auth: required" \ | 
|  | 9165 | "$P_SRV dtls=1 auth_mode=required" \ | 
|  | 9166 | "$P_CLI dtls=1" \ | 
|  | 9167 | 0 \ | 
|  | 9168 | -s "Verifying peer X.509 certificate... ok" | 
|  | 9169 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9171 | run_test    "DTLS client auth: optional, client has no cert" \ | 
|  | 9172 | "$P_SRV dtls=1 auth_mode=optional" \ | 
|  | 9173 | "$P_CLI dtls=1 crt_file=none key_file=none" \ | 
|  | 9174 | 0 \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9175 | -s "! Certificate was missing" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9176 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9178 | run_test    "DTLS client auth: none, client has no cert" \ | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9179 | "$P_SRV dtls=1 auth_mode=none" \ | 
|  | 9180 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ | 
|  | 9181 | 0 \ | 
|  | 9182 | -c "skip write certificate$" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9183 | -s "! Certificate verification was skipped" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9184 |  | 
| Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9185 | run_test    "DTLS wrong PSK: badmac alert" \ | 
|  | 9186 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ | 
|  | 9187 | "$P_CLI dtls=1 psk=abc124" \ | 
|  | 9188 | 1 \ | 
|  | 9189 | -s "SSL - Verification of the message MAC failed" \ | 
|  | 9190 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 9191 |  | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9192 | # Tests for receiving fragmented handshake messages with DTLS | 
|  | 9193 |  | 
|  | 9194 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9196 | run_test    "DTLS reassembly: no fragmentation (gnutls server)" \ | 
|  | 9197 | "$G_SRV -u --mtu 2048 -a" \ | 
|  | 9198 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 9199 | 0 \ | 
|  | 9200 | -C "found fragmented DTLS handshake message" \ | 
|  | 9201 | -C "error" | 
|  | 9202 |  | 
|  | 9203 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9205 | run_test    "DTLS reassembly: some fragmentation (gnutls server)" \ | 
|  | 9206 | "$G_SRV -u --mtu 512" \ | 
|  | 9207 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 9208 | 0 \ | 
|  | 9209 | -c "found fragmented DTLS handshake message" \ | 
|  | 9210 | -C "error" | 
|  | 9211 |  | 
|  | 9212 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9214 | run_test    "DTLS reassembly: more fragmentation (gnutls server)" \ | 
|  | 9215 | "$G_SRV -u --mtu 128" \ | 
|  | 9216 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 9217 | 0 \ | 
|  | 9218 | -c "found fragmented DTLS handshake message" \ | 
|  | 9219 | -C "error" | 
|  | 9220 |  | 
|  | 9221 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9223 | run_test    "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ | 
|  | 9224 | "$G_SRV -u --mtu 128" \ | 
|  | 9225 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 9226 | 0 \ | 
|  | 9227 | -c "found fragmented DTLS handshake message" \ | 
|  | 9228 | -C "error" | 
|  | 9229 |  | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9230 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9231 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9233 | run_test    "DTLS reassembly: fragmentation, renego (gnutls server)" \ | 
|  | 9234 | "$G_SRV -u --mtu 256" \ | 
|  | 9235 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 9236 | 0 \ | 
|  | 9237 | -c "found fragmented DTLS handshake message" \ | 
|  | 9238 | -c "client hello, adding renegotiation extension" \ | 
|  | 9239 | -c "found renegotiation extension" \ | 
|  | 9240 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9241 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9242 | -C "error" \ | 
|  | 9243 | -s "Extra-header:" | 
|  | 9244 |  | 
|  | 9245 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9246 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9248 | run_test    "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ | 
|  | 9249 | "$G_SRV -u --mtu 256" \ | 
|  | 9250 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 9251 | 0 \ | 
|  | 9252 | -c "found fragmented DTLS handshake message" \ | 
|  | 9253 | -c "client hello, adding renegotiation extension" \ | 
|  | 9254 | -c "found renegotiation extension" \ | 
|  | 9255 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9256 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9257 | -C "error" \ | 
|  | 9258 | -s "Extra-header:" | 
|  | 9259 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9261 | run_test    "DTLS reassembly: no fragmentation (openssl server)" \ | 
|  | 9262 | "$O_SRV -dtls -mtu 2048" \ | 
|  | 9263 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 9264 | 0 \ | 
|  | 9265 | -C "found fragmented DTLS handshake message" \ | 
|  | 9266 | -C "error" | 
|  | 9267 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9269 | run_test    "DTLS reassembly: some fragmentation (openssl server)" \ | 
| Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 9270 | "$O_SRV -dtls -mtu 256" \ | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9271 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 9272 | 0 \ | 
|  | 9273 | -c "found fragmented DTLS handshake message" \ | 
|  | 9274 | -C "error" | 
|  | 9275 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9277 | run_test    "DTLS reassembly: more fragmentation (openssl server)" \ | 
|  | 9278 | "$O_SRV -dtls -mtu 256" \ | 
|  | 9279 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 9280 | 0 \ | 
|  | 9281 | -c "found fragmented DTLS handshake message" \ | 
|  | 9282 | -C "error" | 
|  | 9283 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9285 | run_test    "DTLS reassembly: fragmentation, nbio (openssl server)" \ | 
|  | 9286 | "$O_SRV -dtls -mtu 256" \ | 
|  | 9287 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 9288 | 0 \ | 
|  | 9289 | -c "found fragmented DTLS handshake message" \ | 
|  | 9290 | -C "error" | 
|  | 9291 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9292 | # Tests for sending fragmented handshake messages with DTLS | 
|  | 9293 | # | 
|  | 9294 | # Use client auth when we need the client to send large messages, | 
|  | 9295 | # and use large cert chains on both sides too (the long chains we have all use | 
|  | 9296 | # both RSA and ECDSA, but ideally we should have long chains with either). | 
|  | 9297 | # Sizes reached (UDP payload): | 
|  | 9298 | # - 2037B for server certificate | 
|  | 9299 | # - 1542B for client certificate | 
|  | 9300 | # - 1013B for newsessionticket | 
|  | 9301 | # - all others below 512B | 
|  | 9302 | # All those tests assume MAX_CONTENT_LEN is at least 2048 | 
|  | 9303 |  | 
|  | 9304 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9305 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9306 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9307 | requires_max_content_len 4096 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9309 | run_test    "DTLS fragmenting: none (for reference)" \ | 
|  | 9310 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9311 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9312 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9313 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9314 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9315 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9316 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9317 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9318 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9319 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9320 | 0 \ | 
|  | 9321 | -S "found fragmented DTLS handshake message" \ | 
|  | 9322 | -C "found fragmented DTLS handshake message" \ | 
|  | 9323 | -C "error" | 
|  | 9324 |  | 
|  | 9325 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9326 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9327 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9328 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9330 | run_test    "DTLS fragmenting: server only (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9331 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9332 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9333 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9334 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9335 | max_frag_len=1024" \ | 
|  | 9336 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9337 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9338 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9339 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9340 | max_frag_len=2048" \ | 
|  | 9341 | 0 \ | 
|  | 9342 | -S "found fragmented DTLS handshake message" \ | 
|  | 9343 | -c "found fragmented DTLS handshake message" \ | 
|  | 9344 | -C "error" | 
|  | 9345 |  | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9346 | # With the MFL extension, the server has no way of forcing | 
|  | 9347 | # the client to not exceed a certain MTU; hence, the following | 
|  | 9348 | # test can't be replicated with an MTU proxy such as the one | 
|  | 9349 | # `client-initiated, server only (max_frag_len)` below. | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9350 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9351 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9352 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9353 | requires_max_content_len 4096 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9355 | run_test    "DTLS fragmenting: server only (more) (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9356 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9357 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9358 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9359 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9360 | max_frag_len=512" \ | 
|  | 9361 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9362 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9363 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9364 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9365 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9366 | 0 \ | 
|  | 9367 | -S "found fragmented DTLS handshake message" \ | 
|  | 9368 | -c "found fragmented DTLS handshake message" \ | 
|  | 9369 | -C "error" | 
|  | 9370 |  | 
|  | 9371 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9372 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9373 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9374 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9376 | 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] | 9377 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 9378 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9379 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9380 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9381 | max_frag_len=2048" \ | 
|  | 9382 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9383 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9384 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9385 | hs_timeout=2500-60000 \ | 
|  | 9386 | max_frag_len=1024" \ | 
|  | 9387 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9388 | -S "found fragmented DTLS handshake message" \ | 
|  | 9389 | -c "found fragmented DTLS handshake message" \ | 
|  | 9390 | -C "error" | 
|  | 9391 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9392 | # While not required by the standard defining the MFL extension | 
|  | 9393 | # (according to which it only applies to records, not to datagrams), | 
|  | 9394 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 9395 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 9396 | # to the peer. | 
|  | 9397 | # The next test checks that no datagrams significantly larger than the | 
|  | 9398 | # negotiated MFL are sent. | 
|  | 9399 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9400 | requires_config_enabled MBEDTLS_RSA_C | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9401 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9402 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9404 | 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] | 9405 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9406 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 9407 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9408 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9409 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9410 | max_frag_len=2048" \ | 
|  | 9411 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9412 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9413 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9414 | hs_timeout=2500-60000 \ | 
|  | 9415 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9416 | 0 \ | 
|  | 9417 | -S "found fragmented DTLS handshake message" \ | 
|  | 9418 | -c "found fragmented DTLS handshake message" \ | 
|  | 9419 | -C "error" | 
|  | 9420 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9421 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9422 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9423 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9424 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9426 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9427 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9428 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9429 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9430 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9431 | max_frag_len=2048" \ | 
|  | 9432 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9433 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9434 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9435 | hs_timeout=2500-60000 \ | 
|  | 9436 | max_frag_len=1024" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9437 | 0 \ | 
|  | 9438 | -s "found fragmented DTLS handshake message" \ | 
|  | 9439 | -c "found fragmented DTLS handshake message" \ | 
|  | 9440 | -C "error" | 
|  | 9441 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9442 | # While not required by the standard defining the MFL extension | 
|  | 9443 | # (according to which it only applies to records, not to datagrams), | 
|  | 9444 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 9445 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 9446 | # to the peer. | 
|  | 9447 | # The next test checks that no datagrams significantly larger than the | 
|  | 9448 | # negotiated MFL are sent. | 
|  | 9449 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9450 | requires_config_enabled MBEDTLS_RSA_C | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9451 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9452 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9454 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ | 
| Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9455 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9456 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9457 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9458 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9459 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9460 | max_frag_len=2048" \ | 
|  | 9461 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9462 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9463 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9464 | hs_timeout=2500-60000 \ | 
|  | 9465 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9466 | 0 \ | 
|  | 9467 | -s "found fragmented DTLS handshake message" \ | 
|  | 9468 | -c "found fragmented DTLS handshake message" \ | 
|  | 9469 | -C "error" | 
|  | 9470 |  | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9471 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9472 | requires_config_enabled MBEDTLS_RSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9473 | requires_max_content_len 4096 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9475 | run_test    "DTLS fragmenting: none (for reference) (MTU)" \ | 
|  | 9476 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9477 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9478 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9479 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9480 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9481 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9482 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9483 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9484 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9485 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9486 | 0 \ | 
|  | 9487 | -S "found fragmented DTLS handshake message" \ | 
|  | 9488 | -C "found fragmented DTLS handshake message" \ | 
|  | 9489 | -C "error" | 
|  | 9490 |  | 
|  | 9491 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9492 | requires_config_enabled MBEDTLS_RSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9493 | requires_max_content_len 4096 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9495 | run_test    "DTLS fragmenting: client (MTU)" \ | 
|  | 9496 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9497 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9498 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9499 | hs_timeout=3500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9500 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9501 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9502 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9503 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9504 | hs_timeout=3500-60000 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9505 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9506 | 0 \ | 
|  | 9507 | -s "found fragmented DTLS handshake message" \ | 
|  | 9508 | -C "found fragmented DTLS handshake message" \ | 
|  | 9509 | -C "error" | 
|  | 9510 |  | 
|  | 9511 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9512 | requires_config_enabled MBEDTLS_RSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9513 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9515 | run_test    "DTLS fragmenting: server (MTU)" \ | 
|  | 9516 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9517 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9518 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9519 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9520 | mtu=512" \ | 
|  | 9521 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9522 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9523 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9524 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9525 | mtu=2048" \ | 
|  | 9526 | 0 \ | 
|  | 9527 | -S "found fragmented DTLS handshake message" \ | 
|  | 9528 | -c "found fragmented DTLS handshake message" \ | 
|  | 9529 | -C "error" | 
|  | 9530 |  | 
|  | 9531 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9532 | requires_config_enabled MBEDTLS_RSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9533 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9535 | run_test    "DTLS fragmenting: both (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9536 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9537 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9538 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9539 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9540 | hs_timeout=2500-60000 \ | 
| Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9541 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9542 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9543 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9544 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9545 | hs_timeout=2500-60000 \ | 
|  | 9546 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9547 | 0 \ | 
|  | 9548 | -s "found fragmented DTLS handshake message" \ | 
|  | 9549 | -c "found fragmented DTLS handshake message" \ | 
|  | 9550 | -C "error" | 
|  | 9551 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9552 | # 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] | 9553 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9554 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9555 | requires_hash_alg SHA_256 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9556 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9557 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9558 | requires_max_content_len 2048 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9559 | run_test    "DTLS fragmenting: both (MTU=512)" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9560 | -p "$P_PXY mtu=512" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9561 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9562 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9563 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9564 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9565 | mtu=512" \ | 
|  | 9566 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9567 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9568 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9569 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 9570 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9571 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9572 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9573 | -s "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9574 | -c "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9575 | -C "error" | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9576 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9577 | # Test for automatic MTU reduction on repeated resend. | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9578 | # 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] | 9579 | # The ratio of max/min timeout should ideally equal 4 to accept two | 
|  | 9580 | # retransmissions, but in some cases (like both the server and client using | 
|  | 9581 | # fragmentation and auto-reduction) an extra retransmission might occur, | 
|  | 9582 | # hence the ratio of 8. | 
| Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9583 | not_with_valgrind | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9584 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9585 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9586 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9587 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9588 | requires_max_content_len 2048 | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9589 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9590 | -p "$P_PXY mtu=508" \ | 
|  | 9591 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9592 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9593 | key_file=data_files/server7.key \ | 
|  | 9594 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9595 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9596 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9597 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9598 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 9599 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9600 | 0 \ | 
|  | 9601 | -s "found fragmented DTLS handshake message" \ | 
|  | 9602 | -c "found fragmented DTLS handshake message" \ | 
|  | 9603 | -C "error" | 
|  | 9604 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9605 | # 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] | 9606 | only_with_valgrind | 
|  | 9607 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9608 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9609 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9610 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9611 | requires_max_content_len 2048 | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9612 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9613 | -p "$P_PXY mtu=508" \ | 
|  | 9614 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9615 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9616 | key_file=data_files/server7.key \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9617 | hs_timeout=250-10000" \ | 
|  | 9618 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9619 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9620 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9621 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9622 | hs_timeout=250-10000" \ | 
|  | 9623 | 0 \ | 
|  | 9624 | -s "found fragmented DTLS handshake message" \ | 
|  | 9625 | -c "found fragmented DTLS handshake message" \ | 
|  | 9626 | -C "error" | 
|  | 9627 |  | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9628 | # 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] | 9629 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 9630 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9631 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9632 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9633 | requires_config_enabled MBEDTLS_RSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9634 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9636 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9637 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9638 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9639 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9640 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9641 | hs_timeout=10000-60000 \ | 
|  | 9642 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9643 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9644 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9645 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9646 | hs_timeout=10000-60000 \ | 
|  | 9647 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9648 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9649 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9650 | -s "found fragmented DTLS handshake message" \ | 
|  | 9651 | -c "found fragmented DTLS handshake message" \ | 
|  | 9652 | -C "error" | 
|  | 9653 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9654 | # 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] | 9655 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend | 
|  | 9656 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 9657 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9658 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9659 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9660 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9661 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9662 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9663 | requires_max_content_len 2048 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9664 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9665 | -p "$P_PXY mtu=512" \ | 
|  | 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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9669 | hs_timeout=10000-60000 \ | 
|  | 9670 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9674 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 9675 | hs_timeout=10000-60000 \ | 
|  | 9676 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9677 | 0 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9678 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9679 | -s "found fragmented DTLS handshake message" \ | 
|  | 9680 | -c "found fragmented DTLS handshake message" \ | 
|  | 9681 | -C "error" | 
|  | 9682 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9683 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 9684 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9685 | requires_config_enabled MBEDTLS_RSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9686 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9688 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9689 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9690 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9691 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9692 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9693 | hs_timeout=10000-60000 \ | 
|  | 9694 | mtu=1024 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9695 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9696 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9697 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9698 | hs_timeout=10000-60000 \ | 
|  | 9699 | mtu=1024 nbio=2" \ | 
|  | 9700 | 0 \ | 
|  | 9701 | -S "autoreduction" \ | 
|  | 9702 | -s "found fragmented DTLS handshake message" \ | 
|  | 9703 | -c "found fragmented DTLS handshake message" \ | 
|  | 9704 | -C "error" | 
|  | 9705 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9706 | # 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] | 9707 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 9708 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9709 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9710 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9711 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9712 | requires_max_content_len 2048 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9713 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ | 
|  | 9714 | -p "$P_PXY mtu=512" \ | 
|  | 9715 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9716 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9717 | key_file=data_files/server7.key \ | 
|  | 9718 | hs_timeout=10000-60000 \ | 
|  | 9719 | mtu=512 nbio=2" \ | 
|  | 9720 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9721 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9722 | key_file=data_files/server8.key \ | 
|  | 9723 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 9724 | hs_timeout=10000-60000 \ | 
|  | 9725 | mtu=512 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9726 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9727 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9728 | -s "found fragmented DTLS handshake message" \ | 
|  | 9729 | -c "found fragmented DTLS handshake message" \ | 
|  | 9730 | -C "error" | 
|  | 9731 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9732 | # 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] | 9733 | # This ensures things still work after session_reset(). | 
|  | 9734 | # It also exercises the "resumed handshake" flow. | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9735 | # Since we don't support reading fragmented ClientHello yet, | 
|  | 9736 | # up the MTU to 1450 (larger than ClientHello with session ticket, | 
|  | 9737 | # but still smaller than client's Certificate to ensure fragmentation). | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9738 | # An autoreduction on the client-side might happen if the server is | 
|  | 9739 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
| Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9740 | # reco_delay avoids races where the client reconnects before the server has | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9741 | # resumed listening, which would result in a spurious autoreduction. | 
|  | 9742 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9743 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9744 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9745 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9746 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9747 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9748 | run_test    "DTLS fragmenting: proxy MTU, resumed handshake" \ | 
|  | 9749 | -p "$P_PXY mtu=1450" \ | 
|  | 9750 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9751 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9752 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9753 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9754 | mtu=1450" \ | 
|  | 9755 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9756 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9757 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9758 | hs_timeout=10000-60000 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9759 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 9760 | 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] | 9761 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9762 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9763 | -s "found fragmented DTLS handshake message" \ | 
|  | 9764 | -c "found fragmented DTLS handshake message" \ | 
|  | 9765 | -C "error" | 
|  | 9766 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9767 | # An autoreduction on the client-side might happen if the server is | 
|  | 9768 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 9769 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9770 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9771 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9772 | requires_hash_alg SHA_256 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9773 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 9774 | requires_config_enabled MBEDTLS_CHACHAPOLY_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9775 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9776 | run_test    "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ | 
|  | 9777 | -p "$P_PXY mtu=512" \ | 
|  | 9778 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9779 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9780 | key_file=data_files/server7.key \ | 
|  | 9781 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9782 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9783 | mtu=512" \ | 
|  | 9784 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9785 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9786 | key_file=data_files/server8.key \ | 
|  | 9787 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9788 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9789 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9790 | mtu=512" \ | 
|  | 9791 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9792 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9793 | -s "found fragmented DTLS handshake message" \ | 
|  | 9794 | -c "found fragmented DTLS handshake message" \ | 
|  | 9795 | -C "error" | 
|  | 9796 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9797 | # An autoreduction on the client-side might happen if the server is | 
|  | 9798 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 9799 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9800 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9801 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9802 | requires_hash_alg SHA_256 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9803 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 9804 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9805 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9806 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9807 | run_test    "DTLS fragmenting: proxy MTU, AES-GCM renego" \ | 
|  | 9808 | -p "$P_PXY mtu=512" \ | 
|  | 9809 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9810 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9811 | key_file=data_files/server7.key \ | 
|  | 9812 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9813 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9814 | mtu=512" \ | 
|  | 9815 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9816 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9817 | key_file=data_files/server8.key \ | 
|  | 9818 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9819 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9820 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9821 | mtu=512" \ | 
|  | 9822 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9823 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9824 | -s "found fragmented DTLS handshake message" \ | 
|  | 9825 | -c "found fragmented DTLS handshake message" \ | 
|  | 9826 | -C "error" | 
|  | 9827 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9828 | # An autoreduction on the client-side might happen if the server is | 
|  | 9829 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 9830 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9831 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9832 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9833 | requires_hash_alg SHA_256 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9834 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 9835 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9836 | requires_config_enabled MBEDTLS_CCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9837 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9838 | run_test    "DTLS fragmenting: proxy MTU, AES-CCM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9839 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9840 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9841 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9842 | key_file=data_files/server7.key \ | 
|  | 9843 | exchanges=2 renegotiation=1 \ | 
|  | 9844 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9845 | hs_timeout=10000-60000 \ | 
|  | 9846 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9847 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9848 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9849 | key_file=data_files/server8.key \ | 
|  | 9850 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9851 | hs_timeout=10000-60000 \ | 
|  | 9852 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9853 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9854 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9855 | -s "found fragmented DTLS handshake message" \ | 
|  | 9856 | -c "found fragmented DTLS handshake message" \ | 
|  | 9857 | -C "error" | 
|  | 9858 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9859 | # An autoreduction on the client-side might happen if the server is | 
|  | 9860 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 9861 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9862 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9863 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9864 | requires_hash_alg SHA_256 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9865 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 9866 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9867 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 9868 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9869 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9870 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9871 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9872 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9873 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9874 | key_file=data_files/server7.key \ | 
|  | 9875 | exchanges=2 renegotiation=1 \ | 
|  | 9876 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9877 | hs_timeout=10000-60000 \ | 
|  | 9878 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9879 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9880 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9881 | key_file=data_files/server8.key \ | 
|  | 9882 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9883 | hs_timeout=10000-60000 \ | 
|  | 9884 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9885 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9886 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9887 | -s "found fragmented DTLS handshake message" \ | 
|  | 9888 | -c "found fragmented DTLS handshake message" \ | 
|  | 9889 | -C "error" | 
|  | 9890 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9891 | # An autoreduction on the client-side might happen if the server is | 
|  | 9892 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 9893 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9894 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9895 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9896 | requires_hash_alg SHA_256 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9897 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 9898 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9899 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9900 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9901 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9902 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9903 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9904 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9905 | key_file=data_files/server7.key \ | 
|  | 9906 | exchanges=2 renegotiation=1 \ | 
|  | 9907 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9908 | hs_timeout=10000-60000 \ | 
|  | 9909 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9910 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9911 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9912 | key_file=data_files/server8.key \ | 
|  | 9913 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9914 | hs_timeout=10000-60000 \ | 
|  | 9915 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9916 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9917 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9918 | -s "found fragmented DTLS handshake message" \ | 
|  | 9919 | -c "found fragmented DTLS handshake message" \ | 
|  | 9920 | -C "error" | 
|  | 9921 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9922 | # 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] | 9923 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9924 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9925 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9926 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9927 | client_needs_more_time 2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9928 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9929 | run_test    "DTLS fragmenting: proxy MTU + 3d" \ | 
|  | 9930 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9931 | "$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] | 9932 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9933 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9934 | hs_timeout=250-10000 mtu=512" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9935 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9936 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9937 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9938 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9939 | hs_timeout=250-10000 mtu=512" \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9940 | 0 \ | 
|  | 9941 | -s "found fragmented DTLS handshake message" \ | 
|  | 9942 | -c "found fragmented DTLS handshake message" \ | 
|  | 9943 | -C "error" | 
|  | 9944 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9945 | # 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] | 9946 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9947 | requires_config_enabled MBEDTLS_RSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9948 | requires_config_enabled MBEDTLS_AES_C | 
|  | 9949 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9950 | client_needs_more_time 2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9951 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9952 | run_test    "DTLS fragmenting: proxy MTU + 3d, nbio" \ | 
|  | 9953 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
|  | 9954 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 9955 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 9956 | key_file=data_files/server7.key \ | 
|  | 9957 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 9958 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9959 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9960 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9961 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9962 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 9963 | 0 \ | 
|  | 9964 | -s "found fragmented DTLS handshake message" \ | 
|  | 9965 | -c "found fragmented DTLS handshake message" \ | 
|  | 9966 | -C "error" | 
|  | 9967 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9968 | # interop tests for DTLS fragmentating with reliable connection | 
|  | 9969 | # | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9970 | # here and below we just want to test that the we fragment in a way that | 
|  | 9971 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 9972 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9973 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9974 | requires_gnutls | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9975 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9976 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.2" \ | 
|  | 9977 | "$G_SRV -u" \ | 
|  | 9978 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 9979 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 9980 | key_file=data_files/server8.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9981 | mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9982 | 0 \ | 
|  | 9983 | -c "fragmenting handshake message" \ | 
|  | 9984 | -C "error" | 
|  | 9985 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9986 | # We use --insecure for the GnuTLS client because it expects | 
|  | 9987 | # the hostname / IP it connects to to be the name used in the | 
|  | 9988 | # certificate obtained from the server. Here, however, it | 
|  | 9989 | # connects to 127.0.0.1 while our test certificates use 'localhost' | 
|  | 9990 | # as the server name in the certificate. This will make the | 
| Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9991 | # certificate validation fail, but passing --insecure makes | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9992 | # GnuTLS continue the connection nonetheless. | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9993 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 9994 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9995 | requires_gnutls | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9996 | requires_not_i686 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9997 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9998 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.2" \ | 
| Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 9999 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10000 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 10001 | key_file=data_files/server7.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10002 | mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10003 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10004 | 0 \ | 
|  | 10005 | -s "fragmenting handshake message" | 
|  | 10006 |  | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10007 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 10008 | requires_config_enabled MBEDTLS_RSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10009 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10010 | run_test    "DTLS fragmenting: openssl server, DTLS 1.2" \ | 
|  | 10011 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 10012 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 10013 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 10014 | key_file=data_files/server8.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10015 | mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10016 | 0 \ | 
|  | 10017 | -c "fragmenting handshake message" \ | 
|  | 10018 | -C "error" | 
|  | 10019 |  | 
|  | 10020 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 10021 | requires_config_enabled MBEDTLS_RSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10022 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10023 | run_test    "DTLS fragmenting: openssl client, DTLS 1.2" \ | 
|  | 10024 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 10025 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 10026 | key_file=data_files/server7.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10027 | mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10028 | "$O_CLI -dtls1_2" \ | 
|  | 10029 | 0 \ | 
|  | 10030 | -s "fragmenting handshake message" | 
|  | 10031 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10032 | # interop tests for DTLS fragmentating with unreliable connection | 
|  | 10033 | # | 
|  | 10034 | # again we just want to test that the we fragment in a way that | 
|  | 10035 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 10036 | requires_gnutls_next | 
|  | 10037 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 10038 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10039 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10040 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10041 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ | 
|  | 10042 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 10043 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10044 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10045 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 10046 | key_file=data_files/server8.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10047 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10048 | 0 \ | 
|  | 10049 | -c "fragmenting handshake message" \ | 
|  | 10050 | -C "error" | 
|  | 10051 |  | 
|  | 10052 | requires_gnutls_next | 
|  | 10053 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 10054 | requires_config_enabled MBEDTLS_RSA_C | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10055 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10056 | requires_max_content_len 2048 | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10057 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ | 
|  | 10058 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 10059 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 10060 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 10061 | key_file=data_files/server7.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10062 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10063 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10064 | 0 \ | 
|  | 10065 | -s "fragmenting handshake message" | 
|  | 10066 |  | 
| Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 10067 | ## The test below requires 1.1.1a or higher version of openssl, otherwise | 
|  | 10068 | ## 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] | 10069 | requires_openssl_next | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10070 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 10071 | requires_config_enabled MBEDTLS_RSA_C | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10072 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10073 | requires_max_content_len 2048 | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10074 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ | 
|  | 10075 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
| Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10076 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10077 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 10078 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 10079 | key_file=data_files/server8.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10080 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10081 | 0 \ | 
|  | 10082 | -c "fragmenting handshake message" \ | 
|  | 10083 | -C "error" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10084 |  | 
| Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10085 | ## the test below will time out with certain seed. | 
| Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10086 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) | 
|  | 10087 | skip_next_test | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10088 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 10089 | requires_config_enabled MBEDTLS_RSA_C | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10090 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10091 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10092 | run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ | 
|  | 10093 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 10094 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 10095 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 10096 | key_file=data_files/server7.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10097 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10098 | "$O_CLI -dtls1_2" \ | 
|  | 10099 | 0 \ | 
|  | 10100 | -s "fragmenting handshake message" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10101 |  | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10102 | # Tests for DTLS-SRTP (RFC 5764) | 
|  | 10103 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10105 | run_test  "DTLS-SRTP all profiles supported" \ | 
|  | 10106 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10107 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10108 | 0 \ | 
|  | 10109 | -s "found use_srtp extension" \ | 
|  | 10110 | -s "found srtp profile" \ | 
|  | 10111 | -s "selected srtp profile" \ | 
|  | 10112 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10113 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10114 | -c "client hello, adding use_srtp extension" \ | 
|  | 10115 | -c "found use_srtp extension" \ | 
|  | 10116 | -c "found srtp profile" \ | 
|  | 10117 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10118 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10119 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10120 | -C "error" | 
|  | 10121 |  | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10122 |  | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10123 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10125 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile." \ | 
|  | 10126 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10127 | "$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] | 10128 | 0 \ | 
|  | 10129 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10130 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
|  | 10131 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10132 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10133 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10134 | -c "client hello, adding use_srtp extension" \ | 
|  | 10135 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10136 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10137 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10138 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10139 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10140 | -C "error" | 
|  | 10141 |  | 
|  | 10142 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10144 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles." \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10145 | "$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] | 10146 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10147 | 0 \ | 
|  | 10148 | -s "found use_srtp extension" \ | 
|  | 10149 | -s "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10150 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10151 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10152 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10153 | -c "client hello, adding use_srtp extension" \ | 
|  | 10154 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10155 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10156 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10157 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10158 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10159 | -C "error" | 
|  | 10160 |  | 
|  | 10161 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10163 | run_test  "DTLS-SRTP server and Client support only one matching profile." \ | 
|  | 10164 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10165 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10166 | 0 \ | 
|  | 10167 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10168 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 10169 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10170 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10171 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10172 | -c "client hello, adding use_srtp extension" \ | 
|  | 10173 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10174 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10175 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10176 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10177 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10178 | -C "error" | 
|  | 10179 |  | 
|  | 10180 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10182 | run_test  "DTLS-SRTP server and Client support only one different profile." \ | 
|  | 10183 | "$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] | 10184 | "$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] | 10185 | 0 \ | 
|  | 10186 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10187 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10188 | -S "selected srtp profile" \ | 
|  | 10189 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10190 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10191 | -c "client hello, adding use_srtp extension" \ | 
|  | 10192 | -C "found use_srtp extension" \ | 
|  | 10193 | -C "found srtp profile" \ | 
|  | 10194 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10195 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10196 | -C "error" | 
|  | 10197 |  | 
|  | 10198 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10200 | run_test  "DTLS-SRTP server doesn't support use_srtp extension." \ | 
|  | 10201 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 10202 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10203 | 0 \ | 
|  | 10204 | -s "found use_srtp extension" \ | 
|  | 10205 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10206 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10207 | -c "client hello, adding use_srtp extension" \ | 
|  | 10208 | -C "found use_srtp extension" \ | 
|  | 10209 | -C "found srtp profile" \ | 
|  | 10210 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10211 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10212 | -C "error" | 
|  | 10213 |  | 
|  | 10214 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10216 | run_test  "DTLS-SRTP all profiles supported. mki used" \ | 
|  | 10217 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ | 
|  | 10218 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 10219 | 0 \ | 
|  | 10220 | -s "found use_srtp extension" \ | 
|  | 10221 | -s "found srtp profile" \ | 
|  | 10222 | -s "selected srtp profile" \ | 
|  | 10223 | -s "server hello, adding use_srtp extension" \ | 
|  | 10224 | -s "dumping 'using mki' (8 bytes)" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10225 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10226 | -c "client hello, adding use_srtp extension" \ | 
|  | 10227 | -c "found use_srtp extension" \ | 
|  | 10228 | -c "found srtp profile" \ | 
|  | 10229 | -c "selected srtp profile" \ | 
|  | 10230 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 10231 | -c "dumping 'received mki' (8 bytes)" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10232 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10233 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10234 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10235 | -C "error" | 
|  | 10236 |  | 
|  | 10237 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10239 | run_test  "DTLS-SRTP all profiles supported. server doesn't support mki." \ | 
|  | 10240 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10241 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 10242 | 0 \ | 
|  | 10243 | -s "found use_srtp extension" \ | 
|  | 10244 | -s "found srtp profile" \ | 
|  | 10245 | -s "selected srtp profile" \ | 
|  | 10246 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10247 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10248 | -s "DTLS-SRTP no mki value negotiated"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10249 | -S "dumping 'using mki' (8 bytes)" \ | 
|  | 10250 | -c "client hello, adding use_srtp extension" \ | 
|  | 10251 | -c "found use_srtp extension" \ | 
|  | 10252 | -c "found srtp profile" \ | 
|  | 10253 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10254 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10255 | -c "DTLS-SRTP no mki value negotiated"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10256 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10257 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 10258 | -C "dumping 'received mki' (8 bytes)" \ | 
|  | 10259 | -C "error" | 
|  | 10260 |  | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10261 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10263 | run_test  "DTLS-SRTP all profiles supported. openssl client." \ | 
|  | 10264 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10265 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10266 | 0 \ | 
|  | 10267 | -s "found use_srtp extension" \ | 
|  | 10268 | -s "found srtp profile" \ | 
|  | 10269 | -s "selected srtp profile" \ | 
|  | 10270 | -s "server hello, adding use_srtp extension" \ | 
|  | 10271 | -s "DTLS-SRTP key material is"\ | 
|  | 10272 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 10273 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" | 
|  | 10274 |  | 
|  | 10275 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10277 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ | 
|  | 10278 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10279 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10280 | 0 \ | 
|  | 10281 | -s "found use_srtp extension" \ | 
|  | 10282 | -s "found srtp profile" \ | 
|  | 10283 | -s "selected srtp profile" \ | 
|  | 10284 | -s "server hello, adding use_srtp extension" \ | 
|  | 10285 | -s "DTLS-SRTP key material is"\ | 
|  | 10286 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 10287 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 10288 |  | 
|  | 10289 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10291 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ | 
|  | 10292 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10293 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10294 | 0 \ | 
|  | 10295 | -s "found use_srtp extension" \ | 
|  | 10296 | -s "found srtp profile" \ | 
|  | 10297 | -s "selected srtp profile" \ | 
|  | 10298 | -s "server hello, adding use_srtp extension" \ | 
|  | 10299 | -s "DTLS-SRTP key material is"\ | 
|  | 10300 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 10301 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 10302 |  | 
|  | 10303 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10305 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ | 
|  | 10306 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10307 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10308 | 0 \ | 
|  | 10309 | -s "found use_srtp extension" \ | 
|  | 10310 | -s "found srtp profile" \ | 
|  | 10311 | -s "selected srtp profile" \ | 
|  | 10312 | -s "server hello, adding use_srtp extension" \ | 
|  | 10313 | -s "DTLS-SRTP key material is"\ | 
|  | 10314 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 10315 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 10316 |  | 
|  | 10317 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10319 | run_test  "DTLS-SRTP server and Client support only one matching profile. openssl client." \ | 
|  | 10320 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10321 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10322 | 0 \ | 
|  | 10323 | -s "found use_srtp extension" \ | 
|  | 10324 | -s "found srtp profile" \ | 
|  | 10325 | -s "selected srtp profile" \ | 
|  | 10326 | -s "server hello, adding use_srtp extension" \ | 
|  | 10327 | -s "DTLS-SRTP key material is"\ | 
|  | 10328 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 10329 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 10330 |  | 
|  | 10331 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10333 | run_test  "DTLS-SRTP server and Client support only one different profile. openssl client." \ | 
|  | 10334 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ | 
|  | 10335 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10336 | 0 \ | 
|  | 10337 | -s "found use_srtp extension" \ | 
|  | 10338 | -s "found srtp profile" \ | 
|  | 10339 | -S "selected srtp profile" \ | 
|  | 10340 | -S "server hello, adding use_srtp extension" \ | 
|  | 10341 | -S "DTLS-SRTP key material is"\ | 
|  | 10342 | -C "SRTP Extension negotiated, profile" | 
|  | 10343 |  | 
|  | 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 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10346 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ | 
|  | 10347 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 10348 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10349 | 0 \ | 
|  | 10350 | -s "found use_srtp extension" \ | 
|  | 10351 | -S "server hello, adding use_srtp extension" \ | 
|  | 10352 | -S "DTLS-SRTP key material is"\ | 
|  | 10353 | -C "SRTP Extension negotiated, profile" | 
|  | 10354 |  | 
|  | 10355 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10357 | run_test  "DTLS-SRTP all profiles supported. openssl server" \ | 
|  | 10358 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10359 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10360 | 0 \ | 
|  | 10361 | -c "client hello, adding use_srtp extension" \ | 
|  | 10362 | -c "found use_srtp extension" \ | 
|  | 10363 | -c "found srtp profile" \ | 
|  | 10364 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
|  | 10365 | -c "DTLS-SRTP key material is"\ | 
|  | 10366 | -C "error" | 
|  | 10367 |  | 
|  | 10368 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10370 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ | 
|  | 10371 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10372 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10373 | 0 \ | 
|  | 10374 | -c "client hello, adding use_srtp extension" \ | 
|  | 10375 | -c "found use_srtp extension" \ | 
|  | 10376 | -c "found srtp profile" \ | 
|  | 10377 | -c "selected srtp profile" \ | 
|  | 10378 | -c "DTLS-SRTP key material is"\ | 
|  | 10379 | -C "error" | 
|  | 10380 |  | 
|  | 10381 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10383 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ | 
|  | 10384 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10385 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10386 | 0 \ | 
|  | 10387 | -c "client hello, adding use_srtp extension" \ | 
|  | 10388 | -c "found use_srtp extension" \ | 
|  | 10389 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 10390 | -c "selected srtp profile" \ | 
|  | 10391 | -c "DTLS-SRTP key material is"\ | 
|  | 10392 | -C "error" | 
|  | 10393 |  | 
|  | 10394 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10396 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ | 
|  | 10397 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10398 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10399 | 0 \ | 
|  | 10400 | -c "client hello, adding use_srtp extension" \ | 
|  | 10401 | -c "found use_srtp extension" \ | 
|  | 10402 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 10403 | -c "selected srtp profile" \ | 
|  | 10404 | -c "DTLS-SRTP key material is"\ | 
|  | 10405 | -C "error" | 
|  | 10406 |  | 
|  | 10407 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10409 | run_test  "DTLS-SRTP server and Client support only one matching profile. openssl server." \ | 
|  | 10410 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10411 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10412 | 0 \ | 
|  | 10413 | -c "client hello, adding use_srtp extension" \ | 
|  | 10414 | -c "found use_srtp extension" \ | 
|  | 10415 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 10416 | -c "selected srtp profile" \ | 
|  | 10417 | -c "DTLS-SRTP key material is"\ | 
|  | 10418 | -C "error" | 
|  | 10419 |  | 
|  | 10420 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10422 | run_test  "DTLS-SRTP server and Client support only one different profile. openssl server." \ | 
|  | 10423 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10424 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ | 
|  | 10425 | 0 \ | 
|  | 10426 | -c "client hello, adding use_srtp extension" \ | 
|  | 10427 | -C "found use_srtp extension" \ | 
|  | 10428 | -C "found srtp profile" \ | 
|  | 10429 | -C "selected srtp profile" \ | 
|  | 10430 | -C "DTLS-SRTP key material is"\ | 
|  | 10431 | -C "error" | 
|  | 10432 |  | 
|  | 10433 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10435 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ | 
|  | 10436 | "$O_SRV -dtls" \ | 
|  | 10437 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10438 | 0 \ | 
|  | 10439 | -c "client hello, adding use_srtp extension" \ | 
|  | 10440 | -C "found use_srtp extension" \ | 
|  | 10441 | -C "found srtp profile" \ | 
|  | 10442 | -C "selected srtp profile" \ | 
|  | 10443 | -C "DTLS-SRTP key material is"\ | 
|  | 10444 | -C "error" | 
|  | 10445 |  | 
|  | 10446 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10448 | run_test  "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ | 
|  | 10449 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 10450 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 10451 | 0 \ | 
|  | 10452 | -c "client hello, adding use_srtp extension" \ | 
|  | 10453 | -c "found use_srtp extension" \ | 
|  | 10454 | -c "found srtp profile" \ | 
|  | 10455 | -c "selected srtp profile" \ | 
|  | 10456 | -c "DTLS-SRTP key material is"\ | 
|  | 10457 | -c "DTLS-SRTP no mki value negotiated"\ | 
|  | 10458 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 10459 | -C "dumping 'received mki' (8 bytes)" \ | 
|  | 10460 | -C "error" | 
|  | 10461 |  | 
|  | 10462 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10463 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10465 | run_test  "DTLS-SRTP all profiles supported. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10466 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10467 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_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] | 10468 | 0 \ | 
|  | 10469 | -s "found use_srtp extension" \ | 
|  | 10470 | -s "found srtp profile" \ | 
|  | 10471 | -s "selected srtp profile" \ | 
|  | 10472 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10473 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10474 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" | 
|  | 10475 |  | 
|  | 10476 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10477 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10479 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10480 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10481 | "$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] | 10482 | 0 \ | 
|  | 10483 | -s "found use_srtp extension" \ | 
|  | 10484 | -s "found srtp profile" \ | 
|  | 10485 | -s "selected srtp profile" \ | 
|  | 10486 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10487 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10488 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" | 
|  | 10489 |  | 
|  | 10490 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10491 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10493 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10494 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10495 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10496 | 0 \ | 
|  | 10497 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10498 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 10499 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10500 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10501 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10502 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" | 
|  | 10503 |  | 
|  | 10504 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10505 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10507 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10508 | "$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] | 10509 | "$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] | 10510 | 0 \ | 
|  | 10511 | -s "found use_srtp extension" \ | 
|  | 10512 | -s "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10513 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10514 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10515 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10516 | -c "SRTP profile: SRTP_NULL_SHA1_32" | 
|  | 10517 |  | 
|  | 10518 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10519 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10521 | run_test  "DTLS-SRTP server and Client support only one matching profile. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10522 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10523 | "$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] | 10524 | 0 \ | 
|  | 10525 | -s "found use_srtp extension" \ | 
|  | 10526 | -s "found srtp profile" \ | 
|  | 10527 | -s "selected srtp profile" \ | 
|  | 10528 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10529 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10530 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" | 
|  | 10531 |  | 
|  | 10532 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10533 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10535 | 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] | 10536 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ | 
|  | 10537 | "$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] | 10538 | 0 \ | 
|  | 10539 | -s "found use_srtp extension" \ | 
|  | 10540 | -s "found srtp profile" \ | 
|  | 10541 | -S "selected srtp profile" \ | 
|  | 10542 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10543 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10544 | -C "SRTP profile:" | 
|  | 10545 |  | 
|  | 10546 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10547 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10549 | 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] | 10550 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 10551 | "$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] | 10552 | 0 \ | 
|  | 10553 | -s "found use_srtp extension" \ | 
|  | 10554 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10555 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10556 | -C "SRTP profile:" | 
|  | 10557 |  | 
|  | 10558 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10559 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10561 | run_test  "DTLS-SRTP all profiles supported. gnutls server" \ | 
|  | 10562 | "$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" \ | 
|  | 10563 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10564 | 0 \ | 
|  | 10565 | -c "client hello, adding use_srtp extension" \ | 
|  | 10566 | -c "found use_srtp extension" \ | 
|  | 10567 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10568 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10569 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10570 | -C "error" | 
|  | 10571 |  | 
|  | 10572 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10573 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10575 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ | 
|  | 10576 | "$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" \ | 
|  | 10577 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10578 | 0 \ | 
|  | 10579 | -c "client hello, adding use_srtp extension" \ | 
|  | 10580 | -c "found use_srtp extension" \ | 
|  | 10581 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10582 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10583 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10584 | -C "error" | 
|  | 10585 |  | 
|  | 10586 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10587 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10589 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ | 
|  | 10590 | "$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" \ | 
|  | 10591 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10592 | 0 \ | 
|  | 10593 | -c "client hello, adding use_srtp extension" \ | 
|  | 10594 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10595 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10596 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10597 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10598 | -C "error" | 
|  | 10599 |  | 
|  | 10600 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10601 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10603 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ | 
|  | 10604 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10605 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10606 | 0 \ | 
|  | 10607 | -c "client hello, adding use_srtp extension" \ | 
|  | 10608 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10609 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10610 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10611 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10612 | -C "error" | 
|  | 10613 |  | 
|  | 10614 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10615 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10617 | run_test  "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ | 
|  | 10618 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 10619 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 10620 | 0 \ | 
|  | 10621 | -c "client hello, adding use_srtp extension" \ | 
|  | 10622 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10623 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10624 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10625 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10626 | -C "error" | 
|  | 10627 |  | 
|  | 10628 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10629 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10631 | run_test  "DTLS-SRTP server and Client support only one different profile. gnutls server." \ | 
|  | 10632 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10633 | "$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] | 10634 | 0 \ | 
|  | 10635 | -c "client hello, adding use_srtp extension" \ | 
|  | 10636 | -C "found use_srtp extension" \ | 
|  | 10637 | -C "found srtp profile" \ | 
|  | 10638 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10639 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10640 | -C "error" | 
|  | 10641 |  | 
|  | 10642 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10643 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10645 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ | 
|  | 10646 | "$G_SRV -u" \ | 
|  | 10647 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 10648 | 0 \ | 
|  | 10649 | -c "client hello, adding use_srtp extension" \ | 
|  | 10650 | -C "found use_srtp extension" \ | 
|  | 10651 | -C "found srtp profile" \ | 
|  | 10652 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10653 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10654 | -C "error" | 
|  | 10655 |  | 
|  | 10656 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10657 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10659 | run_test  "DTLS-SRTP all profiles supported. mki used. gnutls server." \ | 
|  | 10660 | "$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" \ | 
|  | 10661 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 10662 | 0 \ | 
|  | 10663 | -c "client hello, adding use_srtp extension" \ | 
|  | 10664 | -c "found use_srtp extension" \ | 
|  | 10665 | -c "found srtp profile" \ | 
|  | 10666 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10667 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10668 | -c "DTLS-SRTP mki value:"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10669 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 10670 | -c "dumping 'received mki' (8 bytes)" \ | 
|  | 10671 | -C "error" | 
|  | 10672 |  | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10673 | # Tests for specific things with "unreliable" UDP connection | 
|  | 10674 |  | 
|  | 10675 | not_with_valgrind # spurious resend due to timeout | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10677 | run_test    "DTLS proxy: reference" \ | 
|  | 10678 | -p "$P_PXY" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10679 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ | 
|  | 10680 | "$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] | 10681 | 0 \ | 
|  | 10682 | -C "replayed record" \ | 
|  | 10683 | -S "replayed record" \ | 
| Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10684 | -C "Buffer record from epoch" \ | 
|  | 10685 | -S "Buffer record from epoch" \ | 
|  | 10686 | -C "ssl_buffer_message" \ | 
|  | 10687 | -S "ssl_buffer_message" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10688 | -C "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10689 | -S "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10690 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10691 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10692 | -c "HTTP/1.0 200 OK" | 
|  | 10693 |  | 
|  | 10694 | not_with_valgrind # spurious resend due to timeout | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10696 | run_test    "DTLS proxy: duplicate every packet" \ | 
|  | 10697 | -p "$P_PXY duplicate=1" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10698 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ | 
|  | 10699 | "$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] | 10700 | 0 \ | 
|  | 10701 | -c "replayed record" \ | 
|  | 10702 | -s "replayed record" \ | 
|  | 10703 | -c "record from another epoch" \ | 
|  | 10704 | -s "record from another epoch" \ | 
|  | 10705 | -S "resend" \ | 
|  | 10706 | -s "Extra-header:" \ | 
|  | 10707 | -c "HTTP/1.0 200 OK" | 
|  | 10708 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10710 | run_test    "DTLS proxy: duplicate every packet, server anti-replay off" \ | 
|  | 10711 | -p "$P_PXY duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10712 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ | 
|  | 10713 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10714 | 0 \ | 
|  | 10715 | -c "replayed record" \ | 
|  | 10716 | -S "replayed record" \ | 
|  | 10717 | -c "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10718 | -s "record from another epoch" \ | 
|  | 10719 | -c "resend" \ | 
|  | 10720 | -s "resend" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10721 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10722 | -c "HTTP/1.0 200 OK" | 
|  | 10723 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10725 | run_test    "DTLS proxy: multiple records in same datagram" \ | 
|  | 10726 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10727 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 10728 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10729 | 0 \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10730 | -c "next record in same datagram" \ | 
|  | 10731 | -s "next record in same datagram" | 
|  | 10732 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10734 | run_test    "DTLS proxy: multiple records in same datagram, duplicate every packet" \ | 
|  | 10735 | -p "$P_PXY pack=50 duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10736 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 10737 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10738 | 0 \ | 
|  | 10739 | -c "next record in same datagram" \ | 
|  | 10740 | -s "next record in same datagram" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10741 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10743 | run_test    "DTLS proxy: inject invalid AD record, default badmac_limit" \ | 
|  | 10744 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10745 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ | 
|  | 10746 | "$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] | 10747 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10748 | -c "discarding invalid record (mac)" \ | 
|  | 10749 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10750 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10751 | -c "HTTP/1.0 200 OK" \ | 
|  | 10752 | -S "too many records with bad MAC" \ | 
|  | 10753 | -S "Verification of the message MAC failed" | 
|  | 10754 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10756 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 1" \ | 
|  | 10757 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10758 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ | 
|  | 10759 | "$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] | 10760 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10761 | -C "discarding invalid record (mac)" \ | 
|  | 10762 | -S "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10763 | -S "Extra-header:" \ | 
|  | 10764 | -C "HTTP/1.0 200 OK" \ | 
|  | 10765 | -s "too many records with bad MAC" \ | 
|  | 10766 | -s "Verification of the message MAC failed" | 
|  | 10767 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10769 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2" \ | 
|  | 10770 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10771 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ | 
|  | 10772 | "$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] | 10773 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10774 | -c "discarding invalid record (mac)" \ | 
|  | 10775 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10776 | -s "Extra-header:" \ | 
|  | 10777 | -c "HTTP/1.0 200 OK" \ | 
|  | 10778 | -S "too many records with bad MAC" \ | 
|  | 10779 | -S "Verification of the message MAC failed" | 
|  | 10780 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10782 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ | 
|  | 10783 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10784 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ | 
|  | 10785 | "$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] | 10786 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10787 | -c "discarding invalid record (mac)" \ | 
|  | 10788 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10789 | -s "Extra-header:" \ | 
|  | 10790 | -c "HTTP/1.0 200 OK" \ | 
|  | 10791 | -s "too many records with bad MAC" \ | 
|  | 10792 | -s "Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10793 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10795 | run_test    "DTLS proxy: delay ChangeCipherSpec" \ | 
|  | 10796 | -p "$P_PXY delay_ccs=1" \ | 
| Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10797 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ | 
|  | 10798 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10799 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10800 | -c "record from another epoch" \ | 
|  | 10801 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10802 | -s "Extra-header:" \ | 
|  | 10803 | -c "HTTP/1.0 200 OK" | 
|  | 10804 |  | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10805 | # Tests for reordering support with DTLS | 
|  | 10806 |  | 
| Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10807 | requires_certificate_authentication | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10809 | run_test    "DTLS reordering: Buffer out-of-order handshake message on client" \ | 
|  | 10810 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10811 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 10812 | hs_timeout=2500-60000" \ | 
|  | 10813 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 10814 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10815 | 0 \ | 
|  | 10816 | -c "Buffering HS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10817 | -c "Next handshake message has been buffered - load"\ | 
|  | 10818 | -S "Buffering HS message" \ | 
|  | 10819 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10820 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10821 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10822 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10823 | -S "Remember CCS message" | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10824 |  | 
| Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10825 | requires_certificate_authentication | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10827 | run_test    "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ | 
|  | 10828 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10829 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 10830 | hs_timeout=2500-60000" \ | 
|  | 10831 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 10832 | hs_timeout=2500-60000" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10833 | 0 \ | 
|  | 10834 | -c "Buffering HS message" \ | 
|  | 10835 | -c "found fragmented DTLS handshake message"\ | 
|  | 10836 | -c "Next handshake message 1 not or only partially bufffered" \ | 
|  | 10837 | -c "Next handshake message has been buffered - load"\ | 
|  | 10838 | -S "Buffering HS message" \ | 
|  | 10839 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10840 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10841 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10842 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10843 | -S "Remember CCS message" | 
|  | 10844 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10845 | # The client buffers the ServerKeyExchange before receiving the fragmented | 
|  | 10846 | # Certificate message; at the time of writing, together these are aroudn 1200b | 
|  | 10847 | # in size, so that the bound below ensures that the certificate can be reassembled | 
|  | 10848 | # while keeping the ServerKeyExchange. | 
| Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10849 | requires_certificate_authentication | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10850 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10852 | 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] | 10853 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10854 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 10855 | hs_timeout=2500-60000" \ | 
|  | 10856 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 10857 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10858 | 0 \ | 
|  | 10859 | -c "Buffering HS message" \ | 
|  | 10860 | -c "Next handshake message has been buffered - load"\ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10861 | -C "attempt to make space by freeing buffered messages" \ | 
|  | 10862 | -S "Buffering HS message" \ | 
|  | 10863 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10864 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10865 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10866 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10867 | -S "Remember CCS message" | 
|  | 10868 |  | 
|  | 10869 | # The size constraints ensure that the delayed certificate message can't | 
|  | 10870 | # be reassembled while keeping the ServerKeyExchange message, but it can | 
|  | 10871 | # when dropping it first. | 
| Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10872 | requires_certificate_authentication | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10873 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 | 
|  | 10874 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10876 | run_test    "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ | 
|  | 10877 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10878 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 10879 | hs_timeout=2500-60000" \ | 
|  | 10880 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 10881 | hs_timeout=2500-60000" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10882 | 0 \ | 
|  | 10883 | -c "Buffering HS message" \ | 
|  | 10884 | -c "attempt to make space by freeing buffered future messages" \ | 
|  | 10885 | -c "Enough space available after freeing buffered HS messages" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10886 | -S "Buffering HS message" \ | 
|  | 10887 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10888 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10889 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10890 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10891 | -S "Remember CCS message" | 
|  | 10892 |  | 
| Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10893 | requires_certificate_authentication | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10895 | run_test    "DTLS reordering: Buffer out-of-order handshake message on server" \ | 
|  | 10896 | -p "$P_PXY delay_cli=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10897 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ | 
|  | 10898 | hs_timeout=2500-60000" \ | 
|  | 10899 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 10900 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10901 | 0 \ | 
|  | 10902 | -C "Buffering HS message" \ | 
|  | 10903 | -C "Next handshake message has been buffered - load"\ | 
|  | 10904 | -s "Buffering HS message" \ | 
|  | 10905 | -s "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10906 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10907 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10908 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10909 | -S "Remember CCS message" | 
|  | 10910 |  | 
| Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10911 | requires_certificate_authentication | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10912 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10913 | run_test    "DTLS reordering: Buffer out-of-order CCS message on client"\ | 
|  | 10914 | -p "$P_PXY delay_srv=NewSessionTicket" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10915 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 10916 | hs_timeout=2500-60000" \ | 
|  | 10917 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 10918 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10919 | 0 \ | 
|  | 10920 | -C "Buffering HS message" \ | 
|  | 10921 | -C "Next handshake message has been buffered - load"\ | 
|  | 10922 | -S "Buffering HS message" \ | 
|  | 10923 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10924 | -c "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10925 | -c "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10926 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10927 | -S "Remember CCS message" | 
|  | 10928 |  | 
| Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10929 | requires_certificate_authentication | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10931 | run_test    "DTLS reordering: Buffer out-of-order CCS message on server"\ | 
|  | 10932 | -p "$P_PXY delay_cli=ClientKeyExchange" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10933 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 10934 | hs_timeout=2500-60000" \ | 
|  | 10935 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 10936 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10937 | 0 \ | 
|  | 10938 | -C "Buffering HS message" \ | 
|  | 10939 | -C "Next handshake message has been buffered - load"\ | 
|  | 10940 | -S "Buffering HS message" \ | 
|  | 10941 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10942 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10943 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10944 | -s "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10945 | -s "Remember CCS message" | 
|  | 10946 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10948 | run_test    "DTLS reordering: Buffer encrypted Finished message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10949 | -p "$P_PXY delay_ccs=1" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10950 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 10951 | hs_timeout=2500-60000" \ | 
|  | 10952 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 10953 | hs_timeout=2500-60000" \ | 
| Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10954 | 0 \ | 
|  | 10955 | -s "Buffer record from epoch 1" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10956 | -s "Found buffered record from current epoch - load" \ | 
|  | 10957 | -c "Buffer record from epoch 1" \ | 
|  | 10958 | -c "Found buffered record from current epoch - load" | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10959 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10960 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec | 
|  | 10961 | # from the server are delayed, so that the encrypted Finished message | 
|  | 10962 | # is received and buffered. When the fragmented NewSessionTicket comes | 
|  | 10963 | # in afterwards, the encrypted Finished message must be freed in order | 
|  | 10964 | # to make space for the NewSessionTicket to be reassembled. | 
|  | 10965 | # This works only in very particular circumstances: | 
|  | 10966 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering | 
|  | 10967 | #   of the NewSessionTicket, but small enough to also allow buffering of | 
|  | 10968 | #   the encrypted Finished message. | 
|  | 10969 | # - The MTU setting on the server must be so small that the NewSessionTicket | 
|  | 10970 | #   needs to be fragmented. | 
|  | 10971 | # - All messages sent by the server must be small enough to be either sent | 
|  | 10972 | #   without fragmentation or be reassembled within the bounds of | 
|  | 10973 | #   MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based | 
|  | 10974 | #   handshake, omitting CRTs. | 
| Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10975 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 | 
|  | 10976 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10977 | run_test    "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ | 
|  | 10978 | -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] | 10979 | "$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] | 10980 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ | 
|  | 10981 | 0 \ | 
|  | 10982 | -s "Buffer record from epoch 1" \ | 
|  | 10983 | -s "Found buffered record from current epoch - load" \ | 
|  | 10984 | -c "Buffer record from epoch 1" \ | 
|  | 10985 | -C "Found buffered record from current epoch - load" \ | 
|  | 10986 | -c "Enough space available after freeing future epoch record" | 
|  | 10987 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10988 | # Tests for "randomly unreliable connection": try a variety of flows and peers | 
|  | 10989 |  | 
|  | 10990 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10991 | run_test    "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ | 
|  | 10992 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10993 | "$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] | 10994 | psk=abc123" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10995 | "$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] | 10996 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 10997 | 0 \ | 
|  | 10998 | -s "Extra-header:" \ | 
|  | 10999 | -c "HTTP/1.0 200 OK" | 
|  | 11000 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11001 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11002 | run_test    "DTLS proxy: 3d, \"short\" RSA handshake" \ | 
|  | 11003 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11004 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 11005 | "$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] | 11006 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 11007 | 0 \ | 
|  | 11008 | -s "Extra-header:" \ | 
|  | 11009 | -c "HTTP/1.0 200 OK" | 
|  | 11010 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11011 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11013 | run_test    "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ | 
|  | 11014 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11015 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 11016 | "$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] | 11017 | 0 \ | 
|  | 11018 | -s "Extra-header:" \ | 
|  | 11019 | -c "HTTP/1.0 200 OK" | 
|  | 11020 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11021 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11023 | run_test    "DTLS proxy: 3d, FS, client auth" \ | 
|  | 11024 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11025 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ | 
|  | 11026 | "$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] | 11027 | 0 \ | 
|  | 11028 | -s "Extra-header:" \ | 
|  | 11029 | -c "HTTP/1.0 200 OK" | 
|  | 11030 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11031 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11033 | run_test    "DTLS proxy: 3d, FS, ticket" \ | 
|  | 11034 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11035 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ | 
|  | 11036 | "$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] | 11037 | 0 \ | 
|  | 11038 | -s "Extra-header:" \ | 
|  | 11039 | -c "HTTP/1.0 200 OK" | 
|  | 11040 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11041 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11043 | run_test    "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ | 
|  | 11044 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11045 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ | 
|  | 11046 | "$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] | 11047 | 0 \ | 
|  | 11048 | -s "Extra-header:" \ | 
|  | 11049 | -c "HTTP/1.0 200 OK" | 
|  | 11050 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11051 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11053 | run_test    "DTLS proxy: 3d, max handshake, nbio" \ | 
|  | 11054 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11055 | "$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] | 11056 | auth_mode=required" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11057 | "$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] | 11058 | 0 \ | 
|  | 11059 | -s "Extra-header:" \ | 
|  | 11060 | -c "HTTP/1.0 200 OK" | 
|  | 11061 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11062 | client_needs_more_time 4 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11063 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11064 | run_test    "DTLS proxy: 3d, min handshake, resumption" \ | 
|  | 11065 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11066 | "$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] | 11067 | psk=abc123 debug_level=3" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11068 | "$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] | 11069 | 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] | 11070 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 11071 | 0 \ | 
|  | 11072 | -s "a session has been resumed" \ | 
|  | 11073 | -c "a session has been resumed" \ | 
|  | 11074 | -s "Extra-header:" \ | 
|  | 11075 | -c "HTTP/1.0 200 OK" | 
|  | 11076 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11077 | client_needs_more_time 4 | 
| Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11078 | requires_config_enabled MBEDTLS_SSL_CACHE_C | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11079 | run_test    "DTLS proxy: 3d, min handshake, resumption, nbio" \ | 
|  | 11080 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11081 | "$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] | 11082 | psk=abc123 debug_level=3 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11083 | "$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] | 11084 | 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] | 11085 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ | 
|  | 11086 | 0 \ | 
|  | 11087 | -s "a session has been resumed" \ | 
|  | 11088 | -c "a session has been resumed" \ | 
|  | 11089 | -s "Extra-header:" \ | 
|  | 11090 | -c "HTTP/1.0 200 OK" | 
|  | 11091 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11092 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11093 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11094 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego" \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11095 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11096 | "$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] | 11097 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11098 | "$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] | 11099 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11100 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 11101 | 0 \ | 
|  | 11102 | -c "=> renegotiate" \ | 
|  | 11103 | -s "=> renegotiate" \ | 
|  | 11104 | -s "Extra-header:" \ | 
|  | 11105 | -c "HTTP/1.0 200 OK" | 
|  | 11106 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11107 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11108 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11109 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ | 
|  | 11110 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11111 | "$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] | 11112 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11113 | "$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] | 11114 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11115 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 11116 | 0 \ | 
|  | 11117 | -c "=> renegotiate" \ | 
|  | 11118 | -s "=> renegotiate" \ | 
|  | 11119 | -s "Extra-header:" \ | 
|  | 11120 | -c "HTTP/1.0 200 OK" | 
|  | 11121 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11122 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11123 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11124 | run_test    "DTLS proxy: 3d, min handshake, server-initiated renego" \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11125 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11126 | "$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] | 11127 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11128 | debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11129 | "$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] | 11130 | renegotiation=1 exchanges=4 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11131 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 11132 | 0 \ | 
|  | 11133 | -c "=> renegotiate" \ | 
|  | 11134 | -s "=> renegotiate" \ | 
|  | 11135 | -s "Extra-header:" \ | 
|  | 11136 | -c "HTTP/1.0 200 OK" | 
|  | 11137 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11138 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11139 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11140 | 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] | 11141 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11142 | "$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] | 11143 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11144 | debug_level=2 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11145 | "$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] | 11146 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11147 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 11148 | 0 \ | 
|  | 11149 | -c "=> renegotiate" \ | 
|  | 11150 | -s "=> renegotiate" \ | 
|  | 11151 | -s "Extra-header:" \ | 
|  | 11152 | -c "HTTP/1.0 200 OK" | 
|  | 11153 |  | 
| Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11154 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise | 
|  | 11155 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) | 
|  | 11156 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error | 
|  | 11157 | requires_openssl_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11158 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11159 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11161 | run_test    "DTLS proxy: 3d, openssl server" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11162 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
| Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 11163 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ | 
|  | 11164 | "$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] | 11165 | 0 \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11166 | -c "HTTP/1.0 200 OK" | 
|  | 11167 |  | 
| Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11168 | requires_openssl_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11169 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11170 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11172 | run_test    "DTLS proxy: 3d, openssl server, fragmentation" \ | 
|  | 11173 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
| Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11174 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11175 | "$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] | 11176 | 0 \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11177 | -c "HTTP/1.0 200 OK" | 
|  | 11178 |  | 
| Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11179 | requires_openssl_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11180 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11181 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11183 | run_test    "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ | 
|  | 11184 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
| Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11185 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11186 | "$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] | 11187 | 0 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11188 | -c "HTTP/1.0 200 OK" | 
|  | 11189 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11190 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11191 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11192 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11194 | run_test    "DTLS proxy: 3d, gnutls server" \ | 
|  | 11195 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 11196 | "$G_SRV -u --mtu 2048 -a" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11197 | "$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] | 11198 | 0 \ | 
|  | 11199 | -s "Extra-header:" \ | 
|  | 11200 | -c "Extra-header:" | 
|  | 11201 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11202 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11203 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11204 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11206 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation" \ | 
|  | 11207 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11208 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11209 | "$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] | 11210 | 0 \ | 
|  | 11211 | -s "Extra-header:" \ | 
|  | 11212 | -c "Extra-header:" | 
|  | 11213 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11214 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11215 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11216 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11218 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ | 
|  | 11219 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11220 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11221 | "$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] | 11222 | 0 \ | 
|  | 11223 | -s "Extra-header:" \ | 
|  | 11224 | -c "Extra-header:" | 
|  | 11225 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11227 | run_test    "export keys functionality" \ | 
|  | 11228 | "$P_SRV eap_tls=1 debug_level=3" \ | 
| Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 11229 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11230 | 0 \ | 
| Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11231 | -c "EAP-TLS key material is:"\ | 
|  | 11232 | -s "EAP-TLS key material is:"\ | 
|  | 11233 | -c "EAP-TLS IV is:" \ | 
|  | 11234 | -s "EAP-TLS IV is:" | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11235 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11236 | # openssl feature tests: check if tls1.3 exists. | 
|  | 11237 | requires_openssl_tls1_3 | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11238 | run_test    "TLS 1.3: Test openssl tls1_3 feature" \ | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11239 | "$O_NEXT_SRV -tls1_3 -msg" \ | 
|  | 11240 | "$O_NEXT_CLI -tls1_3 -msg" \ | 
|  | 11241 | 0 \ | 
|  | 11242 | -c "TLS 1.3" \ | 
|  | 11243 | -s "TLS 1.3" | 
|  | 11244 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11245 | # 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] | 11246 | requires_gnutls_tls1_3 | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11247 | requires_gnutls_next_no_ticket | 
|  | 11248 | requires_gnutls_next_disable_tls13_compat | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11249 | run_test    "TLS 1.3: Test gnutls tls1_3 feature" \ | 
| Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11250 | "$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] | 11251 | "$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] | 11252 | 0 \ | 
|  | 11253 | -s "Version: TLS1.3" \ | 
|  | 11254 | -c "Version: TLS1.3" | 
|  | 11255 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11256 | # TLS1.3 test cases | 
| Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 11258 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11259 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 | 
| Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11260 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED | 
|  | 11261 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11262 | run_test    "TLS 1.3: Default" \ | 
|  | 11263 | "$P_SRV allow_sha1=0 debug_level=3 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ | 
|  | 11264 | "$P_CLI allow_sha1=0" \ | 
|  | 11265 | 0 \ | 
|  | 11266 | -s "Protocol is TLSv1.3" \ | 
| Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11267 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ | 
| Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11268 | -s "ECDH group: x25519" \ | 
|  | 11269 | -s "selected signature algorithm ecdsa_secp256r1_sha256" | 
|  | 11270 |  | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11271 | requires_openssl_tls1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11272 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11273 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11274 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11275 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11276 | run_test    "TLS 1.3: minimal feature sets - openssl" \ | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11277 | "$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] | 11278 | "$P_CLI debug_level=3" \ | 
| Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11279 | 0 \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11280 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ | 
|  | 11281 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 11282 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 11283 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
|  | 11284 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
|  | 11285 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 11286 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
|  | 11287 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ | 
|  | 11288 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ | 
|  | 11289 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ | 
| Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11290 | -c "<= ssl_tls13_process_server_hello" \ | 
| Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11291 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11292 | -c "ECDH curve: x25519" \ | 
| Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11293 | -c "=> ssl_tls13_process_server_hello" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11294 | -c "<= parse encrypted extensions" \ | 
| Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11295 | -c "Certificate verification flags clear" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11296 | -c "=> parse certificate verify" \ | 
|  | 11297 | -c "<= parse certificate verify" \ | 
| XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11298 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ | 
| Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11299 | -c "<= parse finished message" \ | 
| Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11300 | -c "Protocol is TLSv1.3" \ | 
| Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11301 | -c "HTTP/1.0 200 ok" | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11302 |  | 
| Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11303 | requires_gnutls_tls1_3 | 
| Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11304 | requires_gnutls_next_no_ticket | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11305 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11306 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11307 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11308 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11309 | run_test    "TLS 1.3: minimal feature sets - gnutls" \ | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11310 | "$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] | 11311 | "$P_CLI debug_level=3" \ | 
| Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11312 | 0 \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11313 | -s "SERVER HELLO was queued" \ | 
|  | 11314 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ | 
|  | 11315 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 11316 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 11317 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
|  | 11318 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
|  | 11319 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 11320 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
|  | 11321 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ | 
|  | 11322 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ | 
|  | 11323 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ | 
| Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11324 | -c "<= ssl_tls13_process_server_hello" \ | 
| Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11325 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11326 | -c "ECDH curve: x25519" \ | 
| Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11327 | -c "=> ssl_tls13_process_server_hello" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11328 | -c "<= parse encrypted extensions" \ | 
| Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11329 | -c "Certificate verification flags clear" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11330 | -c "=> parse certificate verify" \ | 
|  | 11331 | -c "<= parse certificate verify" \ | 
| XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11332 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ | 
| Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11333 | -c "<= parse finished message" \ | 
| Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11334 | -c "Protocol is TLSv1.3" \ | 
| Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11335 | -c "HTTP/1.0 200 OK" | 
| XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11336 |  | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11337 | requires_openssl_tls1_3 | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11338 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11339 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11340 | requires_config_enabled MBEDTLS_SSL_ALPN | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11341 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11342 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11343 | run_test    "TLS 1.3: alpn - openssl" \ | 
|  | 11344 | "$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] | 11345 | "$P_CLI debug_level=3 alpn=h2" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11346 | 0 \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11347 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ | 
|  | 11348 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 11349 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 11350 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
|  | 11351 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
|  | 11352 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 11353 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
|  | 11354 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ | 
|  | 11355 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ | 
|  | 11356 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11357 | -c "<= ssl_tls13_process_server_hello" \ | 
| Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11358 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11359 | -c "ECDH curve: x25519" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11360 | -c "=> ssl_tls13_process_server_hello" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11361 | -c "<= parse encrypted extensions" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11362 | -c "Certificate verification flags clear" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11363 | -c "=> parse certificate verify" \ | 
|  | 11364 | -c "<= parse certificate verify" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11365 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ | 
|  | 11366 | -c "<= parse finished message" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11367 | -c "Protocol is TLSv1.3" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11368 | -c "HTTP/1.0 200 ok" \ | 
|  | 11369 | -c "Application Layer Protocol is h2" | 
|  | 11370 |  | 
|  | 11371 | requires_gnutls_tls1_3 | 
|  | 11372 | requires_gnutls_next_no_ticket | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11373 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11374 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11375 | requires_config_enabled MBEDTLS_SSL_ALPN | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11376 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11377 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11378 | run_test    "TLS 1.3: alpn - gnutls" \ | 
|  | 11379 | "$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] | 11380 | "$P_CLI debug_level=3 alpn=h2" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11381 | 0 \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11382 | -s "SERVER HELLO was queued" \ | 
|  | 11383 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ | 
|  | 11384 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 11385 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 11386 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
|  | 11387 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
|  | 11388 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 11389 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
|  | 11390 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ | 
|  | 11391 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ | 
|  | 11392 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11393 | -c "<= ssl_tls13_process_server_hello" \ | 
| Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11394 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11395 | -c "ECDH curve: x25519" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11396 | -c "=> ssl_tls13_process_server_hello" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11397 | -c "<= parse encrypted extensions" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11398 | -c "Certificate verification flags clear" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11399 | -c "=> parse certificate verify" \ | 
|  | 11400 | -c "<= parse certificate verify" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11401 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ | 
|  | 11402 | -c "<= parse finished message" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11403 | -c "Protocol is TLSv1.3" \ | 
| lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11404 | -c "HTTP/1.0 200 OK" \ | 
|  | 11405 | -c "Application Layer Protocol is h2" | 
|  | 11406 |  | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11407 | requires_openssl_tls1_3 | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11408 | requires_config_enabled MBEDTLS_DEBUG_C | 
| XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11409 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11410 | requires_config_enabled MBEDTLS_SSL_ALPN | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11411 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11412 | run_test    "TLS 1.3: server alpn - openssl" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 11413 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key alpn=h2" \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11414 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ | 
|  | 11415 | 0 \ | 
| XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11416 | -s "found alpn extension" \ | 
|  | 11417 | -s "server side, adding alpn extension" \ | 
|  | 11418 | -s "Protocol is TLSv1.3" \ | 
|  | 11419 | -s "HTTP/1.0 200 OK" \ | 
|  | 11420 | -s "Application Layer Protocol is h2" | 
|  | 11421 |  | 
|  | 11422 | requires_gnutls_tls1_3 | 
| XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11423 | requires_config_enabled MBEDTLS_DEBUG_C | 
| XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11424 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11425 | requires_config_enabled MBEDTLS_SSL_ALPN | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11426 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11427 | run_test    "TLS 1.3: server alpn - gnutls" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 11428 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key alpn=h2" \ | 
| XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11429 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ | 
|  | 11430 | 0 \ | 
| XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11431 | -s "found alpn extension" \ | 
|  | 11432 | -s "server side, adding alpn extension" \ | 
|  | 11433 | -s "Protocol is TLSv1.3" \ | 
|  | 11434 | -s "HTTP/1.0 200 OK" \ | 
|  | 11435 | -s "Application Layer Protocol is h2" | 
|  | 11436 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11438 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11439 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11440 | skip_handshake_stage_check | 
|  | 11441 | requires_gnutls_tls1_3 | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11442 | 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] | 11443 | "$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] | 11444 | "$P_CLI debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11445 | 1 \ | 
|  | 11446 | -s "Client's version: 3.3" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11447 | -S "Version: TLS1.0" \ | 
|  | 11448 | -C "Protocol is TLSv1.0" | 
|  | 11449 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11451 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11452 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11453 | skip_handshake_stage_check | 
|  | 11454 | requires_gnutls_tls1_3 | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11455 | 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] | 11456 | "$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] | 11457 | "$P_CLI debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11458 | 1 \ | 
|  | 11459 | -s "Client's version: 3.3" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11460 | -S "Version: TLS1.1" \ | 
|  | 11461 | -C "Protocol is TLSv1.1" | 
|  | 11462 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11464 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11465 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11466 | skip_handshake_stage_check | 
|  | 11467 | requires_gnutls_tls1_3 | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11468 | 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] | 11469 | "$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] | 11470 | "$P_CLI force_version=tls13 debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11471 | 1 \ | 
|  | 11472 | -s "Client's version: 3.3" \ | 
|  | 11473 | -c "is a fatal alert message (msg 40)" \ | 
|  | 11474 | -S "Version: TLS1.2" \ | 
|  | 11475 | -C "Protocol is TLSv1.2" | 
|  | 11476 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11478 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11479 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11480 | skip_handshake_stage_check | 
|  | 11481 | requires_openssl_next | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11482 | 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] | 11483 | "$O_NEXT_SRV -msg -tls1" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11484 | "$P_CLI debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11485 | 1 \ | 
|  | 11486 | -s "fatal protocol_version" \ | 
|  | 11487 | -c "is a fatal alert message (msg 70)" \ | 
|  | 11488 | -S "Version: TLS1.0" \ | 
|  | 11489 | -C "Protocol  : TLSv1.0" | 
|  | 11490 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11492 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11493 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11494 | skip_handshake_stage_check | 
|  | 11495 | requires_openssl_next | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11496 | 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] | 11497 | "$O_NEXT_SRV -msg -tls1_1" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11498 | "$P_CLI debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11499 | 1 \ | 
|  | 11500 | -s "fatal protocol_version" \ | 
|  | 11501 | -c "is a fatal alert message (msg 70)" \ | 
|  | 11502 | -S "Version: TLS1.1" \ | 
|  | 11503 | -C "Protocol  : TLSv1.1" | 
|  | 11504 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11506 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11507 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11508 | skip_handshake_stage_check | 
|  | 11509 | requires_openssl_next | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11510 | 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] | 11511 | "$O_NEXT_SRV -msg -tls1_2" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11512 | "$P_CLI force_version=tls13 debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11513 | 1 \ | 
|  | 11514 | -s "fatal protocol_version" \ | 
|  | 11515 | -c "is a fatal alert message (msg 70)" \ | 
|  | 11516 | -S "Version: TLS1.2" \ | 
|  | 11517 | -C "Protocol  : TLSv1.2" | 
|  | 11518 |  | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11519 | requires_openssl_tls1_3 | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11520 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11521 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11522 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11523 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11524 | run_test    "TLS 1.3: Client authentication, no client certificate - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11525 | "$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] | 11526 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11527 | 0 \ | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11528 | -c "got a certificate request" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11529 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11530 | -s "TLS 1.3" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11531 | -c "HTTP/1.0 200 ok" \ | 
|  | 11532 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11533 |  | 
|  | 11534 | requires_gnutls_tls1_3 | 
|  | 11535 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11536 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11537 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11538 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11539 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11540 | run_test    "TLS 1.3: Client authentication, no client certificate - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11541 | "$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] | 11542 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11543 | 0 \ | 
|  | 11544 | -c "got a certificate request" \ | 
|  | 11545 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ | 
|  | 11546 | -s "Version: TLS1.3" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11547 | -c "HTTP/1.0 200 OK" \ | 
|  | 11548 | -c "Protocol is TLSv1.3" | 
|  | 11549 |  | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11550 |  | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11551 | requires_openssl_tls1_3 | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11552 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11553 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11554 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11555 | run_test    "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11556 | "$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] | 11557 | "$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] | 11558 | 0 \ | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11559 | -c "got a certificate request" \ | 
| Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11560 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11561 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11562 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11563 |  | 
|  | 11564 | requires_gnutls_tls1_3 | 
|  | 11565 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11566 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11567 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11568 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11569 | run_test    "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11570 | "$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] | 11571 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ | 
| Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11572 | key_file=data_files/cli2.key" \ | 
| Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11573 | 0 \ | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11574 | -c "got a certificate request" \ | 
| Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11575 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11576 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11577 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11578 |  | 
|  | 11579 | requires_openssl_tls1_3 | 
| Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11580 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11581 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11582 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11583 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11584 | run_test    "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11585 | "$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] | 11586 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11587 | key_file=data_files/ecdsa_secp256r1.key" \ | 
|  | 11588 | 0 \ | 
|  | 11589 | -c "got a certificate request" \ | 
|  | 11590 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11591 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11592 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11593 |  | 
|  | 11594 | requires_gnutls_tls1_3 | 
|  | 11595 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11596 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11597 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11598 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11599 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11600 | run_test    "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11601 | "$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] | 11602 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11603 | key_file=data_files/ecdsa_secp256r1.key" \ | 
|  | 11604 | 0 \ | 
|  | 11605 | -c "got a certificate request" \ | 
|  | 11606 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11607 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11608 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11609 |  | 
|  | 11610 | requires_openssl_tls1_3 | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11611 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11612 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11613 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11614 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11615 | run_test    "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11616 | "$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] | 11617 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11618 | key_file=data_files/ecdsa_secp384r1.key" \ | 
|  | 11619 | 0 \ | 
|  | 11620 | -c "got a certificate request" \ | 
|  | 11621 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11622 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11623 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11624 |  | 
|  | 11625 | requires_gnutls_tls1_3 | 
|  | 11626 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11627 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11628 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11629 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11630 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11631 | run_test    "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11632 | "$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] | 11633 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11634 | key_file=data_files/ecdsa_secp384r1.key" \ | 
|  | 11635 | 0 \ | 
|  | 11636 | -c "got a certificate request" \ | 
|  | 11637 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11638 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11639 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11640 |  | 
|  | 11641 | requires_openssl_tls1_3 | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11642 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11643 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11644 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11645 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11646 | run_test    "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11647 | "$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] | 11648 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11649 | key_file=data_files/ecdsa_secp521r1.key" \ | 
|  | 11650 | 0 \ | 
|  | 11651 | -c "got a certificate request" \ | 
|  | 11652 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11653 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11654 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11655 |  | 
|  | 11656 | requires_gnutls_tls1_3 | 
|  | 11657 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11658 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11659 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11660 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11661 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11662 | run_test    "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11663 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11664 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11665 | key_file=data_files/ecdsa_secp521r1.key" \ | 
|  | 11666 | 0 \ | 
|  | 11667 | -c "got a certificate request" \ | 
|  | 11668 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11669 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11670 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11671 |  | 
|  | 11672 | requires_openssl_tls1_3 | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11673 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11674 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11675 | requires_config_enabled MBEDTLS_RSA_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11676 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11677 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11678 | run_test    "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11679 | "$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] | 11680 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11681 | 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] | 11682 | 0 \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11683 | -c "got a certificate request" \ | 
|  | 11684 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11685 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11686 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11687 |  | 
|  | 11688 | requires_gnutls_tls1_3 | 
|  | 11689 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11690 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11691 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11692 | requires_config_enabled MBEDTLS_RSA_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11693 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11694 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11695 | run_test    "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11696 | "$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] | 11697 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11698 | 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] | 11699 | 0 \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11700 | -c "got a certificate request" \ | 
|  | 11701 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11702 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11703 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11704 |  | 
| Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11705 | requires_openssl_tls1_3 | 
| Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11706 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11707 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11708 | requires_config_enabled MBEDTLS_RSA_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11709 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11710 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11711 | run_test    "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ | 
|  | 11712 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11713 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11714 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ | 
|  | 11715 | 0 \ | 
|  | 11716 | -c "got a certificate request" \ | 
|  | 11717 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11718 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11719 | -c "Protocol is TLSv1.3" | 
|  | 11720 |  | 
|  | 11721 | requires_gnutls_tls1_3 | 
|  | 11722 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11723 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11724 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11725 | requires_config_enabled MBEDTLS_RSA_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11726 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11727 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11728 | run_test    "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ | 
|  | 11729 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11730 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11731 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ | 
|  | 11732 | 0 \ | 
|  | 11733 | -c "got a certificate request" \ | 
|  | 11734 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11735 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11736 | -c "Protocol is TLSv1.3" | 
|  | 11737 |  | 
|  | 11738 | requires_openssl_tls1_3 | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11739 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11740 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11741 | requires_config_enabled MBEDTLS_RSA_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11742 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11743 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11744 | run_test    "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ | 
|  | 11745 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11746 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11747 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ | 
|  | 11748 | 0 \ | 
|  | 11749 | -c "got a certificate request" \ | 
|  | 11750 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11751 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11752 | -c "Protocol is TLSv1.3" | 
|  | 11753 |  | 
|  | 11754 | requires_gnutls_tls1_3 | 
|  | 11755 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11756 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11757 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11758 | requires_config_enabled MBEDTLS_RSA_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11759 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11760 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11761 | run_test    "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ | 
|  | 11762 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11763 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11764 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ | 
|  | 11765 | 0 \ | 
|  | 11766 | -c "got a certificate request" \ | 
|  | 11767 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11768 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11769 | -c "Protocol is TLSv1.3" | 
|  | 11770 |  | 
|  | 11771 | requires_openssl_tls1_3 | 
| Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11772 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11773 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11774 | requires_config_enabled MBEDTLS_RSA_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11775 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11776 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11777 | 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] | 11778 | "$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] | 11779 | -sigalgs ecdsa_secp256r1_sha256" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11780 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11781 | 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] | 11782 | 1 \ | 
|  | 11783 | -c "got a certificate request" \ | 
|  | 11784 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11785 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 11786 | -c "no suitable signature algorithm" | 
| Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11787 |  | 
|  | 11788 | requires_gnutls_tls1_3 | 
|  | 11789 | requires_gnutls_next_no_ticket | 
| Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11790 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11791 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11792 | requires_config_enabled MBEDTLS_RSA_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11793 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11794 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11795 | run_test    "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ | 
|  | 11796 | "$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] | 11797 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11798 | 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] | 11799 | 1 \ | 
|  | 11800 | -c "got a certificate request" \ | 
|  | 11801 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11802 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 11803 | -c "no suitable signature algorithm" | 
| Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11804 |  | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11805 | # Test using an opaque private key for client authentication | 
|  | 11806 | requires_openssl_tls1_3 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11807 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11808 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11809 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11810 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11811 | run_test    "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ | 
|  | 11812 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ | 
|  | 11813 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ | 
|  | 11814 | 0 \ | 
|  | 11815 | -c "got a certificate request" \ | 
|  | 11816 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11817 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11818 | -c "Protocol is TLSv1.3" | 
|  | 11819 |  | 
|  | 11820 | requires_gnutls_tls1_3 | 
|  | 11821 | requires_gnutls_next_no_ticket | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11822 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11823 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11824 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11825 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11826 | run_test    "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ | 
|  | 11827 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ | 
|  | 11828 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ | 
|  | 11829 | key_file=data_files/cli2.key key_opaque=1" \ | 
|  | 11830 | 0 \ | 
|  | 11831 | -c "got a certificate request" \ | 
|  | 11832 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11833 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11834 | -c "Protocol is TLSv1.3" | 
|  | 11835 |  | 
|  | 11836 | requires_openssl_tls1_3 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11837 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11838 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11839 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11840 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11841 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11842 | run_test    "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ | 
|  | 11843 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
|  | 11844 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ | 
|  | 11845 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ | 
|  | 11846 | 0 \ | 
|  | 11847 | -c "got a certificate request" \ | 
|  | 11848 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11849 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11850 | -c "Protocol is TLSv1.3" | 
|  | 11851 |  | 
|  | 11852 | requires_gnutls_tls1_3 | 
|  | 11853 | requires_gnutls_next_no_ticket | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11854 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11855 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11856 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11857 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11858 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11859 | run_test    "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ | 
|  | 11860 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
|  | 11861 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ | 
|  | 11862 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ | 
|  | 11863 | 0 \ | 
|  | 11864 | -c "got a certificate request" \ | 
|  | 11865 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11866 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11867 | -c "Protocol is TLSv1.3" | 
|  | 11868 |  | 
|  | 11869 | requires_openssl_tls1_3 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11870 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11871 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11872 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11873 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11874 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11875 | run_test    "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ | 
|  | 11876 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
|  | 11877 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ | 
|  | 11878 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ | 
|  | 11879 | 0 \ | 
|  | 11880 | -c "got a certificate request" \ | 
|  | 11881 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11882 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11883 | -c "Protocol is TLSv1.3" | 
|  | 11884 |  | 
|  | 11885 | requires_gnutls_tls1_3 | 
|  | 11886 | requires_gnutls_next_no_ticket | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11887 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11888 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11889 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11890 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11891 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11892 | run_test    "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ | 
|  | 11893 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
|  | 11894 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ | 
|  | 11895 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ | 
|  | 11896 | 0 \ | 
|  | 11897 | -c "got a certificate request" \ | 
|  | 11898 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11899 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11900 | -c "Protocol is TLSv1.3" | 
|  | 11901 |  | 
|  | 11902 | requires_openssl_tls1_3 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11903 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11904 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11905 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11906 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11907 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11908 | run_test    "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ | 
|  | 11909 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
|  | 11910 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ | 
|  | 11911 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ | 
|  | 11912 | 0 \ | 
|  | 11913 | -c "got a certificate request" \ | 
|  | 11914 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11915 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11916 | -c "Protocol is TLSv1.3" | 
|  | 11917 |  | 
|  | 11918 | requires_gnutls_tls1_3 | 
|  | 11919 | requires_gnutls_next_no_ticket | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11920 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11921 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11922 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11923 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11924 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11925 | run_test    "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ | 
|  | 11926 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
|  | 11927 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ | 
|  | 11928 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ | 
|  | 11929 | 0 \ | 
|  | 11930 | -c "got a certificate request" \ | 
|  | 11931 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11932 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11933 | -c "Protocol is TLSv1.3" | 
|  | 11934 |  | 
|  | 11935 | requires_openssl_tls1_3 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11936 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11937 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11938 | requires_config_enabled MBEDTLS_RSA_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11939 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11940 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11941 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11942 | run_test    "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ | 
|  | 11943 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
|  | 11944 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ | 
|  | 11945 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ | 
|  | 11946 | 0 \ | 
|  | 11947 | -c "got a certificate request" \ | 
|  | 11948 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 11949 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 11950 | -c "Protocol is TLSv1.3" | 
|  | 11951 |  | 
|  | 11952 | requires_gnutls_tls1_3 | 
|  | 11953 | requires_gnutls_next_no_ticket | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11954 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11955 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11956 | requires_config_enabled MBEDTLS_RSA_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11957 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| 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 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11960 | run_test    "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ | 
|  | 11961 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
|  | 11962 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ | 
|  | 11963 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ | 
|  | 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_openssl_tls1_3 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11971 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11972 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11973 | requires_config_enabled MBEDTLS_RSA_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11974 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| 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 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11977 | run_test    "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ | 
|  | 11978 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11979 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11980 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ | 
|  | 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_gnutls_tls1_3 | 
|  | 11988 | requires_gnutls_next_no_ticket | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11989 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 11990 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 11991 | requires_config_enabled MBEDTLS_RSA_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11992 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11993 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 11994 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11995 | run_test    "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ | 
|  | 11996 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11997 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11998 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ | 
|  | 11999 | 0 \ | 
|  | 12000 | -c "got a certificate request" \ | 
|  | 12001 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 12002 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 12003 | -c "Protocol is TLSv1.3" | 
|  | 12004 |  | 
|  | 12005 | requires_openssl_tls1_3 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12006 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12007 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 12008 | requires_config_enabled MBEDTLS_RSA_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12009 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| 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 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12012 | run_test    "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ | 
|  | 12013 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12014 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12015 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ | 
|  | 12016 | 0 \ | 
|  | 12017 | -c "got a certificate request" \ | 
|  | 12018 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 12019 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 12020 | -c "Protocol is TLSv1.3" | 
|  | 12021 |  | 
|  | 12022 | requires_gnutls_tls1_3 | 
|  | 12023 | requires_gnutls_next_no_ticket | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12024 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12025 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 12026 | requires_config_enabled MBEDTLS_RSA_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12027 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12028 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12029 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12030 | run_test    "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ | 
|  | 12031 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12032 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12033 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ | 
|  | 12034 | 0 \ | 
|  | 12035 | -c "got a certificate request" \ | 
|  | 12036 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 12037 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 12038 | -c "Protocol is TLSv1.3" | 
|  | 12039 |  | 
|  | 12040 | requires_openssl_tls1_3 | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12041 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12042 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 12043 | requires_config_enabled MBEDTLS_RSA_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12044 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12045 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12046 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12047 | run_test    "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ | 
|  | 12048 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 | 
|  | 12049 | -sigalgs ecdsa_secp256r1_sha256" \ | 
|  | 12050 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ | 
|  | 12051 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ | 
|  | 12052 | 1 \ | 
|  | 12053 | -c "got a certificate request" \ | 
|  | 12054 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 12055 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12056 | -c "no suitable signature algorithm" | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12057 |  | 
|  | 12058 | requires_gnutls_tls1_3 | 
|  | 12059 | requires_gnutls_next_no_ticket | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12060 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12061 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 12062 | requires_config_enabled MBEDTLS_RSA_C | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12063 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12064 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12065 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12066 | run_test    "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ | 
|  | 12067 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ | 
|  | 12068 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ | 
|  | 12069 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ | 
|  | 12070 | 1 \ | 
|  | 12071 | -c "got a certificate request" \ | 
|  | 12072 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 12073 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12074 | -c "no suitable signature algorithm" | 
| Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12075 |  | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12076 | requires_openssl_tls1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12077 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12078 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12079 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12080 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12081 | 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] | 12082 | "$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] | 12083 | "$P_CLI debug_level=4" \ | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12084 | 0 \ | 
|  | 12085 | -c "received HelloRetryRequest message" \ | 
| XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12086 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12087 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12088 | -c "Protocol is TLSv1.3" \ | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12089 | -c "HTTP/1.0 200 ok" | 
|  | 12090 |  | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12091 | requires_openssl_tls1_3 | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12092 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12093 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12094 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12095 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12096 | 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] | 12097 | "$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] | 12098 | "$P_CLI debug_level=4" \ | 
| XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12099 | 0 \ | 
| Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12100 | -c "received HelloRetryRequest message" \ | 
| XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12101 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12102 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12103 | -c "Protocol is TLSv1.3" \ | 
| XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12104 | -c "HTTP/1.0 200 ok" | 
| Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12105 |  | 
|  | 12106 | requires_gnutls_tls1_3 | 
|  | 12107 | requires_gnutls_next_no_ticket | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12108 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12109 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12110 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12111 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12112 | 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] | 12113 | "$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] | 12114 | "$P_CLI debug_level=4" \ | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12115 | 0 \ | 
|  | 12116 | -c "received HelloRetryRequest message" \ | 
| XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12117 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12118 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12119 | -c "Protocol is TLSv1.3" \ | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12120 | -c "HTTP/1.0 200 OK" | 
|  | 12121 |  | 
|  | 12122 | requires_gnutls_tls1_3 | 
|  | 12123 | requires_gnutls_next_no_ticket | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12124 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12125 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12126 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12127 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12128 | 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] | 12129 | "$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] | 12130 | "$P_CLI debug_level=4" \ | 
| XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12131 | 0 \ | 
| Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12132 | -c "received HelloRetryRequest message" \ | 
| XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12133 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ | 
| Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12134 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12135 | -c "Protocol is TLSv1.3" \ | 
| XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12136 | -c "HTTP/1.0 200 OK" | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12137 |  | 
| Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12138 | requires_openssl_tls1_3 | 
| XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12139 | requires_config_enabled MBEDTLS_DEBUG_C | 
| XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12140 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12141 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12142 | run_test    "TLS 1.3: Server side check - openssl" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12143 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12144 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ | 
| Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12145 | 0 \ | 
| Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12146 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12147 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12148 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
| Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12149 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
| Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12150 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 12151 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
| Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12152 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ | 
| Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12153 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" | 
| XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12154 |  | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12155 | requires_openssl_tls1_3 | 
| XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12156 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12157 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12158 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12159 | run_test    "TLS 1.3: Server side check - openssl with client authentication" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12160 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Jerry Yu | 7eaadae | 2022-05-23 14:53:27 +0800 | [diff] [blame] | 12161 | "$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] | 12162 | 0 \ | 
| XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12163 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12164 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12165 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 12166 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
|  | 12167 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
| Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12168 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 12169 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
| XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12170 | -s "=> write certificate request" \ | 
| XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12171 | -s "=> parse client hello" \ | 
|  | 12172 | -s "<= parse client hello" | 
|  | 12173 |  | 
| XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12174 | requires_gnutls_tls1_3 | 
|  | 12175 | requires_gnutls_next_no_ticket | 
| XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12176 | requires_config_enabled MBEDTLS_DEBUG_C | 
| XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12177 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12178 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12179 | run_test    "TLS 1.3: Server side check - gnutls" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12180 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 12181 | "$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] | 12182 | 0 \ | 
| Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12183 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12184 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12185 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
| Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12186 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
| Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12187 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 12188 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
| Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12189 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ | 
|  | 12190 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ | 
|  | 12191 | -c "HTTP/1.0 200 OK" | 
| XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12192 |  | 
| XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12193 | requires_gnutls_tls1_3 | 
|  | 12194 | requires_gnutls_next_no_ticket | 
| XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12195 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12196 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12197 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12198 | run_test    "TLS 1.3: Server side check - gnutls with client authentication" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12199 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12200 | "$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] | 12201 | 0 \ | 
| XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12202 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12203 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12204 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 12205 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
|  | 12206 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
| Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12207 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 12208 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
| XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12209 | -s "=> write certificate request" \ | 
| XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12210 | -s "=> parse client hello" \ | 
|  | 12211 | -s "<= parse client hello" | 
|  | 12212 |  | 
| Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12213 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12214 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12215 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12216 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12217 | run_test    "TLS 1.3: Server side check - mbedtls" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12218 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12219 | "$P_CLI debug_level=4" \ | 
| XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12220 | 0 \ | 
| Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12221 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12222 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12223 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
| Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12224 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
| Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12225 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
| Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12226 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ | 
|  | 12227 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ | 
|  | 12228 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ | 
|  | 12229 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ | 
|  | 12230 | -c "HTTP/1.0 200 OK" | 
| Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12231 |  | 
| XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12232 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12233 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12234 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12235 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12236 | run_test    "TLS 1.3: Server side check - mbedtls with client authentication" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12237 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12238 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
| XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12239 | 0 \ | 
| XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12240 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12241 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12242 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 12243 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
| Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12244 | -s "=> write certificate request" \ | 
| XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12245 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
| XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12246 | -s "=> parse client hello" \ | 
|  | 12247 | -s "<= parse client hello" | 
|  | 12248 |  | 
| XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12249 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12250 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12251 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12252 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12253 | run_test    "TLS 1.3: Server side check - mbedtls with client empty certificate" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12254 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12255 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ | 
| XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12256 | 1 \ | 
|  | 12257 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12258 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12259 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 12260 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
|  | 12261 | -s "=> write certificate request" \ | 
|  | 12262 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ | 
|  | 12263 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
|  | 12264 | -s "=> parse client hello" \ | 
|  | 12265 | -s "<= parse client hello" | 
|  | 12266 |  | 
| XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12267 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12268 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12269 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12270 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12271 | run_test    "TLS 1.3: Server side check - mbedtls with optional client authentication" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12272 | "$P_SRV debug_level=4 auth_mode=optional crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12273 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ | 
| XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12274 | 0 \ | 
|  | 12275 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12276 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12277 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 12278 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
|  | 12279 | -s "=> write certificate request" \ | 
|  | 12280 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ | 
|  | 12281 | -s "=> parse client hello" \ | 
|  | 12282 | -s "<= parse client hello" | 
| Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12283 |  | 
|  | 12284 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12285 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 12286 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12287 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12288 | run_test "TLS 1.3: server: HRR check - mbedtls" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12289 | "$P_SRV debug_level=4 curves=secp384r1" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12290 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12291 | 0 \ | 
| Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12292 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
|  | 12293 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ | 
|  | 12294 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 12295 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ | 
|  | 12296 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ | 
|  | 12297 | -s "selected_group: secp384r1" \ | 
| Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12298 | -s "=> write hello retry request" \ | 
|  | 12299 | -s "<= write hello retry request" | 
|  | 12300 |  | 
| Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12301 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12302 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12303 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12304 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12305 | run_test    "TLS 1.3: Server side check, no server certificate available" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12306 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12307 | "$P_CLI debug_level=4" \ | 
| Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12308 | 1 \ | 
|  | 12309 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ | 
|  | 12310 | -s "No certificate available." | 
|  | 12311 |  | 
| XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12312 | requires_openssl_tls1_3 | 
| XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12313 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12314 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12315 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12316 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12317 | run_test    "TLS 1.3: Server side check - openssl with sni" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12318 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ | 
| XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12319 | 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] | 12320 | "$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" \ | 
|  | 12321 | 0 \ | 
| XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12322 | -s "parse ServerName extension" \ | 
| XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12323 | -s "HTTP/1.0 200 OK" | 
| XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12324 |  | 
| XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12325 | requires_gnutls_tls1_3 | 
| XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12326 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12327 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12328 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12329 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12330 | run_test    "TLS 1.3: Server side check - gnutls with sni" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12331 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ | 
| XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12332 | 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] | 12333 | "$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" \ | 
|  | 12334 | 0 \ | 
| XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12335 | -s "parse ServerName extension" \ | 
| XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12336 | -s "HTTP/1.0 200 OK" | 
| XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12337 |  | 
| XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12338 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12339 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12340 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12341 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12342 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12343 | run_test    "TLS 1.3: Server side check - mbedtls with sni" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12344 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ | 
| XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12345 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
| Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12346 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
| XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12347 | 0 \ | 
| XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12348 | -s "parse ServerName extension" \ | 
| XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12349 | -s "HTTP/1.0 200 OK" | 
| XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12350 |  | 
| Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12351 | for i in opt-testcases/*.sh | 
| Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12352 | do | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12353 | TEST_SUITE_NAME=${i##*/} | 
|  | 12354 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} | 
|  | 12355 | . "$i" | 
| Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12356 | done | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12357 | unset TEST_SUITE_NAME | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12358 |  | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12359 | # Test 1.3 compatibility mode | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12360 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12361 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12362 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12363 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12364 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12365 | run_test    "TLS 1.3 m->m both peers do not support middlebox compatibility" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12366 | "$P_SRV debug_level=4 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12367 | "$P_CLI debug_level=4" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12368 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12369 | -s "Protocol is TLSv1.3" \ | 
|  | 12370 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12371 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ | 
|  | 12372 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12373 |  | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12374 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12375 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12376 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12377 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12378 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12379 | run_test    "TLS 1.3 m->m both with middlebox compat support" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12380 | "$P_SRV debug_level=4 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12381 | "$P_CLI debug_level=4" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12382 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12383 | -s "Protocol is TLSv1.3" \ | 
|  | 12384 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12385 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ | 
|  | 12386 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12387 |  | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12388 | requires_openssl_tls1_3 | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12389 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12390 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12391 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12392 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12393 | 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] | 12394 | "$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] | 12395 | "$P_CLI debug_level=4" \ | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12396 | 0 \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12397 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12398 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ | 
|  | 12399 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12400 |  | 
|  | 12401 | requires_openssl_tls1_3 | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12402 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12403 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12404 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12405 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12406 | 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] | 12407 | "$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] | 12408 | "$P_CLI debug_level=4" \ | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12409 | 1 \ | 
|  | 12410 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" | 
|  | 12411 |  | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12412 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12413 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12414 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12415 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12416 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12417 | run_test    "TLS 1.3 m->O both with middlebox compat support" \ | 
|  | 12418 | "$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] | 12419 | "$P_CLI debug_level=4" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12420 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12421 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12422 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12423 |  | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12424 | requires_gnutls_tls1_3 | 
|  | 12425 | requires_gnutls_next_no_ticket | 
|  | 12426 | requires_gnutls_next_disable_tls13_compat | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12427 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12428 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12429 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12430 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12431 | run_test    "TLS 1.3 m->G both peers do not support middlebox compatibility" \ | 
|  | 12432 | "$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] | 12433 | "$P_CLI debug_level=4" \ | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12434 | 0 \ | 
| Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12435 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12436 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ | 
|  | 12437 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12438 |  | 
|  | 12439 | requires_gnutls_tls1_3 | 
|  | 12440 | requires_gnutls_next_no_ticket | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12441 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12442 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12443 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12444 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12445 | run_test    "TLS 1.3 m->G server with middlebox compat support, not client" \ | 
|  | 12446 | "$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] | 12447 | "$P_CLI debug_level=4" \ | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12448 | 1 \ | 
|  | 12449 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" | 
|  | 12450 |  | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12451 | requires_gnutls_tls1_3 | 
|  | 12452 | requires_gnutls_next_no_ticket | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12453 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12454 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12455 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12456 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12457 | run_test    "TLS 1.3 m->G both with middlebox compat support" \ | 
|  | 12458 | "$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] | 12459 | "$P_CLI debug_level=4" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12460 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12461 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12462 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12463 |  | 
|  | 12464 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12465 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12466 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12467 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12468 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12469 | run_test    "TLS 1.3 O->m both peers do not support middlebox compatibility" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12470 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12471 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12472 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12473 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12474 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ | 
|  | 12475 | -C "14 03 03 00 01" | 
|  | 12476 |  | 
|  | 12477 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12478 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12479 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12480 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12481 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12482 | run_test    "TLS 1.3 O->m server with middlebox compat support, not client" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12483 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12484 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12485 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12486 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12487 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" | 
|  | 12488 |  | 
|  | 12489 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12490 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12491 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12492 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12493 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12494 | run_test    "TLS 1.3 O->m both with middlebox compat support" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12495 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12496 | "$O_NEXT_CLI -msg -debug" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12497 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12498 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12499 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ | 
|  | 12500 | -c "14 03 03 00 01" | 
|  | 12501 |  | 
|  | 12502 | requires_gnutls_tls1_3 | 
|  | 12503 | requires_gnutls_next_no_ticket | 
|  | 12504 | requires_gnutls_next_disable_tls13_compat | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12505 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12506 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12507 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12508 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12509 | run_test    "TLS 1.3 G->m both peers do not support middlebox compatibility" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12510 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12511 | "$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] | 12512 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12513 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12514 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ | 
|  | 12515 | -C "SSL 3.3 ChangeCipherSpec packet received" | 
|  | 12516 |  | 
|  | 12517 | requires_gnutls_tls1_3 | 
|  | 12518 | requires_gnutls_next_no_ticket | 
|  | 12519 | requires_gnutls_next_disable_tls13_compat | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12520 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12521 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12522 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12523 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12524 | run_test    "TLS 1.3 G->m server with middlebox compat support, not client" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12525 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12526 | "$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] | 12527 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12528 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12529 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ | 
|  | 12530 | -c "SSL 3.3 ChangeCipherSpec packet received" \ | 
|  | 12531 | -c "discarding change cipher spec in TLS1.3" | 
|  | 12532 |  | 
|  | 12533 | requires_gnutls_tls1_3 | 
|  | 12534 | requires_gnutls_next_no_ticket | 
|  | 12535 | requires_gnutls_next_disable_tls13_compat | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12536 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12537 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12538 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12539 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12540 | run_test    "TLS 1.3 G->m both with middlebox compat support" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12541 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12542 | "$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] | 12543 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12544 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12545 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ | 
|  | 12546 | -c "SSL 3.3 ChangeCipherSpec packet received" | 
|  | 12547 |  | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12548 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12549 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12550 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12551 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12552 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12553 | run_test    "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12554 | "$P_SRV debug_level=4 curves=secp384r1 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12555 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12556 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12557 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12558 | -c "Protocol is TLSv1.3" \ | 
|  | 12559 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12560 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12561 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12562 |  | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12563 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12564 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12565 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12566 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12567 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12568 | run_test    "TLS 1.3 m->m HRR both with middlebox compat support" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12569 | "$P_SRV debug_level=4 curves=secp384r1 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12570 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12571 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12572 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12573 | -c "Protocol is TLSv1.3" \ | 
|  | 12574 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12575 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12576 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12577 |  | 
|  | 12578 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12579 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12580 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12581 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12582 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12583 | run_test    "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ | 
|  | 12584 | "$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] | 12585 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12586 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12587 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12588 | -c "received HelloRetryRequest message" \ | 
|  | 12589 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ | 
|  | 12590 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12591 |  | 
|  | 12592 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12593 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12594 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12595 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12596 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12597 | run_test    "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ | 
|  | 12598 | "$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] | 12599 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12600 | 1 \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12601 | -c "received HelloRetryRequest message" \ | 
|  | 12602 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" | 
|  | 12603 |  | 
|  | 12604 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12605 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12606 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12607 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12608 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12609 | run_test    "TLS 1.3 m->O HRR both with middlebox compat support" \ | 
|  | 12610 | "$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] | 12611 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12612 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12613 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12614 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12615 |  | 
|  | 12616 | requires_gnutls_tls1_3 | 
|  | 12617 | requires_gnutls_next_no_ticket | 
|  | 12618 | requires_gnutls_next_disable_tls13_compat | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12619 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12620 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12621 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12622 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12623 | run_test    "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ | 
|  | 12624 | "$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] | 12625 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12626 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12627 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12628 | -c "received HelloRetryRequest message" \ | 
|  | 12629 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ | 
|  | 12630 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12631 |  | 
|  | 12632 | requires_gnutls_tls1_3 | 
|  | 12633 | requires_gnutls_next_no_ticket | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12634 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12635 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12636 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12637 | requires_config_enabled 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->G HRR server with middlebox compat support, not client" \ | 
|  | 12639 | "$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] | 12640 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12641 | 1 \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12642 | -c "received HelloRetryRequest message" \ | 
|  | 12643 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" | 
|  | 12644 |  | 
|  | 12645 | requires_gnutls_tls1_3 | 
|  | 12646 | requires_gnutls_next_no_ticket | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12647 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12648 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12649 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12650 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12651 | run_test    "TLS 1.3 m->G HRR both with middlebox compat support" \ | 
|  | 12652 | "$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] | 12653 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12654 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12655 | -c "Protocol is TLSv1.3" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12656 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" | 
|  | 12657 |  | 
|  | 12658 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12659 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12660 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12661 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12662 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12663 | run_test    "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12664 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12665 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12666 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12667 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12668 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12669 | -C "14 03 03 00 01" | 
|  | 12670 |  | 
|  | 12671 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12672 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12673 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12674 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12675 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12676 | run_test    "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12677 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12678 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12679 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12680 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12681 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12682 |  | 
|  | 12683 | requires_openssl_tls1_3 | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12684 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12685 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12686 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12687 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12688 | run_test    "TLS 1.3 O->m HRR both with middlebox compat support" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12689 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12690 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12691 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12692 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12693 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12694 | -c "14 03 03 00 01" | 
|  | 12695 |  | 
|  | 12696 | requires_gnutls_tls1_3 | 
|  | 12697 | requires_gnutls_next_no_ticket | 
|  | 12698 | requires_gnutls_next_disable_tls13_compat | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12699 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 12700 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12701 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12702 | requires_config_enabled 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 G->m HRR both peers do not support middlebox compatibility" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12704 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12705 | "$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] | 12706 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12707 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12708 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12709 | -C "SSL 3.3 ChangeCipherSpec packet received" | 
|  | 12710 |  | 
|  | 12711 | requires_gnutls_tls1_3 | 
|  | 12712 | requires_gnutls_next_no_ticket | 
|  | 12713 | requires_gnutls_next_disable_tls13_compat | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12714 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12715 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12716 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12717 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12718 | run_test    "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12719 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12720 | "$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] | 12721 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12722 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12723 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12724 | -c "SSL 3.3 ChangeCipherSpec packet received" \ | 
|  | 12725 | -c "discarding change cipher spec in TLS1.3" | 
|  | 12726 |  | 
|  | 12727 | requires_gnutls_tls1_3 | 
|  | 12728 | requires_gnutls_next_no_ticket | 
|  | 12729 | requires_gnutls_next_disable_tls13_compat | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12730 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12731 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12732 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12733 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12734 | run_test    "TLS 1.3 G->m HRR both with middlebox compat support" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12735 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12736 | "$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] | 12737 | 0 \ | 
| Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12738 | -s "Protocol is TLSv1.3" \ | 
| Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12739 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ | 
| Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12740 | -c "SSL 3.3 ChangeCipherSpec packet received" | 
|  | 12741 |  | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12742 | requires_openssl_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12743 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12744 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12745 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12746 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12747 | run_test    "TLS 1.3: Check signature algorithm order, m->O" \ | 
|  | 12748 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key | 
|  | 12749 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache | 
|  | 12750 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ | 
|  | 12751 | "$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] | 12752 | 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] | 12753 | 0 \ | 
|  | 12754 | -c "Protocol is TLSv1.3" \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12755 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12756 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 12757 |  | 
|  | 12758 | requires_gnutls_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12759 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12760 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12761 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12762 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12763 | run_test    "TLS 1.3: Check signature algorithm order, m->G" \ | 
|  | 12764 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key | 
|  | 12765 | -d 4 | 
|  | 12766 | --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 " \ | 
|  | 12767 | "$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] | 12768 | 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] | 12769 | 0 \ | 
|  | 12770 | -c "Protocol is TLSv1.3" \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12771 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12772 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 12773 |  | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12774 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12775 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12776 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12777 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12778 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12779 | run_test    "TLS 1.3: Check signature algorithm order, m->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12780 | "$P_SRV debug_level=4 auth_mode=required | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12781 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key | 
|  | 12782 | crt_file=data_files/server5.crt key_file=data_files/server5.key | 
|  | 12783 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ | 
|  | 12784 | "$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] | 12785 | 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] | 12786 | 0 \ | 
|  | 12787 | -c "Protocol is TLSv1.3" \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12788 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ | 
|  | 12789 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12790 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ | 
|  | 12791 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 12792 |  | 
|  | 12793 | requires_openssl_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12794 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12795 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12796 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12797 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12798 | run_test    "TLS 1.3: Check signature algorithm order, O->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12799 | "$P_SRV debug_level=4 auth_mode=required | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12800 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key | 
|  | 12801 | crt_file=data_files/server5.crt key_file=data_files/server5.key | 
|  | 12802 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ | 
|  | 12803 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ | 
|  | 12804 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ | 
|  | 12805 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256"  \ | 
|  | 12806 | 0 \ | 
|  | 12807 | -c "TLSv1.3" \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12808 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12809 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" | 
|  | 12810 |  | 
|  | 12811 | requires_gnutls_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12812 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12813 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12814 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12815 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12816 | run_test    "TLS 1.3: Check signature algorithm order, G->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12817 | "$P_SRV debug_level=4 auth_mode=required | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12818 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key | 
|  | 12819 | crt_file=data_files/server5.crt key_file=data_files/server5.key | 
|  | 12820 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ | 
|  | 12821 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ | 
|  | 12822 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ | 
|  | 12823 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384"  \ | 
|  | 12824 | 0 \ | 
|  | 12825 | -c "Negotiated version: 3.4" \ | 
|  | 12826 | -c "HTTP/1.0 200 [Oo][Kk]" \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12827 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12828 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" | 
|  | 12829 |  | 
|  | 12830 | requires_gnutls_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12831 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12832 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12833 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12834 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12835 | run_test    "TLS 1.3: Check server no suitable signature algorithm, G->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12836 | "$P_SRV debug_level=4 auth_mode=required | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12837 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key | 
|  | 12838 | crt_file=data_files/server5.crt key_file=data_files/server5.key | 
|  | 12839 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ | 
|  | 12840 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ | 
|  | 12841 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ | 
|  | 12842 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512"  \ | 
|  | 12843 | 1 \ | 
| Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12844 | -S "ssl_tls13_pick_key_cert:check signature algorithm" | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12845 |  | 
|  | 12846 | requires_openssl_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12847 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12848 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12849 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12850 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12851 | run_test    "TLS 1.3: Check server no suitable signature algorithm, O->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12852 | "$P_SRV debug_level=4 auth_mode=required | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12853 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key | 
|  | 12854 | crt_file=data_files/server5.crt key_file=data_files/server5.key | 
|  | 12855 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ | 
|  | 12856 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ | 
|  | 12857 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ | 
|  | 12858 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512"  \ | 
|  | 12859 | 1 \ | 
| Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12860 | -S "ssl_tls13_pick_key_cert:check signature algorithm" | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12861 |  | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12862 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12863 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12864 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12865 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12866 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12867 | run_test    "TLS 1.3: Check server no suitable signature algorithm, m->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12868 | "$P_SRV debug_level=4 auth_mode=required | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12869 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key | 
|  | 12870 | crt_file=data_files/server5.crt key_file=data_files/server5.key | 
|  | 12871 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ | 
|  | 12872 | "$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] | 12873 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12874 | 1 \ | 
| Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12875 | -S "ssl_tls13_pick_key_cert:check signature algorithm" | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12876 |  | 
|  | 12877 | requires_gnutls_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12878 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12879 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12880 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12881 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12882 | run_test    "TLS 1.3: Check server no suitable certificate, G->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12883 | "$P_SRV debug_level=4 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12884 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key | 
|  | 12885 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ | 
|  | 12886 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ | 
|  | 12887 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256"  \ | 
|  | 12888 | 1 \ | 
|  | 12889 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" | 
|  | 12890 |  | 
|  | 12891 | requires_openssl_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12892 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12893 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12894 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12895 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12896 | run_test    "TLS 1.3: Check server no suitable certificate, O->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12897 | "$P_SRV debug_level=4 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12898 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key | 
|  | 12899 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ | 
|  | 12900 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ | 
|  | 12901 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256"  \ | 
|  | 12902 | 1 \ | 
|  | 12903 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" | 
|  | 12904 |  | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12905 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12906 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12907 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12908 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12909 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12910 | run_test    "TLS 1.3: Check server no suitable certificate, m->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12911 | "$P_SRV debug_level=4 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12912 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key | 
|  | 12913 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ | 
|  | 12914 | "$P_CLI allow_sha1=0 debug_level=4 \ | 
| Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12915 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12916 | 1 \ | 
|  | 12917 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" | 
|  | 12918 |  | 
|  | 12919 | requires_openssl_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12920 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12921 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12922 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12923 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12924 | run_test    "TLS 1.3: Check client no signature algorithm, m->O" \ | 
|  | 12925 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key | 
|  | 12926 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache | 
|  | 12927 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ | 
|  | 12928 | "$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] | 12929 | 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] | 12930 | 1 \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12931 | -c "no suitable signature algorithm" | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12932 |  | 
|  | 12933 | requires_gnutls_tls1_3 | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12934 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12935 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12936 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12937 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12938 | run_test    "TLS 1.3: Check client no signature algorithm, m->G" \ | 
|  | 12939 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key | 
|  | 12940 | -d 4 | 
|  | 12941 | --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 " \ | 
|  | 12942 | "$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] | 12943 | 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] | 12944 | 1 \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12945 | -c "no suitable signature algorithm" | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12946 |  | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12947 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12948 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12949 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12950 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12951 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12952 | run_test    "TLS 1.3: Check client no signature algorithm, m->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12953 | "$P_SRV debug_level=4 auth_mode=required | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12954 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key | 
|  | 12955 | crt_file=data_files/server5.crt key_file=data_files/server5.key | 
|  | 12956 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ | 
|  | 12957 | "$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] | 12958 | 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] | 12959 | 1 \ | 
| Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12960 | -c "no suitable signature algorithm" | 
| Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12961 |  | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12962 | requires_openssl_tls1_3 | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12963 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12964 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12965 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12966 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ | 
|  | 12967 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12968 | run_test    "TLS 1.3: NewSessionTicket: Basic check, m->O" \ | 
| Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12969 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ | 
|  | 12970 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12971 | 0 \ | 
|  | 12972 | -c "Protocol is TLSv1.3" \ | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12973 | -c "got new session ticket." \ | 
| Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12974 | -c "Saving session for reuse... ok" \ | 
| Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12975 | -c "Reconnecting with saved session" \ | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12976 | -c "HTTP/1.0 200 ok" | 
|  | 12977 |  | 
|  | 12978 | requires_gnutls_tls1_3 | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12979 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 12980 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12981 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 12982 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ | 
|  | 12983 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12984 | run_test    "TLS 1.3: NewSessionTicket: Basic check, m->G" \ | 
| Ronald Cron | a709a0f | 2022-09-27 16:46:11 +0200 | [diff] [blame] | 12985 | "$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] | 12986 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12987 | 0 \ | 
|  | 12988 | -c "Protocol is TLSv1.3" \ | 
| Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12989 | -c "got new session ticket." \ | 
| Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12990 | -c "Saving session for reuse... ok" \ | 
| Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12991 | -c "Reconnecting with saved session" \ | 
|  | 12992 | -c "HTTP/1.0 200 OK" \ | 
|  | 12993 | -s "This is a resumed session" | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12994 |  | 
| Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12995 | requires_openssl_tls1_3 | 
| Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12996 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS | 
|  | 12997 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 12998 | requires_config_enabled MBEDTLS_DEBUG_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12999 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 13000 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ | 
|  | 13001 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
| Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13002 | # https://github.com/openssl/openssl/issues/10714 | 
|  | 13003 | # Until now, OpenSSL client does not support reconnect. | 
|  | 13004 | skip_next_test | 
|  | 13005 | run_test    "TLS 1.3: NewSessionTicket: Basic check, O->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13006 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ | 
| Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13007 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ | 
|  | 13008 | 0 \ | 
|  | 13009 | -s "=> write NewSessionTicket msg" \ | 
| Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13010 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ | 
|  | 13011 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" | 
| Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13012 |  | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13013 | requires_gnutls_tls1_3 | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13014 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS | 
|  | 13015 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 13016 | requires_config_enabled MBEDTLS_DEBUG_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 \ | 
|  | 13019 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13020 | run_test    "TLS 1.3: NewSessionTicket: Basic check, G->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13021 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ | 
| Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13022 | "$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] | 13023 | 0 \ | 
| Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13024 | -c "Connecting again- trying to resume previous session" \ | 
|  | 13025 | -c "NEW SESSION TICKET (4) was received" \ | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13026 | -s "=> write NewSessionTicket msg" \ | 
| Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13027 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ | 
|  | 13028 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ | 
| Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13029 | -s "key exchange mode: ephemeral" \ | 
|  | 13030 | -s "key exchange mode: psk_ephemeral" \ | 
|  | 13031 | -s "found pre_shared_key extension" | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13032 |  | 
| Ronald Cron | 0a1c504 | 2023-02-20 10:44:22 +0100 | [diff] [blame] | 13033 | requires_gnutls_tls1_3 | 
|  | 13034 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS | 
|  | 13035 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 13036 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 13037 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 13038 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ | 
|  | 13039 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
| Ronald Cron | d89360b | 2023-02-21 08:53:33 +0100 | [diff] [blame] | 13040 | # Test the session resumption when the cipher suite for the original session is | 
|  | 13041 | # TLS1-3-AES-256-GCM-SHA384. In that case, the PSK is 384 bits long and not | 
|  | 13042 | # 256 bits long as with all the other TLS 1.3 cipher suites. | 
| Ronald Cron | 0a1c504 | 2023-02-20 10:44:22 +0100 | [diff] [blame] | 13043 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 | 
|  | 13044 | run_test    "TLS 1.3: NewSessionTicket: Basic check with AES-256-GCM only, G->m" \ | 
|  | 13045 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ | 
|  | 13046 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-256-GCM -V -r" \ | 
|  | 13047 | 0 \ | 
|  | 13048 | -c "Connecting again- trying to resume previous session" \ | 
|  | 13049 | -c "NEW SESSION TICKET (4) was received" \ | 
|  | 13050 | -s "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \ | 
|  | 13051 | -s "=> write NewSessionTicket msg" \ | 
|  | 13052 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ | 
|  | 13053 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ | 
|  | 13054 | -s "key exchange mode: ephemeral" \ | 
|  | 13055 | -s "key exchange mode: psk_ephemeral" \ | 
|  | 13056 | -s "found pre_shared_key extension" | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13057 |  | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13058 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS | 
|  | 13059 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 13060 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 13061 | requires_config_enabled MBEDTLS_DEBUG_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13062 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 13063 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ | 
|  | 13064 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13065 | run_test    "TLS 1.3: NewSessionTicket: Basic check, m->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13066 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ | 
| Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13067 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13068 | 0 \ | 
|  | 13069 | -c "Protocol is TLSv1.3" \ | 
| Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13070 | -c "got new session ticket ( 3 )" \ | 
| Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13071 | -c "Saving session for reuse... ok" \ | 
| Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13072 | -c "Reconnecting with saved session" \ | 
| Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13073 | -c "HTTP/1.0 200 OK"    \ | 
|  | 13074 | -s "=> write NewSessionTicket msg" \ | 
| Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13075 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ | 
|  | 13076 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ | 
| Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13077 | -s "key exchange mode: ephemeral" \ | 
|  | 13078 | -s "key exchange mode: psk_ephemeral" \ | 
|  | 13079 | -s "found pre_shared_key extension" | 
|  | 13080 |  | 
| Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13081 | requires_openssl_tls1_3 | 
|  | 13082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 13083 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 13084 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13085 | 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] | 13086 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key | 
|  | 13087 | -msg -tls1_2 | 
|  | 13088 | -Verify 10 " \ | 
|  | 13089 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key | 
|  | 13090 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 | 
|  | 13091 | min_version=tls12 max_version=tls13 " \ | 
|  | 13092 | 0 \ | 
|  | 13093 | -c "Protocol is TLSv1.2" \ | 
|  | 13094 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 13095 |  | 
|  | 13096 |  | 
|  | 13097 | requires_gnutls_tls1_3 | 
|  | 13098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 13099 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 13100 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13101 | 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] | 13102 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key | 
|  | 13103 | -d 4 | 
|  | 13104 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ | 
|  | 13105 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key | 
|  | 13106 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 | 
|  | 13107 | min_version=tls12 max_version=tls13 " \ | 
|  | 13108 | 0 \ | 
|  | 13109 | -c "Protocol is TLSv1.2" \ | 
|  | 13110 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 13111 |  | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13112 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS | 
|  | 13113 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 13114 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 13115 | requires_config_enabled MBEDTLS_DEBUG_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13116 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 13117 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ | 
|  | 13118 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13119 | run_test    "TLS 1.3: NewSessionTicket: servername check, m->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13120 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4 \ | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13121 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 13122 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ | 
|  | 13123 | 0 \ | 
|  | 13124 | -c "Protocol is TLSv1.3" \ | 
|  | 13125 | -c "got new session ticket." \ | 
|  | 13126 | -c "Saving session for reuse... ok" \ | 
|  | 13127 | -c "Reconnecting with saved session" \ | 
|  | 13128 | -c "HTTP/1.0 200 OK"    \ | 
|  | 13129 | -s "=> write NewSessionTicket msg" \ | 
| Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13130 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ | 
|  | 13131 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13132 | -s "key exchange mode: ephemeral" \ | 
|  | 13133 | -s "key exchange mode: psk_ephemeral" \ | 
|  | 13134 | -s "found pre_shared_key extension" | 
|  | 13135 |  | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13136 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS | 
|  | 13137 | requires_config_enabled MBEDTLS_SSL_SRV_C | 
|  | 13138 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 13139 | requires_config_enabled MBEDTLS_DEBUG_C | 
| Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13140 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | 
|  | 13141 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ | 
|  | 13142 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13143 | run_test    "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ | 
| Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13144 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4 \ | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13145 | 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] | 13146 | "$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] | 13147 | 1 \ | 
|  | 13148 | -c "Protocol is TLSv1.3" \ | 
|  | 13149 | -c "got new session ticket." \ | 
|  | 13150 | -c "Saving session for reuse... ok" \ | 
|  | 13151 | -c "Reconnecting with saved session" \ | 
| Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13152 | -c "Hostname mismatch the session ticket, disable session resumption."    \ | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13153 | -s "=> write NewSessionTicket msg" \ | 
| Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13154 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ | 
|  | 13155 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" | 
| Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13156 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13157 | # Test heap memory usage after handshake | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13158 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13159 | requires_config_enabled MBEDTLS_MEMORY_DEBUG | 
|  | 13160 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C | 
|  | 13161 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13162 | requires_max_content_len 16384 | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13163 | run_tests_memory_after_hanshake | 
|  | 13164 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13165 | # Final report | 
|  | 13166 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13167 | echo "------------------------------------------------------------------------" | 
|  | 13168 |  | 
|  | 13169 | if [ $FAILS = 0 ]; then | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13170 | printf "PASSED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13171 | else | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13172 | printf "FAILED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13173 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 13174 | PASSES=$(( $TESTS - $FAILS )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 13175 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13176 |  | 
| Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 13177 | if [ $FAILS -gt 255 ]; then | 
|  | 13178 | # Clamp at 255 as caller gets exit code & 0xFF | 
|  | 13179 | # (so 256 would be 0, or success, etc) | 
|  | 13180 | FAILS=255 | 
|  | 13181 | fi | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13182 | exit $FAILS |