| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 |  | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # | 
| Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors | 
| Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 | 
|  | 7 | # | 
|  | 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 9 | # not use this file except in compliance with the License. | 
|  | 10 | # You may obtain a copy of the License at | 
|  | 11 | # | 
|  | 12 | # http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 13 | # | 
|  | 14 | # Unless required by applicable law or agreed to in writing, software | 
|  | 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 17 | # See the License for the specific language governing permissions and | 
|  | 18 | # limitations under the License. | 
|  | 19 | # | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose | 
|  | 21 | # | 
|  | 22 | # Executes tests to prove various TLS/SSL options and extensions. | 
|  | 23 | # | 
|  | 24 | # The goal is not to cover every ciphersuite/version, but instead to cover | 
|  | 25 | # specific options (max fragment length, truncated hmac, etc) or procedures | 
|  | 26 | # (session resumption from cache or ticket, renego, etc). | 
|  | 27 | # | 
|  | 28 | # The tests assume a build with default options, with exceptions expressed | 
|  | 29 | # with a dependency.  The tests focus on functionality and do not consider | 
|  | 30 | # performance. | 
|  | 31 | # | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u | 
|  | 34 |  | 
| Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script | 
|  | 36 | # where it may output seemingly unlimited length error logs. | 
|  | 37 | ulimit -f 20971520 | 
|  | 38 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD | 
|  | 40 | if ! cd "$(dirname "$0")"; then | 
|  | 41 | exit 125 | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi | 
|  | 43 |  | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} | 
|  | 46 | : ${P_CLI:=../programs/ssl/ssl_client2} | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} | 
| Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 49 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} | 
|  | 51 | : ${GNUTLS_SERV:=gnutls-serv} | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 54 | guess_config_name() { | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 55 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 56 | echo "default" | 
|  | 57 | else | 
|  | 58 | echo "unknown" | 
|  | 59 | fi | 
|  | 60 | } | 
|  | 61 | : ${MBEDTLS_TEST_OUTCOME_FILE=} | 
|  | 62 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} | 
|  | 63 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} | 
|  | 64 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 65 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 66 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 67 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 68 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) | 
|  | 72 |  | 
|  | 73 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 74 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
|  | 75 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" | 
|  | 76 | else | 
|  | 77 | O_LEGACY_SRV=false | 
|  | 78 | O_LEGACY_CLI=false | 
|  | 79 | fi | 
|  | 80 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 81 | if [ -n "${OPENSSL_NEXT:-}" ]; then | 
| XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 82 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 83 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 84 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" | 
|  | 85 | else | 
|  | 86 | O_NEXT_SRV=false | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 87 | O_NEXT_SRV_NO_CERT=false | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 88 | O_NEXT_CLI=false | 
|  | 89 | fi | 
|  | 90 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 91 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 92 | 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] | 93 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 94 | else | 
|  | 95 | G_NEXT_SRV=false | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 96 | G_NEXT_SRV_NO_CERT=false | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 97 | fi | 
|  | 98 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 99 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 100 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" | 
|  | 101 | else | 
|  | 102 | G_NEXT_CLI=false | 
|  | 103 | fi | 
|  | 104 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 105 | TESTS=0 | 
|  | 106 | FAILS=0 | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 107 | SKIPS=0 | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 108 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 109 | CONFIG_H='../include/mbedtls/mbedtls_config.h' | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 110 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 111 | MEMCHECK=0 | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 112 | FILTER='.*' | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 113 | EXCLUDE='^$' | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 |  | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 115 | SHOW_TEST_NUMBER=0 | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 116 | RUN_TEST_NUMBER='' | 
|  | 117 |  | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 118 | PRESERVE_LOGS=0 | 
|  | 119 |  | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 120 | # Pick a "unique" server port in the range 10000-19999, and a proxy | 
|  | 121 | # port which is this plus 10000. Each port number may be independently | 
|  | 122 | # overridden by a command line option. | 
|  | 123 | SRV_PORT=$(($$ % 10000 + 10000)) | 
|  | 124 | PXY_PORT=$((SRV_PORT + 10000)) | 
|  | 125 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 126 | print_usage() { | 
|  | 127 | echo "Usage: $0 [options]" | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 128 | printf "  -h|--help\tPrint this help.\n" | 
|  | 129 | printf "  -m|--memcheck\tCheck memory leaks and errors.\n" | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 130 | printf "  -f|--filter\tOnly matching tests are executed (substring or BRE)\n" | 
|  | 131 | printf "  -e|--exclude\tMatching tests are excluded (substring or BRE)\n" | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 132 | 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] | 133 | 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] | 134 | printf "  -p|--preserve-logs\tPreserve logs of successful tests as well\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 135 | printf "     --outcome-file\tFile where test outcomes are written\n" | 
|  | 136 | printf "                \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" | 
|  | 137 | printf "     --port     \tTCP/UDP port (default: randomish 1xxxx)\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 138 | printf "     --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 139 | 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] | 140 | } | 
|  | 141 |  | 
|  | 142 | get_options() { | 
|  | 143 | while [ $# -gt 0 ]; do | 
|  | 144 | case "$1" in | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 145 | -f|--filter) | 
|  | 146 | shift; FILTER=$1 | 
|  | 147 | ;; | 
|  | 148 | -e|--exclude) | 
|  | 149 | shift; EXCLUDE=$1 | 
|  | 150 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 151 | -m|--memcheck) | 
|  | 152 | MEMCHECK=1 | 
|  | 153 | ;; | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 154 | -n|--number) | 
|  | 155 | shift; RUN_TEST_NUMBER=$1 | 
|  | 156 | ;; | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 157 | -s|--show-numbers) | 
|  | 158 | SHOW_TEST_NUMBER=1 | 
|  | 159 | ;; | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 160 | -p|--preserve-logs) | 
|  | 161 | PRESERVE_LOGS=1 | 
|  | 162 | ;; | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 163 | --port) | 
|  | 164 | shift; SRV_PORT=$1 | 
|  | 165 | ;; | 
|  | 166 | --proxy-port) | 
|  | 167 | shift; PXY_PORT=$1 | 
|  | 168 | ;; | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 169 | --seed) | 
|  | 170 | shift; SEED="$1" | 
|  | 171 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 172 | -h|--help) | 
|  | 173 | print_usage | 
|  | 174 | exit 0 | 
|  | 175 | ;; | 
|  | 176 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 177 | echo "Unknown argument: '$1'" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 178 | print_usage | 
|  | 179 | exit 1 | 
|  | 180 | ;; | 
|  | 181 | esac | 
|  | 182 | shift | 
|  | 183 | done | 
|  | 184 | } | 
|  | 185 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 186 | # Make the outcome file path relative to the original directory, not | 
|  | 187 | # to .../tests | 
|  | 188 | case "$MBEDTLS_TEST_OUTCOME_FILE" in | 
|  | 189 | [!/]*) | 
|  | 190 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 191 | ;; | 
|  | 192 | esac | 
|  | 193 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 194 | # Read boolean configuration options from mbedtls_config.h for easy and quick | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 195 | # testing. Skip non-boolean options (with something other than spaces | 
|  | 196 | # and a comment after "#define SYMBOL"). The variable contains a | 
|  | 197 | # space-separated list of symbols. | 
| Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 198 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 199 | # Skip next test; use this macro to skip tests which are legitimate | 
|  | 200 | # in theory and expected to be re-introduced at some point, but | 
|  | 201 | # aren't expected to succeed at the moment due to problems outside | 
|  | 202 | # our control (such as bugs in other TLS implementations). | 
|  | 203 | skip_next_test() { | 
|  | 204 | SKIP_NEXT="YES" | 
|  | 205 | } | 
|  | 206 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 207 | # 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] | 208 | requires_config_enabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 209 | case $CONFIGS_ENABLED in | 
| Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 210 | *" $1"[\ =]*) :;; | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | *) SKIP_NEXT="YES";; | 
|  | 212 | esac | 
| Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 213 | } | 
|  | 214 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 215 | # 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] | 216 | requires_config_disabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | case $CONFIGS_ENABLED in | 
| Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 218 | *" $1"[\ =]*) SKIP_NEXT="YES";; | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 219 | esac | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 220 | } | 
|  | 221 |  | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 222 | get_config_value_or_default() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 223 | # This function uses the query_config command line option to query the | 
|  | 224 | # required Mbed TLS compile time configuration from the ssl_server2 | 
|  | 225 | # program. The command will always return a success value if the | 
|  | 226 | # configuration is defined and the value will be printed to stdout. | 
|  | 227 | # | 
|  | 228 | # Note that if the configuration is not defined or is defined to nothing, | 
|  | 229 | # the output of this function will be an empty string. | 
|  | 230 | ${P_SRV} "query_config=${1}" | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 231 | } | 
|  | 232 |  | 
|  | 233 | requires_config_value_at_least() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 234 | VAL="$( get_config_value_or_default "$1" )" | 
|  | 235 | if [ -z "$VAL" ]; then | 
|  | 236 | # Should never happen | 
|  | 237 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 238 | exit 1 | 
|  | 239 | elif [ "$VAL" -lt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 240 | SKIP_NEXT="YES" | 
|  | 241 | fi | 
|  | 242 | } | 
|  | 243 |  | 
|  | 244 | requires_config_value_at_most() { | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 245 | VAL=$( get_config_value_or_default "$1" ) | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 246 | if [ -z "$VAL" ]; then | 
|  | 247 | # Should never happen | 
|  | 248 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 249 | exit 1 | 
|  | 250 | elif [ "$VAL" -gt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 251 | SKIP_NEXT="YES" | 
|  | 252 | fi | 
|  | 253 | } | 
|  | 254 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 255 | requires_config_value_equals() { | 
|  | 256 | VAL=$( get_config_value_or_default "$1" ) | 
|  | 257 | if [ -z "$VAL" ]; then | 
|  | 258 | # Should never happen | 
|  | 259 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 260 | exit 1 | 
|  | 261 | elif [ "$VAL" -ne "$2" ]; then | 
|  | 262 | SKIP_NEXT="YES" | 
|  | 263 | fi | 
|  | 264 | } | 
|  | 265 |  | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 266 | # Space-separated list of ciphersuites supported by this build of | 
|  | 267 | # Mbed TLS. | 
|  | 268 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | | 
| XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 269 | grep 'TLS-\|TLS1-3' | | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | tr -s ' \n' ' ')" | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 271 | requires_ciphersuite_enabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | case $P_CIPHERSUITES in | 
|  | 273 | *" $1 "*) :;; | 
|  | 274 | *) SKIP_NEXT="YES";; | 
|  | 275 | esac | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 276 | } | 
|  | 277 |  | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 278 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] | 
|  | 279 | # If CMD (call to a TLS client or server program) requires a specific | 
|  | 280 | # ciphersuite, arrange to only run the test case if this ciphersuite is | 
| Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 281 | # enabled. | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 282 | maybe_requires_ciphersuite_enabled() { | 
|  | 283 | case "$1" in | 
|  | 284 | *\ force_ciphersuite=*) :;; | 
|  | 285 | *) return;; # No specific required ciphersuite | 
|  | 286 | esac | 
|  | 287 | ciphersuite="${1##*\ force_ciphersuite=}" | 
|  | 288 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" | 
|  | 289 | shift | 
|  | 290 |  | 
| Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 291 | requires_ciphersuite_enabled "$ciphersuite" | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 292 |  | 
|  | 293 | unset ciphersuite | 
|  | 294 | } | 
|  | 295 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 296 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV | 
|  | 297 | requires_openssl_with_fallback_scsv() { | 
|  | 298 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then | 
|  | 299 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null | 
|  | 300 | then | 
|  | 301 | OPENSSL_HAS_FBSCSV="YES" | 
|  | 302 | else | 
|  | 303 | OPENSSL_HAS_FBSCSV="NO" | 
|  | 304 | fi | 
|  | 305 | fi | 
|  | 306 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then | 
|  | 307 | SKIP_NEXT="YES" | 
|  | 308 | fi | 
|  | 309 | } | 
|  | 310 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 311 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value | 
|  | 312 | requires_max_content_len() { | 
|  | 313 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 | 
|  | 314 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 | 
|  | 315 | } | 
|  | 316 |  | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 317 | # skip next test if GnuTLS isn't available | 
|  | 318 | requires_gnutls() { | 
|  | 319 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then | 
| Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 320 | 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] | 321 | GNUTLS_AVAILABLE="YES" | 
|  | 322 | else | 
|  | 323 | GNUTLS_AVAILABLE="NO" | 
|  | 324 | fi | 
|  | 325 | fi | 
|  | 326 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then | 
|  | 327 | SKIP_NEXT="YES" | 
|  | 328 | fi | 
|  | 329 | } | 
|  | 330 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 331 | # skip next test if GnuTLS-next isn't available | 
|  | 332 | requires_gnutls_next() { | 
|  | 333 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then | 
|  | 334 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then | 
|  | 335 | GNUTLS_NEXT_AVAILABLE="YES" | 
|  | 336 | else | 
|  | 337 | GNUTLS_NEXT_AVAILABLE="NO" | 
|  | 338 | fi | 
|  | 339 | fi | 
|  | 340 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 341 | SKIP_NEXT="YES" | 
|  | 342 | fi | 
|  | 343 | } | 
|  | 344 |  | 
|  | 345 | # skip next test if OpenSSL-legacy isn't available | 
|  | 346 | requires_openssl_legacy() { | 
|  | 347 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then | 
|  | 348 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then | 
|  | 349 | OPENSSL_LEGACY_AVAILABLE="YES" | 
|  | 350 | else | 
|  | 351 | OPENSSL_LEGACY_AVAILABLE="NO" | 
|  | 352 | fi | 
|  | 353 | fi | 
|  | 354 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then | 
|  | 355 | SKIP_NEXT="YES" | 
|  | 356 | fi | 
|  | 357 | } | 
|  | 358 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 359 | requires_openssl_next() { | 
|  | 360 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then | 
|  | 361 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then | 
|  | 362 | OPENSSL_NEXT_AVAILABLE="YES" | 
|  | 363 | else | 
|  | 364 | OPENSSL_NEXT_AVAILABLE="NO" | 
|  | 365 | fi | 
|  | 366 | fi | 
|  | 367 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 368 | SKIP_NEXT="YES" | 
|  | 369 | fi | 
|  | 370 | } | 
|  | 371 |  | 
|  | 372 | # skip next test if tls1_3 is not available | 
|  | 373 | requires_openssl_tls1_3() { | 
|  | 374 | requires_openssl_next | 
|  | 375 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 376 | OPENSSL_TLS1_3_AVAILABLE="NO" | 
|  | 377 | fi | 
|  | 378 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then | 
|  | 379 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null | 
|  | 380 | then | 
|  | 381 | OPENSSL_TLS1_3_AVAILABLE="YES" | 
|  | 382 | else | 
|  | 383 | OPENSSL_TLS1_3_AVAILABLE="NO" | 
|  | 384 | fi | 
|  | 385 | fi | 
|  | 386 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then | 
|  | 387 | SKIP_NEXT="YES" | 
|  | 388 | fi | 
|  | 389 | } | 
|  | 390 |  | 
|  | 391 | # skip next test if tls1_3 is not available | 
|  | 392 | requires_gnutls_tls1_3() { | 
|  | 393 | requires_gnutls_next | 
|  | 394 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 395 | GNUTLS_TLS1_3_AVAILABLE="NO" | 
|  | 396 | fi | 
|  | 397 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then | 
|  | 398 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null | 
|  | 399 | then | 
|  | 400 | GNUTLS_TLS1_3_AVAILABLE="YES" | 
|  | 401 | else | 
|  | 402 | GNUTLS_TLS1_3_AVAILABLE="NO" | 
|  | 403 | fi | 
|  | 404 | fi | 
|  | 405 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then | 
|  | 406 | SKIP_NEXT="YES" | 
|  | 407 | fi | 
|  | 408 | } | 
|  | 409 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 410 | # Check %NO_TICKETS option | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 411 | requires_gnutls_next_no_ticket() { | 
|  | 412 | requires_gnutls_next | 
|  | 413 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 414 | GNUTLS_NO_TICKETS_AVAILABLE="NO" | 
|  | 415 | fi | 
|  | 416 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then | 
|  | 417 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null | 
|  | 418 | then | 
|  | 419 | GNUTLS_NO_TICKETS_AVAILABLE="YES" | 
|  | 420 | else | 
|  | 421 | GNUTLS_NO_TICKETS_AVAILABLE="NO" | 
|  | 422 | fi | 
|  | 423 | fi | 
|  | 424 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then | 
|  | 425 | SKIP_NEXT="YES" | 
|  | 426 | fi | 
|  | 427 | } | 
|  | 428 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 429 | # Check %DISABLE_TLS13_COMPAT_MODE option | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 430 | requires_gnutls_next_disable_tls13_compat() { | 
|  | 431 | requires_gnutls_next | 
|  | 432 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 433 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" | 
|  | 434 | fi | 
|  | 435 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then | 
|  | 436 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null | 
|  | 437 | then | 
|  | 438 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" | 
|  | 439 | else | 
|  | 440 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" | 
|  | 441 | fi | 
|  | 442 | fi | 
|  | 443 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then | 
|  | 444 | SKIP_NEXT="YES" | 
|  | 445 | fi | 
|  | 446 | } | 
|  | 447 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 448 | # skip next test if IPv6 isn't available on this host | 
|  | 449 | requires_ipv6() { | 
|  | 450 | if [ -z "${HAS_IPV6:-}" ]; then | 
|  | 451 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & | 
|  | 452 | SRV_PID=$! | 
|  | 453 | sleep 1 | 
|  | 454 | kill $SRV_PID >/dev/null 2>&1 | 
|  | 455 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then | 
|  | 456 | HAS_IPV6="NO" | 
|  | 457 | else | 
|  | 458 | HAS_IPV6="YES" | 
|  | 459 | fi | 
|  | 460 | rm -r $SRV_OUT | 
|  | 461 | fi | 
|  | 462 |  | 
|  | 463 | if [ "$HAS_IPV6" = "NO" ]; then | 
|  | 464 | SKIP_NEXT="YES" | 
|  | 465 | fi | 
|  | 466 | } | 
|  | 467 |  | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 468 | # skip next test if it's i686 or uname is not available | 
|  | 469 | requires_not_i686() { | 
|  | 470 | if [ -z "${IS_I686:-}" ]; then | 
|  | 471 | IS_I686="YES" | 
|  | 472 | if which "uname" >/dev/null 2>&1; then | 
|  | 473 | if [ -z "$(uname -a | grep i686)" ]; then | 
|  | 474 | IS_I686="NO" | 
|  | 475 | fi | 
|  | 476 | fi | 
|  | 477 | fi | 
|  | 478 | if [ "$IS_I686" = "YES" ]; then | 
|  | 479 | SKIP_NEXT="YES" | 
|  | 480 | fi | 
|  | 481 | } | 
|  | 482 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 483 | # Calculate the input & output maximum content lengths set in the config | 
| David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 484 | MAX_CONTENT_LEN=16384 | 
| Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 485 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) | 
|  | 486 | 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] | 487 |  | 
| Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 488 | # Calculate the maximum content length that fits both | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 489 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 490 | MAX_CONTENT_LEN="$MAX_IN_LEN" | 
|  | 491 | fi | 
|  | 492 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 493 | MAX_CONTENT_LEN="$MAX_OUT_LEN" | 
|  | 494 | fi | 
|  | 495 |  | 
|  | 496 | # skip the next test if the SSL output buffer is less than 16KB | 
|  | 497 | requires_full_size_output_buffer() { | 
|  | 498 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then | 
|  | 499 | SKIP_NEXT="YES" | 
|  | 500 | fi | 
|  | 501 | } | 
|  | 502 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 503 | # skip the next test if valgrind is in use | 
|  | 504 | not_with_valgrind() { | 
|  | 505 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 506 | SKIP_NEXT="YES" | 
|  | 507 | fi | 
|  | 508 | } | 
|  | 509 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 510 | # skip the next test if valgrind is NOT in use | 
|  | 511 | only_with_valgrind() { | 
|  | 512 | if [ "$MEMCHECK" -eq 0 ]; then | 
|  | 513 | SKIP_NEXT="YES" | 
|  | 514 | fi | 
|  | 515 | } | 
|  | 516 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 517 | # 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] | 518 | client_needs_more_time() { | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 519 | CLI_DELAY_FACTOR=$1 | 
|  | 520 | } | 
|  | 521 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 522 | # wait for the given seconds after the client finished in the next test | 
|  | 523 | server_needs_more_time() { | 
|  | 524 | SRV_DELAY_SECONDS=$1 | 
|  | 525 | } | 
|  | 526 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 527 | # print_name <name> | 
|  | 528 | print_name() { | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 529 | TESTS=$(( $TESTS + 1 )) | 
|  | 530 | LINE="" | 
|  | 531 |  | 
|  | 532 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then | 
|  | 533 | LINE="$TESTS " | 
|  | 534 | fi | 
|  | 535 |  | 
|  | 536 | LINE="$LINE$1" | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 537 | printf "%s " "$LINE" | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 538 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 539 | for i in `seq 1 $LEN`; do printf '.'; done | 
|  | 540 | printf ' ' | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 541 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 542 | } | 
|  | 543 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 544 | # record_outcome <outcome> [<failure-reason>] | 
|  | 545 | # The test name must be in $NAME. | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 546 | # Use $TEST_SUITE_NAME as the test suite name if set. | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 547 | record_outcome() { | 
|  | 548 | echo "$1" | 
|  | 549 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then | 
|  | 550 | printf '%s;%s;%s;%s;%s;%s\n' \ | 
|  | 551 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 552 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 553 | "$1" "${2-}" \ | 
|  | 554 | >>"$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 555 | fi | 
|  | 556 | } | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 557 | unset TEST_SUITE_NAME | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 558 |  | 
| Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 559 | # True if the presence of the given pattern in a log definitely indicates | 
|  | 560 | # that the test has failed. False if the presence is inconclusive. | 
|  | 561 | # | 
|  | 562 | # Inputs: | 
|  | 563 | # * $1: pattern found in the logs | 
|  | 564 | # * $TIMES_LEFT: >0 if retrying is an option | 
|  | 565 | # | 
|  | 566 | # Outputs: | 
|  | 567 | # * $outcome: set to a retry reason if the pattern is inconclusive, | 
|  | 568 | #             unchanged otherwise. | 
|  | 569 | # * Return value: 1 if the pattern is inconclusive, | 
|  | 570 | #                 0 if the failure is definitive. | 
|  | 571 | log_pattern_presence_is_conclusive() { | 
|  | 572 | # If we've run out of attempts, then don't retry no matter what. | 
|  | 573 | if [ $TIMES_LEFT -eq 0 ]; then | 
|  | 574 | return 0 | 
|  | 575 | fi | 
|  | 576 | case $1 in | 
|  | 577 | "resend") | 
|  | 578 | # An undesired resend may have been caused by the OS dropping or | 
|  | 579 | # delaying a packet at an inopportune time. | 
|  | 580 | outcome="RETRY(resend)" | 
|  | 581 | return 1;; | 
|  | 582 | esac | 
|  | 583 | } | 
|  | 584 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 585 | # fail <message> | 
|  | 586 | fail() { | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 587 | record_outcome "FAIL" "$1" | 
| Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 588 | echo "  ! $1" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 589 |  | 
| Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 590 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 591 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 592 | if [ -n "$PXY_CMD" ]; then | 
|  | 593 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 594 | fi | 
|  | 595 | echo "  ! outputs saved to o-XXX-${TESTS}.log" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 596 |  | 
| Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 597 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 598 | echo "  ! server output:" | 
|  | 599 | cat o-srv-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 600 | echo "  ! ========================================================" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 601 | echo "  ! client output:" | 
|  | 602 | cat o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 603 | if [ -n "$PXY_CMD" ]; then | 
|  | 604 | echo "  ! ========================================================" | 
|  | 605 | echo "  ! proxy output:" | 
|  | 606 | cat o-pxy-${TESTS}.log | 
|  | 607 | fi | 
|  | 608 | echo "" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 609 | fi | 
|  | 610 |  | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 611 | FAILS=$(( $FAILS + 1 )) | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 612 | } | 
|  | 613 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 614 | # is_polar <cmd_line> | 
|  | 615 | is_polar() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 616 | case "$1" in | 
|  | 617 | *ssl_client2*) true;; | 
|  | 618 | *ssl_server2*) true;; | 
|  | 619 | *) false;; | 
|  | 620 | esac | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 621 | } | 
|  | 622 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 623 | # openssl s_server doesn't have -www with DTLS | 
|  | 624 | check_osrv_dtls() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 625 | case "$SRV_CMD" in | 
|  | 626 | *s_server*-dtls*) | 
|  | 627 | NEEDS_INPUT=1 | 
|  | 628 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; | 
|  | 629 | *) NEEDS_INPUT=0;; | 
|  | 630 | esac | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 631 | } | 
|  | 632 |  | 
|  | 633 | # provide input to commands that need it | 
|  | 634 | provide_input() { | 
|  | 635 | if [ $NEEDS_INPUT -eq 0 ]; then | 
|  | 636 | return | 
|  | 637 | fi | 
|  | 638 |  | 
|  | 639 | while true; do | 
|  | 640 | echo "HTTP/1.0 200 OK" | 
|  | 641 | sleep 1 | 
|  | 642 | done | 
|  | 643 | } | 
|  | 644 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 645 | # has_mem_err <log_file_name> | 
|  | 646 | has_mem_err() { | 
|  | 647 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && | 
|  | 648 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null | 
|  | 649 | then | 
|  | 650 | return 1 # false: does not have errors | 
|  | 651 | else | 
|  | 652 | return 0 # true: has errors | 
|  | 653 | fi | 
|  | 654 | } | 
|  | 655 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 656 | # 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] | 657 | if type lsof >/dev/null 2>/dev/null; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 658 | wait_app_start() { | 
| Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 659 | newline=' | 
|  | 660 | ' | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | START_TIME=$(date +%s) | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | if [ "$DTLS" -eq 1 ]; then | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 663 | proto=UDP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 664 | else | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | proto=TCP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 666 | fi | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 667 | # Make a tight loop, server normally takes less than 1s to start. | 
| Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 668 | while true; do | 
| Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 669 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) | 
|  | 670 | # When we use a proxy, it will be listening on the same port we | 
|  | 671 | # are checking for as well as the server and lsof will list both. | 
|  | 672 | # If multiple PIDs are returned, each one will be on a separate | 
|  | 673 | # line, each prepended with 'p'. | 
|  | 674 | case ${newline}${SERVER_PIDS}${newline} in | 
|  | 675 | *${newline}p${2}${newline}*) break;; | 
|  | 676 | esac | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 677 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 678 | echo "$3 START TIMEOUT" | 
|  | 679 | echo "$3 START TIMEOUT" >> $4 | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 680 | break | 
|  | 681 | fi | 
|  | 682 | # Linux and *BSD support decimal arguments to sleep. On other | 
|  | 683 | # OSes this may be a tight loop. | 
|  | 684 | sleep 0.1 2>/dev/null || true | 
|  | 685 | done | 
|  | 686 | } | 
|  | 687 | else | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 688 | echo "Warning: lsof not available, wait_app_start = sleep" | 
|  | 689 | wait_app_start() { | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 690 | sleep "$START_DELAY" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 691 | } | 
|  | 692 | fi | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 693 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 694 | # Wait for server process $2 to be listening on port $1. | 
|  | 695 | wait_server_start() { | 
|  | 696 | wait_app_start $1 $2 "SERVER" $SRV_OUT | 
|  | 697 | } | 
|  | 698 |  | 
|  | 699 | # Wait for proxy process $2 to be listening on port $1. | 
|  | 700 | wait_proxy_start() { | 
|  | 701 | wait_app_start $1 $2 "PROXY" $PXY_OUT | 
|  | 702 | } | 
|  | 703 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 704 | # 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] | 705 | # 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] | 706 | # acceptable bounds | 
|  | 707 | check_server_hello_time() { | 
|  | 708 | # 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] | 709 | 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] | 710 | # Get the Unix timestamp for now | 
|  | 711 | CUR_TIME=$(date +'%s') | 
|  | 712 | THRESHOLD_IN_SECS=300 | 
|  | 713 |  | 
|  | 714 | # Check if the ServerHello time was printed | 
|  | 715 | if [ -z "$SERVER_HELLO_TIME" ]; then | 
|  | 716 | return 1 | 
|  | 717 | fi | 
|  | 718 |  | 
|  | 719 | # Check the time in ServerHello is within acceptable bounds | 
|  | 720 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then | 
|  | 721 | # The time in ServerHello is at least 5 minutes before now | 
|  | 722 | return 1 | 
|  | 723 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 724 | # 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] | 725 | return 1 | 
|  | 726 | else | 
|  | 727 | return 0 | 
|  | 728 | fi | 
|  | 729 | } | 
|  | 730 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 731 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument | 
|  | 732 | handshake_memory_get() { | 
|  | 733 | OUTPUT_VARIABLE="$1" | 
|  | 734 | OUTPUT_FILE="$2" | 
|  | 735 |  | 
|  | 736 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" | 
|  | 737 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) | 
|  | 738 |  | 
|  | 739 | # Check if memory usage was read | 
|  | 740 | if [ -z "$MEM_USAGE" ]; then | 
|  | 741 | echo "Error: Can not read the value of handshake memory usage" | 
|  | 742 | return 1 | 
|  | 743 | else | 
|  | 744 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" | 
|  | 745 | return 0 | 
|  | 746 | fi | 
|  | 747 | } | 
|  | 748 |  | 
|  | 749 | # Get handshake memory usage from server or client output and check if this value | 
|  | 750 | # is not higher than the maximum given by the first argument | 
|  | 751 | handshake_memory_check() { | 
|  | 752 | MAX_MEMORY="$1" | 
|  | 753 | OUTPUT_FILE="$2" | 
|  | 754 |  | 
|  | 755 | # Get memory usage | 
|  | 756 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then | 
|  | 757 | return 1 | 
|  | 758 | fi | 
|  | 759 |  | 
|  | 760 | # Check if memory usage is below max value | 
|  | 761 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then | 
|  | 762 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ | 
|  | 763 | "but should be below $MAX_MEMORY bytes" | 
|  | 764 | return 1 | 
|  | 765 | else | 
|  | 766 | return 0 | 
|  | 767 | fi | 
|  | 768 | } | 
|  | 769 |  | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 770 | # wait for client to terminate and set CLI_EXIT | 
|  | 771 | # must be called right after starting the client | 
|  | 772 | wait_client_done() { | 
|  | 773 | CLI_PID=$! | 
|  | 774 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 775 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) | 
|  | 776 | CLI_DELAY_FACTOR=1 | 
|  | 777 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 778 | ( 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] | 779 | DOG_PID=$! | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 780 |  | 
|  | 781 | wait $CLI_PID | 
|  | 782 | CLI_EXIT=$? | 
|  | 783 |  | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 784 | kill $DOG_PID >/dev/null 2>&1 | 
|  | 785 | wait $DOG_PID | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 786 |  | 
|  | 787 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 788 |  | 
|  | 789 | sleep $SRV_DELAY_SECONDS | 
|  | 790 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 791 | } | 
|  | 792 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 793 | # check if the given command uses dtls and sets global variable DTLS | 
|  | 794 | detect_dtls() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 795 | case "$1" in | 
| Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 796 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 797 | *) DTLS=0;; | 
|  | 798 | esac | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 799 | } | 
|  | 800 |  | 
| Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 801 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS | 
|  | 802 | is_gnutls() { | 
|  | 803 | case "$1" in | 
|  | 804 | *gnutls-cli*) | 
|  | 805 | CMD_IS_GNUTLS=1 | 
|  | 806 | ;; | 
|  | 807 | *gnutls-serv*) | 
|  | 808 | CMD_IS_GNUTLS=1 | 
|  | 809 | ;; | 
|  | 810 | *) | 
|  | 811 | CMD_IS_GNUTLS=0 | 
|  | 812 | ;; | 
|  | 813 | esac | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 814 | } | 
|  | 815 |  | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 816 | # Compare file content | 
|  | 817 | # Usage: find_in_both pattern file1 file2 | 
|  | 818 | # extract from file1 the first line matching the pattern | 
|  | 819 | # check in file2 that the same line can be found | 
|  | 820 | find_in_both() { | 
|  | 821 | srv_pattern=$(grep -m 1 "$1" "$2"); | 
|  | 822 | if [ -z "$srv_pattern" ]; then | 
|  | 823 | return 1; | 
|  | 824 | fi | 
|  | 825 |  | 
|  | 826 | if grep "$srv_pattern" $3 >/dev/null; then : | 
| Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 827 | return 0; | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 828 | else | 
|  | 829 | return 1; | 
|  | 830 | fi | 
|  | 831 | } | 
|  | 832 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 833 | SKIP_HANDSHAKE_CHECK="NO" | 
|  | 834 | skip_handshake_stage_check() { | 
|  | 835 | SKIP_HANDSHAKE_CHECK="YES" | 
|  | 836 | } | 
|  | 837 |  | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 838 | # Analyze the commands that will be used in a test. | 
|  | 839 | # | 
|  | 840 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass | 
|  | 841 | # extra arguments or go through wrappers. | 
|  | 842 | # Set $DTLS (0=TLS, 1=DTLS). | 
|  | 843 | analyze_test_commands() { | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 844 | # update DTLS variable | 
|  | 845 | detect_dtls "$SRV_CMD" | 
|  | 846 |  | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 847 | # if the test uses DTLS but no custom proxy, add a simple proxy | 
|  | 848 | # 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] | 849 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 850 | PXY_CMD="$P_PXY" | 
| Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 851 | case " $SRV_CMD " in | 
|  | 852 | *' server_addr=::1 '*) | 
|  | 853 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; | 
|  | 854 | esac | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 855 | fi | 
|  | 856 |  | 
| Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 857 | # update CMD_IS_GNUTLS variable | 
|  | 858 | is_gnutls "$SRV_CMD" | 
|  | 859 |  | 
|  | 860 | # if the server uses gnutls but doesn't set priority, explicitly | 
|  | 861 | # set the default priority | 
|  | 862 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then | 
|  | 863 | case "$SRV_CMD" in | 
|  | 864 | *--priority*) :;; | 
|  | 865 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; | 
|  | 866 | esac | 
|  | 867 | fi | 
|  | 868 |  | 
|  | 869 | # update CMD_IS_GNUTLS variable | 
|  | 870 | is_gnutls "$CLI_CMD" | 
|  | 871 |  | 
|  | 872 | # if the client uses gnutls but doesn't set priority, explicitly | 
|  | 873 | # set the default priority | 
|  | 874 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then | 
|  | 875 | case "$CLI_CMD" in | 
|  | 876 | *--priority*) :;; | 
|  | 877 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; | 
|  | 878 | esac | 
|  | 879 | fi | 
|  | 880 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 881 | # fix client port | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 882 | if [ -n "$PXY_CMD" ]; then | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 883 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) | 
|  | 884 | else | 
|  | 885 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) | 
|  | 886 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 887 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 888 | # prepend valgrind to our commands if active | 
|  | 889 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 890 | if is_polar "$SRV_CMD"; then | 
|  | 891 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" | 
|  | 892 | fi | 
|  | 893 | if is_polar "$CLI_CMD"; then | 
|  | 894 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" | 
|  | 895 | fi | 
|  | 896 | fi | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 897 | } | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 898 |  | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 899 | # Check for failure conditions after a test case. | 
|  | 900 | # | 
|  | 901 | # Inputs from run_test: | 
|  | 902 | # * positional parameters: test options (see run_test documentation) | 
|  | 903 | # * $CLI_EXIT: client return code | 
|  | 904 | # * $CLI_EXPECT: expected client return code | 
|  | 905 | # * $SRV_RET: server return code | 
|  | 906 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 907 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 908 | # | 
|  | 909 | # Outputs: | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 910 | # * $outcome: one of PASS/RETRY*/FAIL | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 911 | check_test_failure() { | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 912 | outcome=FAIL | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 913 |  | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 914 | if [ $TIMES_LEFT -gt 0 ] && | 
|  | 915 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null | 
|  | 916 | then | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 917 | outcome="RETRY(client-timeout)" | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 918 | return | 
|  | 919 | fi | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 920 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 921 | # 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] | 922 | # (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] | 923 | # expected client exit to incorrectly succeed in case of catastrophic | 
|  | 924 | # failure) | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 925 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] | 
|  | 926 | then | 
|  | 927 | if is_polar "$SRV_CMD"; then | 
|  | 928 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; | 
|  | 929 | else | 
|  | 930 | fail "server or client failed to reach handshake stage" | 
|  | 931 | return | 
|  | 932 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 933 | fi | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 934 | if is_polar "$CLI_CMD"; then | 
|  | 935 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; | 
|  | 936 | else | 
|  | 937 | fail "server or client failed to reach handshake stage" | 
|  | 938 | return | 
|  | 939 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 940 | fi | 
|  | 941 | fi | 
|  | 942 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 943 | SKIP_HANDSHAKE_CHECK="NO" | 
| Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 944 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't | 
|  | 945 | # exit with status 0 when interrupted by a signal, and we don't really | 
|  | 946 | # care anyway), in case e.g. the server reports a memory leak. | 
|  | 947 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then | 
| Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 948 | fail "Server exited with status $SRV_RET" | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 949 | return | 
|  | 950 | fi | 
|  | 951 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 952 | # check client exit code | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 953 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ | 
|  | 954 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 955 | then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 956 | 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] | 957 | return | 
|  | 958 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 959 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 960 | # check other assertions | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 961 | # lines beginning with == are added by valgrind, ignore them | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 962 | # 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] | 963 | while [ $# -gt 0 ] | 
|  | 964 | do | 
|  | 965 | case $1 in | 
|  | 966 | "-s") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 967 | 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] | 968 | fail "pattern '$2' MUST be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 969 | return | 
|  | 970 | fi | 
|  | 971 | ;; | 
|  | 972 |  | 
|  | 973 | "-c") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 974 | 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] | 975 | fail "pattern '$2' MUST be present in the Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 976 | return | 
|  | 977 | fi | 
|  | 978 | ;; | 
|  | 979 |  | 
|  | 980 | "-S") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 981 | 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] | 982 | if log_pattern_presence_is_conclusive "$2"; then | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 983 | fail "pattern '$2' MUST NOT be present in the Server output" | 
|  | 984 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 985 | return | 
|  | 986 | fi | 
|  | 987 | ;; | 
|  | 988 |  | 
|  | 989 | "-C") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 990 | 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] | 991 | if log_pattern_presence_is_conclusive "$2"; then | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 992 | fail "pattern '$2' MUST NOT be present in the Client output" | 
|  | 993 | fi | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 994 | return | 
|  | 995 | fi | 
|  | 996 | ;; | 
|  | 997 |  | 
|  | 998 | # The filtering in the following two options (-u and -U) do the following | 
|  | 999 | #   - ignore valgrind output | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1000 | #   - filter out everything but lines right after the pattern occurrences | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1001 | #   - keep one of each non-unique line | 
|  | 1002 | #   - count how many lines remain | 
|  | 1003 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 | 
|  | 1004 | # if there were no duplicates. | 
|  | 1005 | "-U") | 
|  | 1006 | 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 | 
|  | 1007 | fail "lines following pattern '$2' must be unique in Server output" | 
|  | 1008 | return | 
|  | 1009 | fi | 
|  | 1010 | ;; | 
|  | 1011 |  | 
|  | 1012 | "-u") | 
|  | 1013 | 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 | 
|  | 1014 | 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] | 1015 | return | 
|  | 1016 | fi | 
|  | 1017 | ;; | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1018 | "-F") | 
|  | 1019 | if ! $2 "$SRV_OUT"; then | 
|  | 1020 | fail "function call to '$2' failed on Server output" | 
|  | 1021 | return | 
|  | 1022 | fi | 
|  | 1023 | ;; | 
|  | 1024 | "-f") | 
|  | 1025 | if ! $2 "$CLI_OUT"; then | 
|  | 1026 | fail "function call to '$2' failed on Client output" | 
|  | 1027 | return | 
|  | 1028 | fi | 
|  | 1029 | ;; | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1030 | "-g") | 
|  | 1031 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then | 
|  | 1032 | fail "function call to '$2' failed on Server and Client output" | 
|  | 1033 | return | 
|  | 1034 | fi | 
|  | 1035 | ;; | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1036 |  | 
|  | 1037 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1038 | echo "Unknown test: $1" >&2 | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1039 | exit 1 | 
|  | 1040 | esac | 
|  | 1041 | shift 2 | 
|  | 1042 | done | 
|  | 1043 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1044 | # check valgrind's results | 
|  | 1045 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1046 | 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] | 1047 | fail "Server has memory errors" | 
|  | 1048 | return | 
|  | 1049 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1050 | 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] | 1051 | fail "Client has memory errors" | 
|  | 1052 | return | 
|  | 1053 | fi | 
|  | 1054 | fi | 
|  | 1055 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1056 | # if we're here, everything is ok | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1057 | outcome=PASS | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1058 | } | 
|  | 1059 |  | 
| Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1060 | # Run the current test case: start the server and if applicable the proxy, run | 
|  | 1061 | # the client, wait for all processes to finish or time out. | 
|  | 1062 | # | 
|  | 1063 | # Inputs: | 
|  | 1064 | # * $NAME: test case name | 
|  | 1065 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run | 
|  | 1066 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs | 
|  | 1067 | # | 
|  | 1068 | # Outputs: | 
|  | 1069 | # * $CLI_EXIT: client return code | 
|  | 1070 | # * $SRV_RET: server return code | 
|  | 1071 | do_run_test_once() { | 
|  | 1072 | # run the commands | 
|  | 1073 | if [ -n "$PXY_CMD" ]; then | 
|  | 1074 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT | 
|  | 1075 | $PXY_CMD >> $PXY_OUT 2>&1 & | 
|  | 1076 | PXY_PID=$! | 
|  | 1077 | wait_proxy_start "$PXY_PORT" "$PXY_PID" | 
|  | 1078 | fi | 
|  | 1079 |  | 
|  | 1080 | check_osrv_dtls | 
|  | 1081 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT | 
|  | 1082 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & | 
|  | 1083 | SRV_PID=$! | 
|  | 1084 | wait_server_start "$SRV_PORT" "$SRV_PID" | 
|  | 1085 |  | 
|  | 1086 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT | 
|  | 1087 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & | 
|  | 1088 | wait_client_done | 
|  | 1089 |  | 
|  | 1090 | sleep 0.05 | 
|  | 1091 |  | 
|  | 1092 | # terminate the server (and the proxy) | 
|  | 1093 | kill $SRV_PID | 
|  | 1094 | wait $SRV_PID | 
|  | 1095 | SRV_RET=$? | 
|  | 1096 |  | 
|  | 1097 | if [ -n "$PXY_CMD" ]; then | 
|  | 1098 | kill $PXY_PID >/dev/null 2>&1 | 
|  | 1099 | wait $PXY_PID | 
|  | 1100 | fi | 
|  | 1101 | } | 
|  | 1102 |  | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1103 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] | 
|  | 1104 | # Options:  -s pattern  pattern that must be present in server output | 
|  | 1105 | #           -c pattern  pattern that must be present in client output | 
|  | 1106 | #           -u pattern  lines after pattern must be unique in client output | 
|  | 1107 | #           -f call shell function on client output | 
|  | 1108 | #           -S pattern  pattern that must be absent in server output | 
|  | 1109 | #           -C pattern  pattern that must be absent in client output | 
|  | 1110 | #           -U pattern  lines after pattern must be unique in server output | 
|  | 1111 | #           -F call shell function on server output | 
|  | 1112 | #           -g call shell function on server and client output | 
|  | 1113 | run_test() { | 
|  | 1114 | NAME="$1" | 
|  | 1115 | shift 1 | 
|  | 1116 |  | 
|  | 1117 | if is_excluded "$NAME"; then | 
|  | 1118 | SKIP_NEXT="NO" | 
|  | 1119 | # There was no request to run the test, so don't record its outcome. | 
|  | 1120 | return | 
|  | 1121 | fi | 
|  | 1122 |  | 
|  | 1123 | print_name "$NAME" | 
|  | 1124 |  | 
|  | 1125 | # Do we only run numbered tests? | 
|  | 1126 | if [ -n "$RUN_TEST_NUMBER" ]; then | 
|  | 1127 | case ",$RUN_TEST_NUMBER," in | 
|  | 1128 | *",$TESTS,"*) :;; | 
|  | 1129 | *) SKIP_NEXT="YES";; | 
|  | 1130 | esac | 
|  | 1131 | fi | 
|  | 1132 |  | 
|  | 1133 | # does this test use a proxy? | 
|  | 1134 | if [ "X$1" = "X-p" ]; then | 
|  | 1135 | PXY_CMD="$2" | 
|  | 1136 | shift 2 | 
|  | 1137 | else | 
|  | 1138 | PXY_CMD="" | 
|  | 1139 | fi | 
|  | 1140 |  | 
|  | 1141 | # get commands and client output | 
|  | 1142 | SRV_CMD="$1" | 
|  | 1143 | CLI_CMD="$2" | 
|  | 1144 | CLI_EXPECT="$3" | 
|  | 1145 | shift 3 | 
|  | 1146 |  | 
|  | 1147 | # Check if test uses files | 
|  | 1148 | case "$SRV_CMD $CLI_CMD" in | 
|  | 1149 | *data_files/*) | 
|  | 1150 | requires_config_enabled MBEDTLS_FS_IO;; | 
|  | 1151 | esac | 
|  | 1152 |  | 
|  | 1153 | # If the client or serve requires a ciphersuite, check that it's enabled. | 
|  | 1154 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" | 
|  | 1155 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" | 
|  | 1156 |  | 
|  | 1157 | # should we skip? | 
|  | 1158 | if [ "X$SKIP_NEXT" = "XYES" ]; then | 
|  | 1159 | SKIP_NEXT="NO" | 
|  | 1160 | record_outcome "SKIP" | 
|  | 1161 | SKIPS=$(( $SKIPS + 1 )) | 
|  | 1162 | return | 
|  | 1163 | fi | 
|  | 1164 |  | 
|  | 1165 | analyze_test_commands "$@" | 
|  | 1166 |  | 
|  | 1167 | TIMES_LEFT=2 | 
|  | 1168 | while [ $TIMES_LEFT -gt 0 ]; do | 
|  | 1169 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) | 
|  | 1170 |  | 
| Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1171 | do_run_test_once | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1172 |  | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1173 | check_test_failure "$@" | 
|  | 1174 | case $outcome in | 
|  | 1175 | PASS) break;; | 
| Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1176 | RETRY*) printf "$outcome ";; | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1177 | FAIL) return;; | 
|  | 1178 | esac | 
| Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1179 | done | 
|  | 1180 |  | 
| Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1181 | # If we get this far, the test case passed. | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1182 | record_outcome "PASS" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1183 | if [ "$PRESERVE_LOGS" -gt 0 ]; then | 
|  | 1184 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 1185 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1186 | if [ -n "$PXY_CMD" ]; then | 
|  | 1187 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 1188 | fi | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1189 | fi | 
|  | 1190 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1191 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1192 | } | 
|  | 1193 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1194 | run_test_psa() { | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1196 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1197 | run_test    "PSA-supported ciphersuite: $1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1198 | "$P_SRV debug_level=3 force_version=tls12" \ | 
|  | 1199 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1200 | 0 \ | 
| Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1201 | -c "PSA calc verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1202 | -c "calc PSA finished" \ | 
| Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1203 | -s "PSA calc verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1204 | -s "calc PSA finished" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1205 | -C "Failed to setup PSA-based cipher context"\ | 
|  | 1206 | -S "Failed to setup PSA-based cipher context"\ | 
|  | 1207 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1208 | -c "Perform PSA-based ECDH computation."\ | 
| Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1209 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1210 | -S "error" \ | 
|  | 1211 | -C "error" | 
|  | 1212 | } | 
|  | 1213 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1214 | run_test_psa_force_curve() { | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1216 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 1217 | run_test    "PSA - ECDH with $1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1218 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ | 
|  | 1219 | "$P_CLI debug_level=4 force_version=tls12 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1220 | 0 \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1221 | -c "PSA calc verify" \ | 
|  | 1222 | -c "calc PSA finished" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1223 | -s "PSA calc verify" \ | 
|  | 1224 | -s "calc PSA finished" \ | 
|  | 1225 | -C "Failed to setup PSA-based cipher context"\ | 
|  | 1226 | -S "Failed to setup PSA-based cipher context"\ | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1227 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1228 | -c "Perform PSA-based ECDH computation."\ | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1229 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1230 | -S "error" \ | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1231 | -C "error" | 
|  | 1232 | } | 
|  | 1233 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1234 | # Test that the server's memory usage after a handshake is reduced when a client specifies | 
|  | 1235 | # a maximum fragment length. | 
|  | 1236 | #  first argument ($1) is MFL for SSL client | 
|  | 1237 | #  second argument ($2) is memory usage for SSL client with default MFL (16k) | 
|  | 1238 | run_test_memory_after_hanshake_with_mfl() | 
|  | 1239 | { | 
|  | 1240 | # The test passes if the difference is around 2*(16k-MFL) | 
| Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1241 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1242 |  | 
|  | 1243 | # Leave some margin for robustness | 
|  | 1244 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" | 
|  | 1245 |  | 
|  | 1246 | run_test    "Handshake memory usage (MFL $1)" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1247 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ | 
|  | 1248 | "$P_CLI debug_level=3 force_version=tls12 \ | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1249 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 1250 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ | 
|  | 1251 | 0 \ | 
|  | 1252 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" | 
|  | 1253 | } | 
|  | 1254 |  | 
|  | 1255 |  | 
|  | 1256 | # Test that the server's memory usage after a handshake is reduced when a client specifies | 
|  | 1257 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes | 
|  | 1258 | run_tests_memory_after_hanshake() | 
|  | 1259 | { | 
|  | 1260 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) | 
|  | 1261 | SKIP_THIS_TESTS="$SKIP_NEXT" | 
|  | 1262 |  | 
|  | 1263 | # first test with default MFU is to get reference memory usage | 
|  | 1264 | MEMORY_USAGE_MFL_16K=0 | 
|  | 1265 | run_test    "Handshake memory usage initial (MFL 16384 - default)" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1266 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ | 
|  | 1267 | "$P_CLI debug_level=3 force_version=tls12 \ | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1268 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 1269 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ | 
|  | 1270 | 0 \ | 
|  | 1271 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" | 
|  | 1272 |  | 
|  | 1273 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1274 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" | 
|  | 1275 |  | 
|  | 1276 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1277 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" | 
|  | 1278 |  | 
|  | 1279 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1280 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" | 
|  | 1281 |  | 
|  | 1282 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1283 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" | 
|  | 1284 | } | 
|  | 1285 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1286 | cleanup() { | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1287 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION | 
| Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1288 | rm -f context_srv.txt | 
|  | 1289 | rm -f context_cli.txt | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1290 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 | 
|  | 1291 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 | 
|  | 1292 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 | 
|  | 1293 | 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] | 1294 | exit 1 | 
|  | 1295 | } | 
|  | 1296 |  | 
| Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1297 | # | 
|  | 1298 | # MAIN | 
|  | 1299 | # | 
|  | 1300 |  | 
| Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1301 | get_options "$@" | 
|  | 1302 |  | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1303 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell | 
|  | 1304 | # patterns rather than regular expressions, use a case statement instead | 
|  | 1305 | # of calling grep. To keep the optimizer simple, it is incomplete and only | 
|  | 1306 | # detects simple cases: plain substring, everything, nothing. | 
|  | 1307 | # | 
|  | 1308 | # As an exception, the character '.' is treated as an ordinary character | 
|  | 1309 | # if it is the only special character in the string. This is because it's | 
|  | 1310 | # rare to need "any one character", but needing a literal '.' is common | 
|  | 1311 | # (e.g. '-f "DTLS 1.2"'). | 
|  | 1312 | need_grep= | 
|  | 1313 | case "$FILTER" in | 
|  | 1314 | '^$') simple_filter=;; | 
|  | 1315 | '.*') simple_filter='*';; | 
| Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1316 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1317 | need_grep=1;; | 
|  | 1318 | *) # No regexp or shell-pattern special character | 
|  | 1319 | simple_filter="*$FILTER*";; | 
|  | 1320 | esac | 
|  | 1321 | case "$EXCLUDE" in | 
|  | 1322 | '^$') simple_exclude=;; | 
|  | 1323 | '.*') simple_exclude='*';; | 
| Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1324 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1325 | need_grep=1;; | 
|  | 1326 | *) # No regexp or shell-pattern special character | 
|  | 1327 | simple_exclude="*$EXCLUDE*";; | 
|  | 1328 | esac | 
|  | 1329 | if [ -n "$need_grep" ]; then | 
|  | 1330 | is_excluded () { | 
|  | 1331 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" | 
|  | 1332 | } | 
|  | 1333 | else | 
|  | 1334 | is_excluded () { | 
|  | 1335 | case "$1" in | 
|  | 1336 | $simple_exclude) true;; | 
|  | 1337 | $simple_filter) false;; | 
|  | 1338 | *) true;; | 
|  | 1339 | esac | 
|  | 1340 | } | 
|  | 1341 | fi | 
|  | 1342 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1343 | # sanity checks, avoid an avalanche of errors | 
| Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1344 | P_SRV_BIN="${P_SRV%%[  ]*}" | 
|  | 1345 | P_CLI_BIN="${P_CLI%%[  ]*}" | 
|  | 1346 | P_PXY_BIN="${P_PXY%%[  ]*}" | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1347 | if [ ! -x "$P_SRV_BIN" ]; then | 
|  | 1348 | echo "Command '$P_SRV_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1349 | exit 1 | 
|  | 1350 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1351 | if [ ! -x "$P_CLI_BIN" ]; then | 
|  | 1352 | echo "Command '$P_CLI_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1353 | exit 1 | 
|  | 1354 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1355 | if [ ! -x "$P_PXY_BIN" ]; then | 
|  | 1356 | echo "Command '$P_PXY_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1357 | exit 1 | 
|  | 1358 | fi | 
| Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1359 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 1360 | if which valgrind >/dev/null 2>&1; then :; else | 
|  | 1361 | echo "Memcheck not possible. Valgrind not found" | 
|  | 1362 | exit 1 | 
|  | 1363 | fi | 
|  | 1364 | fi | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1365 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else | 
|  | 1366 | echo "Command '$OPENSSL_CMD' not found" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1367 | exit 1 | 
|  | 1368 | fi | 
|  | 1369 |  | 
| Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1370 | # used by watchdog | 
|  | 1371 | MAIN_PID="$$" | 
|  | 1372 |  | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1373 | # We use somewhat arbitrary delays for tests: | 
|  | 1374 | # - how long do we wait for the server to start (when lsof not available)? | 
|  | 1375 | # - how long do we allow for the client to finish? | 
|  | 1376 | #   (not to check performance, just to avoid waiting indefinitely) | 
|  | 1377 | # Things are slower with valgrind, so give extra time here. | 
|  | 1378 | # | 
|  | 1379 | # Note: without lsof, there is a trade-off between the running time of this | 
|  | 1380 | # script and the risk of spurious errors because we didn't wait long enough. | 
|  | 1381 | # The watchdog delay on the other hand doesn't affect normal running time of | 
|  | 1382 | # 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] | 1383 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1384 | START_DELAY=6 | 
|  | 1385 | DOG_DELAY=60 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1386 | else | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1387 | START_DELAY=2 | 
|  | 1388 | DOG_DELAY=20 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1389 | fi | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1390 |  | 
|  | 1391 | # some particular tests need more time: | 
|  | 1392 | # - for the client, we multiply the usual watchdog limit by a factor | 
|  | 1393 | # - for the server, we sleep for a number of seconds after the client exits | 
|  | 1394 | # see client_need_more_time() and server_needs_more_time() | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1395 | CLI_DELAY_FACTOR=1 | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1396 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1397 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1398 | # 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] | 1399 | # +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] | 1400 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many | 
|  | 1401 | # 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] | 1402 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" | 
|  | 1403 | 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] | 1404 | 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] | 1405 | O_SRV="$O_SRV -accept $SRV_PORT" | 
| Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1406 | 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] | 1407 | G_SRV="$G_SRV -p $SRV_PORT" | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1408 | G_CLI="$G_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1409 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1410 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 1411 | 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] | 1412 | 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] | 1413 | fi | 
|  | 1414 |  | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1415 | if [ -n "${OPENSSL_NEXT:-}" ]; then | 
|  | 1416 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1417 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" | 
| Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1418 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1419 | fi | 
|  | 1420 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1421 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1422 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1423 | 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] | 1424 | fi | 
|  | 1425 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1426 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1427 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1428 | fi | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1429 |  | 
| Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1430 | # Allow SHA-1, because many of our test certificates use it | 
|  | 1431 | P_SRV="$P_SRV allow_sha1=1" | 
|  | 1432 | P_CLI="$P_CLI allow_sha1=1" | 
|  | 1433 |  | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1434 | # Also pick a unique name for intermediate files | 
|  | 1435 | SRV_OUT="srv_out.$$" | 
|  | 1436 | CLI_OUT="cli_out.$$" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1437 | PXY_OUT="pxy_out.$$" | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1438 | SESSION="session.$$" | 
|  | 1439 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1440 | SKIP_NEXT="NO" | 
|  | 1441 |  | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1442 | trap cleanup INT TERM HUP | 
|  | 1443 |  | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1444 | # Basic test | 
|  | 1445 |  | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1446 | # Checks that: | 
|  | 1447 | # - 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] | 1448 | # - the expected parameters are selected | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1449 | #   ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1451 | run_test    "Default" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1452 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1453 | "$P_CLI" \ | 
|  | 1454 | 0 \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1455 | -s "Protocol is TLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1456 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1457 | -s "client hello v3, signature_algorithm ext: 6" \ | 
| Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1458 | -s "ECDHE curve: x25519" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1459 | -S "error" \ | 
|  | 1460 | -C "error" | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1461 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1463 | run_test    "Default, DTLS" \ | 
|  | 1464 | "$P_SRV dtls=1" \ | 
|  | 1465 | "$P_CLI dtls=1" \ | 
|  | 1466 | 0 \ | 
|  | 1467 | -s "Protocol is DTLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1468 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1469 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1471 | run_test    "TLS client auth: required" \ | 
|  | 1472 | "$P_SRV auth_mode=required" \ | 
|  | 1473 | "$P_CLI" \ | 
|  | 1474 | 0 \ | 
|  | 1475 | -s "Verifying peer X.509 certificate... ok" | 
|  | 1476 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1478 | run_test    "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1479 | "$P_SRV" \ | 
|  | 1480 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1481 | 0 \ | 
|  | 1482 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1483 | -c "Key size is 256" | 
|  | 1484 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1486 | run_test    "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1487 | "$P_SRV" \ | 
|  | 1488 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1489 | 0 \ | 
|  | 1490 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1491 | -c "Key size is 128" | 
|  | 1492 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1494 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1495 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1496 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1497 | run_test    "TLS: password protected client key" \ | 
|  | 1498 | "$P_SRV auth_mode=required" \ | 
|  | 1499 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ | 
|  | 1500 | 0 | 
|  | 1501 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1503 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1504 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1505 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1506 | run_test    "TLS: password protected server key" \ | 
|  | 1507 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ | 
|  | 1508 | "$P_CLI" \ | 
|  | 1509 | 0 | 
|  | 1510 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1512 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1513 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1514 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 1515 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1516 | run_test    "TLS: password protected server key, two certificates" \ | 
|  | 1517 | "$P_SRV \ | 
|  | 1518 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ | 
|  | 1519 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ | 
|  | 1520 | "$P_CLI" \ | 
|  | 1521 | 0 | 
|  | 1522 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1524 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 1525 | run_test    "CA callback on client" \ | 
|  | 1526 | "$P_SRV debug_level=3" \ | 
|  | 1527 | "$P_CLI ca_callback=1 debug_level=3 " \ | 
|  | 1528 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1529 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1530 | -S "error" \ | 
|  | 1531 | -C "error" | 
|  | 1532 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1534 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 1535 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1536 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1537 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1538 | run_test    "CA callback on server" \ | 
|  | 1539 | "$P_SRV auth_mode=required" \ | 
|  | 1540 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ | 
|  | 1541 | key_file=data_files/server5.key" \ | 
|  | 1542 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1543 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1544 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 1545 | -S "error" \ | 
|  | 1546 | -C "error" | 
|  | 1547 |  | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1548 | # Test using an opaque private key for client authentication | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1550 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 1551 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1552 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1553 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1554 | run_test    "Opaque key for client authentication" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1555 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ | 
|  | 1556 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1557 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 1558 | key_file=data_files/server5.key" \ | 
|  | 1559 | 0 \ | 
|  | 1560 | -c "key type: Opaque" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1561 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1562 | -s "Verifying peer X.509 certificate... ok" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1563 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1564 | -S "error" \ | 
|  | 1565 | -C "error" | 
|  | 1566 |  | 
| Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1567 | # Test using an opaque private key for server authentication | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1569 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 1570 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1571 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1572 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1573 | run_test    "Opaque key for server authentication" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1574 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 1575 | key_file=data_files/server5.key" \ | 
| Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1576 | "$P_CLI crt_file=data_files/server5.crt \ | 
|  | 1577 | key_file=data_files/server5.key" \ | 
|  | 1578 | 0 \ | 
|  | 1579 | -c "Verifying peer X.509 certificate... ok" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1580 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1581 | -s "key types: Opaque, none" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1582 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1583 | -S "error" \ | 
|  | 1584 | -C "error" | 
|  | 1585 |  | 
| Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1586 | # Test using an opaque private key for client/server authentication | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 1589 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1590 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1591 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1592 | run_test    "Opaque key for client/server authentication" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1593 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 1594 | key_file=data_files/server5.key" \ | 
| Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1595 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 1596 | key_file=data_files/server5.key" \ | 
|  | 1597 | 0 \ | 
|  | 1598 | -c "key type: Opaque" \ | 
|  | 1599 | -c "Verifying peer X.509 certificate... ok" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1600 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1601 | -s "key types: Opaque, none" \ | 
| Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1602 | -s "Verifying peer X.509 certificate... ok" \ | 
| Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1603 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1604 | -S "error" \ | 
|  | 1605 | -C "error" | 
|  | 1606 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1607 | # Test ciphersuites which we expect to be fully supported by PSA Crypto | 
|  | 1608 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. | 
|  | 1609 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM | 
|  | 1610 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 | 
|  | 1611 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM | 
|  | 1612 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 | 
|  | 1613 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 | 
|  | 1614 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 | 
|  | 1615 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA | 
|  | 1616 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 | 
|  | 1617 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 | 
|  | 1618 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1619 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED | 
|  | 1620 | run_test_psa_force_curve "secp521r1" | 
|  | 1621 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED | 
|  | 1622 | run_test_psa_force_curve "brainpoolP512r1" | 
|  | 1623 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED | 
|  | 1624 | run_test_psa_force_curve "secp384r1" | 
|  | 1625 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED | 
|  | 1626 | run_test_psa_force_curve "brainpoolP384r1" | 
|  | 1627 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
|  | 1628 | run_test_psa_force_curve "secp256r1" | 
|  | 1629 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED | 
|  | 1630 | run_test_psa_force_curve "secp256k1" | 
|  | 1631 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED | 
|  | 1632 | run_test_psa_force_curve "brainpoolP256r1" | 
|  | 1633 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED | 
|  | 1634 | run_test_psa_force_curve "secp224r1" | 
| Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1635 | ## SECP224K1 is buggy via the PSA API | 
|  | 1636 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), | 
|  | 1637 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. | 
|  | 1638 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but | 
|  | 1639 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. | 
|  | 1640 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED | 
|  | 1641 | #run_test_psa_force_curve "secp224k1" | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1642 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED | 
|  | 1643 | run_test_psa_force_curve "secp192r1" | 
|  | 1644 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED | 
|  | 1645 | run_test_psa_force_curve "secp192k1" | 
|  | 1646 |  | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1647 | # Test current time in ServerHello | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1649 | requires_config_enabled MBEDTLS_HAVE_TIME | 
|  | 1650 | run_test    "ServerHello contains gmt_unix_time" \ | 
|  | 1651 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1652 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1653 | 0 \ | 
|  | 1654 | -f "check_server_hello_time" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1655 | -F "check_server_hello_time" | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1656 |  | 
|  | 1657 | # Test for uniqueness of IVs in AEAD ciphersuites | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1659 | run_test    "Unique IV in GCM" \ | 
|  | 1660 | "$P_SRV exchanges=20 debug_level=4" \ | 
|  | 1661 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 1662 | 0 \ | 
|  | 1663 | -u "IV used" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1664 | -U "IV used" | 
|  | 1665 |  | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1666 | # Tests for certificate verification callback | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1668 | run_test    "Configuration-specific CRT verification callback" \ | 
|  | 1669 | "$P_SRV debug_level=3" \ | 
|  | 1670 | "$P_CLI context_crt_cb=0 debug_level=3" \ | 
|  | 1671 | 0 \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1672 | -S "error" \ | 
|  | 1673 | -c "Verify requested for " \ | 
|  | 1674 | -c "Use configuration-specific verification callback" \ | 
|  | 1675 | -C "Use context-specific verification callback" \ | 
|  | 1676 | -C "error" | 
|  | 1677 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1679 | run_test    "Context-specific CRT verification callback" \ | 
|  | 1680 | "$P_SRV debug_level=3" \ | 
|  | 1681 | "$P_CLI context_crt_cb=1 debug_level=3" \ | 
|  | 1682 | 0 \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1683 | -S "error" \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1684 | -c "Verify requested for " \ | 
|  | 1685 | -c "Use context-specific verification callback" \ | 
|  | 1686 | -C "Use configuration-specific verification callback" \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1687 | -C "error" | 
|  | 1688 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1689 | # Tests for SHA-1 support | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1691 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 1692 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1693 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 1694 | 1 \ | 
|  | 1695 | -c "The certificate is signed with an unacceptable hash" | 
|  | 1696 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1698 | run_test    "SHA-1 explicitly allowed in server certificate" \ | 
|  | 1699 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1700 | "$P_CLI allow_sha1=1" \ | 
|  | 1701 | 0 | 
|  | 1702 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1704 | run_test    "SHA-256 allowed by default in server certificate" \ | 
|  | 1705 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ | 
|  | 1706 | "$P_CLI allow_sha1=0" \ | 
|  | 1707 | 0 | 
|  | 1708 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1710 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 1711 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1712 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1713 | 1 \ | 
|  | 1714 | -s "The certificate is signed with an unacceptable hash" | 
|  | 1715 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1717 | run_test    "SHA-1 explicitly allowed in client certificate" \ | 
|  | 1718 | "$P_SRV auth_mode=required allow_sha1=1" \ | 
|  | 1719 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1720 | 0 | 
|  | 1721 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1723 | run_test    "SHA-256 allowed by default in client certificate" \ | 
|  | 1724 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1725 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ | 
|  | 1726 | 0 | 
|  | 1727 |  | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1728 | # Dummy TLS 1.3 test | 
|  | 1729 | # Currently only checking that passing TLS 1.3 key exchange modes to | 
|  | 1730 | # ssl_client2/ssl_server2 example programs works. | 
| Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1733 | run_test    "TLS 1.3, key exchange mode parameter passing: PSK only" \ | 
| Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1734 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ | 
|  | 1735 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1736 | 0 | 
| Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1739 | run_test    "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ | 
|  | 1740 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ | 
|  | 1741 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ | 
|  | 1742 | 0 | 
| Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1745 | run_test    "TLS 1.3, key exchange mode parameter passing: Pure-ephemeral only" \ | 
| Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1746 | "$P_SRV tls13_kex_modes=ephemeral" \ | 
|  | 1747 | "$P_CLI tls13_kex_modes=ephemeral" \ | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1748 | 0 | 
| Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1751 | run_test    "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ | 
|  | 1752 | "$P_SRV tls13_kex_modes=ephemeral_all" \ | 
|  | 1753 | "$P_CLI tls13_kex_modes=ephemeral_all" \ | 
|  | 1754 | 0 | 
| Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1757 | run_test    "TLS 1.3, key exchange mode parameter passing: All PSK" \ | 
|  | 1758 | "$P_SRV tls13_kex_modes=psk_all" \ | 
|  | 1759 | "$P_CLI tls13_kex_modes=psk_all" \ | 
|  | 1760 | 0 | 
| Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1763 | run_test    "TLS 1.3, key exchange mode parameter passing: All" \ | 
|  | 1764 | "$P_SRV tls13_kex_modes=all" \ | 
|  | 1765 | "$P_CLI tls13_kex_modes=all" \ | 
|  | 1766 | 0 | 
|  | 1767 |  | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1768 | # Tests for datagram packing | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1770 | run_test    "DTLS: multiple records in same datagram, client and server" \ | 
|  | 1771 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1772 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1773 | 0 \ | 
|  | 1774 | -c "next record in same datagram" \ | 
|  | 1775 | -s "next record in same datagram" | 
|  | 1776 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1778 | run_test    "DTLS: multiple records in same datagram, client only" \ | 
|  | 1779 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1780 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1781 | 0 \ | 
|  | 1782 | -s "next record in same datagram" \ | 
|  | 1783 | -C "next record in same datagram" | 
|  | 1784 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1786 | run_test    "DTLS: multiple records in same datagram, server only" \ | 
|  | 1787 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1788 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1789 | 0 \ | 
|  | 1790 | -S "next record in same datagram" \ | 
|  | 1791 | -c "next record in same datagram" | 
|  | 1792 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1794 | run_test    "DTLS: multiple records in same datagram, neither client nor server" \ | 
|  | 1795 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1796 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1797 | 0 \ | 
|  | 1798 | -S "next record in same datagram" \ | 
|  | 1799 | -C "next record in same datagram" | 
|  | 1800 |  | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1801 | # Tests for Context serialization | 
|  | 1802 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1804 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1805 | run_test    "Context serialization, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1806 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1807 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1808 | 0 \ | 
|  | 1809 | -c "Deserializing connection..." \ | 
|  | 1810 | -S "Deserializing connection..." | 
|  | 1811 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1813 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1814 | run_test    "Context serialization, client serializes, ChaChaPoly" \ | 
|  | 1815 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1816 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1817 | 0 \ | 
|  | 1818 | -c "Deserializing connection..." \ | 
|  | 1819 | -S "Deserializing connection..." | 
|  | 1820 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1822 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1823 | run_test    "Context serialization, client serializes, GCM" \ | 
|  | 1824 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1825 | "$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] | 1826 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1827 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1828 | -S "Deserializing connection..." | 
|  | 1829 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1831 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1832 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1833 | run_test    "Context serialization, client serializes, with CID" \ | 
|  | 1834 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1835 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1836 | 0 \ | 
|  | 1837 | -c "Deserializing connection..." \ | 
|  | 1838 | -S "Deserializing connection..." | 
|  | 1839 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1841 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1842 | run_test    "Context serialization, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1843 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1844 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1845 | 0 \ | 
|  | 1846 | -C "Deserializing connection..." \ | 
|  | 1847 | -s "Deserializing connection..." | 
|  | 1848 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1850 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1851 | run_test    "Context serialization, server serializes, ChaChaPoly" \ | 
|  | 1852 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1853 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1854 | 0 \ | 
|  | 1855 | -C "Deserializing connection..." \ | 
|  | 1856 | -s "Deserializing connection..." | 
|  | 1857 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1859 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1860 | run_test    "Context serialization, server serializes, GCM" \ | 
|  | 1861 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1862 | "$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] | 1863 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1864 | -C "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1865 | -s "Deserializing connection..." | 
|  | 1866 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1868 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1869 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1870 | run_test    "Context serialization, server serializes, with CID" \ | 
|  | 1871 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1872 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1873 | 0 \ | 
|  | 1874 | -C "Deserializing connection..." \ | 
|  | 1875 | -s "Deserializing connection..." | 
|  | 1876 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1878 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1879 | run_test    "Context serialization, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1880 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1881 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1882 | 0 \ | 
|  | 1883 | -c "Deserializing connection..." \ | 
|  | 1884 | -s "Deserializing connection..." | 
|  | 1885 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1887 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1888 | run_test    "Context serialization, both serialize, ChaChaPoly" \ | 
|  | 1889 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1890 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1891 | 0 \ | 
|  | 1892 | -c "Deserializing connection..." \ | 
|  | 1893 | -s "Deserializing connection..." | 
|  | 1894 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1896 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1897 | run_test    "Context serialization, both serialize, GCM" \ | 
|  | 1898 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1899 | "$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] | 1900 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1901 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1902 | -s "Deserializing connection..." | 
|  | 1903 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1906 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1907 | run_test    "Context serialization, both serialize, with CID" \ | 
|  | 1908 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1909 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1910 | 0 \ | 
|  | 1911 | -c "Deserializing connection..." \ | 
|  | 1912 | -s "Deserializing connection..." | 
|  | 1913 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1915 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1916 | run_test    "Context serialization, re-init, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1917 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1918 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1919 | 0 \ | 
|  | 1920 | -c "Deserializing connection..." \ | 
|  | 1921 | -S "Deserializing connection..." | 
|  | 1922 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1924 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1925 | run_test    "Context serialization, re-init, client serializes, ChaChaPoly" \ | 
|  | 1926 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1927 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1928 | 0 \ | 
|  | 1929 | -c "Deserializing connection..." \ | 
|  | 1930 | -S "Deserializing connection..." | 
|  | 1931 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1933 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1934 | run_test    "Context serialization, re-init, client serializes, GCM" \ | 
|  | 1935 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1936 | "$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] | 1937 | 0 \ | 
|  | 1938 | -c "Deserializing connection..." \ | 
|  | 1939 | -S "Deserializing connection..." | 
|  | 1940 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1942 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1943 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1944 | run_test    "Context serialization, re-init, client serializes, with CID" \ | 
|  | 1945 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1946 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1947 | 0 \ | 
|  | 1948 | -c "Deserializing connection..." \ | 
|  | 1949 | -S "Deserializing connection..." | 
|  | 1950 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1952 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1953 | run_test    "Context serialization, re-init, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1954 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1955 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1956 | 0 \ | 
|  | 1957 | -C "Deserializing connection..." \ | 
|  | 1958 | -s "Deserializing connection..." | 
|  | 1959 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1961 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1962 | run_test    "Context serialization, re-init, server serializes, ChaChaPoly" \ | 
|  | 1963 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1964 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1965 | 0 \ | 
|  | 1966 | -C "Deserializing connection..." \ | 
|  | 1967 | -s "Deserializing connection..." | 
|  | 1968 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1971 | run_test    "Context serialization, re-init, server serializes, GCM" \ | 
|  | 1972 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1973 | "$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] | 1974 | 0 \ | 
|  | 1975 | -C "Deserializing connection..." \ | 
|  | 1976 | -s "Deserializing connection..." | 
|  | 1977 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1978 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1979 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1980 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1981 | run_test    "Context serialization, re-init, server serializes, with CID" \ | 
|  | 1982 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1983 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1984 | 0 \ | 
|  | 1985 | -C "Deserializing connection..." \ | 
|  | 1986 | -s "Deserializing connection..." | 
|  | 1987 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1990 | run_test    "Context serialization, re-init, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1991 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1992 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1993 | 0 \ | 
|  | 1994 | -c "Deserializing connection..." \ | 
|  | 1995 | -s "Deserializing connection..." | 
|  | 1996 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1998 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1999 | run_test    "Context serialization, re-init, both serialize, ChaChaPoly" \ | 
|  | 2000 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 2001 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 2002 | 0 \ | 
|  | 2003 | -c "Deserializing connection..." \ | 
|  | 2004 | -s "Deserializing connection..." | 
|  | 2005 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2008 | run_test    "Context serialization, re-init, both serialize, GCM" \ | 
|  | 2009 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 2010 | "$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] | 2011 | 0 \ | 
|  | 2012 | -c "Deserializing connection..." \ | 
|  | 2013 | -s "Deserializing connection..." | 
|  | 2014 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2016 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2017 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2018 | run_test    "Context serialization, re-init, both serialize, with CID" \ | 
|  | 2019 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 2020 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 2021 | 0 \ | 
|  | 2022 | -c "Deserializing connection..." \ | 
|  | 2023 | -s "Deserializing connection..." | 
|  | 2024 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2026 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 2027 | run_test    "Saving the serialized context to a file" \ | 
|  | 2028 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ | 
|  | 2029 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ | 
|  | 2030 | 0 \ | 
|  | 2031 | -s "Save serialized context to a file... ok" \ | 
|  | 2032 | -c "Save serialized context to a file... ok" | 
|  | 2033 | rm -f context_srv.txt | 
|  | 2034 | rm -f context_cli.txt | 
|  | 2035 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2036 | # Tests for DTLS Connection ID extension | 
|  | 2037 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2038 | # So far, the CID API isn't implemented, so we can't | 
|  | 2039 | # grep for output witnessing its use. This needs to be | 
|  | 2040 | # changed once the CID extension is implemented. | 
|  | 2041 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2043 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2044 | run_test    "Connection ID: Cli enabled, Srv disabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2045 | "$P_SRV debug_level=3 dtls=1 cid=0" \ | 
|  | 2046 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2047 | 0 \ | 
|  | 2048 | -s "Disable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2049 | -s "found CID extension"           \ | 
|  | 2050 | -s "Client sent CID extension, but CID disabled" \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2051 | -c "Enable use of CID extension."  \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2052 | -c "client hello, adding CID extension" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2053 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2054 | -C "found CID extension" \ | 
|  | 2055 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2056 | -C "Copy CIDs into SSL transform" \ | 
|  | 2057 | -c "Use of Connection ID was rejected by the server" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2058 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2060 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2061 | run_test    "Connection ID: Cli disabled, Srv enabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2062 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2063 | "$P_CLI debug_level=3 dtls=1 cid=0" \ | 
|  | 2064 | 0 \ | 
|  | 2065 | -c "Disable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2066 | -C "client hello, adding CID extension"           \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2067 | -S "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2068 | -s "Enable use of CID extension." \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2069 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2070 | -C "found CID extension" \ | 
|  | 2071 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2072 | -C "Copy CIDs into SSL transform"  \ | 
| Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2073 | -s "Use of Connection ID was not offered by client" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2074 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2076 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2077 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2078 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2079 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2080 | 0 \ | 
|  | 2081 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2082 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2083 | -c "client hello, adding CID extension" \ | 
|  | 2084 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2085 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2086 | -s "server hello, adding CID extension" \ | 
|  | 2087 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2088 | -c "Use of CID extension negotiated" \ | 
|  | 2089 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2090 | -c "Copy CIDs into SSL transform" \ | 
|  | 2091 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2092 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2093 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2094 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2095 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2097 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2098 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2099 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2100 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ | 
|  | 2101 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ | 
|  | 2102 | 0 \ | 
|  | 2103 | -c "Enable use of CID extension." \ | 
|  | 2104 | -s "Enable use of CID extension." \ | 
|  | 2105 | -c "client hello, adding CID extension" \ | 
|  | 2106 | -s "found CID extension"           \ | 
|  | 2107 | -s "Use of CID extension negotiated" \ | 
|  | 2108 | -s "server hello, adding CID extension" \ | 
|  | 2109 | -c "found CID extension" \ | 
|  | 2110 | -c "Use of CID extension negotiated" \ | 
|  | 2111 | -s "Copy CIDs into SSL transform" \ | 
|  | 2112 | -c "Copy CIDs into SSL transform" \ | 
|  | 2113 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2114 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2115 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2116 | -c "Use of Connection ID has been negotiated" \ | 
|  | 2117 | -c "ignoring unexpected CID" \ | 
|  | 2118 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2119 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2121 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2122 | run_test    "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
|  | 2123 | -p "$P_PXY mtu=800" \ | 
|  | 2124 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2125 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2126 | 0 \ | 
|  | 2127 | -c "Enable use of CID extension." \ | 
|  | 2128 | -s "Enable use of CID extension." \ | 
|  | 2129 | -c "client hello, adding CID extension" \ | 
|  | 2130 | -s "found CID extension"           \ | 
|  | 2131 | -s "Use of CID extension negotiated" \ | 
|  | 2132 | -s "server hello, adding CID extension" \ | 
|  | 2133 | -c "found CID extension" \ | 
|  | 2134 | -c "Use of CID extension negotiated" \ | 
|  | 2135 | -s "Copy CIDs into SSL transform" \ | 
|  | 2136 | -c "Copy CIDs into SSL transform" \ | 
|  | 2137 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2138 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2139 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2140 | -c "Use of Connection ID has been negotiated" | 
|  | 2141 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2143 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2144 | 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] | 2145 | -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] | 2146 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2147 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2148 | 0 \ | 
|  | 2149 | -c "Enable use of CID extension." \ | 
|  | 2150 | -s "Enable use of CID extension." \ | 
|  | 2151 | -c "client hello, adding CID extension" \ | 
|  | 2152 | -s "found CID extension"           \ | 
|  | 2153 | -s "Use of CID extension negotiated" \ | 
|  | 2154 | -s "server hello, adding CID extension" \ | 
|  | 2155 | -c "found CID extension" \ | 
|  | 2156 | -c "Use of CID extension negotiated" \ | 
|  | 2157 | -s "Copy CIDs into SSL transform" \ | 
|  | 2158 | -c "Copy CIDs into SSL transform" \ | 
|  | 2159 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2160 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2161 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2162 | -c "Use of Connection ID has been negotiated" \ | 
|  | 2163 | -c "ignoring unexpected CID" \ | 
|  | 2164 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2165 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2167 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2168 | run_test    "Connection ID: Cli+Srv enabled, Cli CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2169 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2170 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 2171 | 0 \ | 
|  | 2172 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2173 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2174 | -c "client hello, adding CID extension" \ | 
|  | 2175 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2176 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2177 | -s "server hello, adding CID extension" \ | 
|  | 2178 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2179 | -c "Use of CID extension negotiated" \ | 
|  | 2180 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2181 | -c "Copy CIDs into SSL transform" \ | 
|  | 2182 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2183 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 2184 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2185 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2186 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2188 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2189 | run_test    "Connection ID: Cli+Srv enabled, Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2190 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2191 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2192 | 0 \ | 
|  | 2193 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2194 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2195 | -c "client hello, adding CID extension" \ | 
|  | 2196 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2197 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2198 | -s "server hello, adding CID extension" \ | 
|  | 2199 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2200 | -c "Use of CID extension negotiated" \ | 
|  | 2201 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2202 | -c "Copy CIDs into SSL transform" \ | 
|  | 2203 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2204 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 2205 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2206 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2207 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2209 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2210 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2211 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2212 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 2213 | 0 \ | 
|  | 2214 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2215 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2216 | -c "client hello, adding CID extension" \ | 
|  | 2217 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2218 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2219 | -s "server hello, adding CID extension" \ | 
|  | 2220 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2221 | -c "Use of CID extension negotiated" \ | 
|  | 2222 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2223 | -c "Copy CIDs into SSL transform" \ | 
|  | 2224 | -S "Use of Connection ID has been negotiated" \ | 
|  | 2225 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2226 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2228 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2229 | 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] | 2230 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2231 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2232 | 0 \ | 
|  | 2233 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2234 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2235 | -c "client hello, adding CID extension" \ | 
|  | 2236 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2237 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2238 | -s "server hello, adding CID extension" \ | 
|  | 2239 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2240 | -c "Use of CID extension negotiated" \ | 
|  | 2241 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2242 | -c "Copy CIDs into SSL transform" \ | 
|  | 2243 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2244 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2245 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2246 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2247 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2250 | 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] | 2251 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2252 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2253 | 0 \ | 
|  | 2254 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2255 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2256 | -c "client hello, adding CID extension" \ | 
|  | 2257 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2258 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2259 | -s "server hello, adding CID extension" \ | 
|  | 2260 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2261 | -c "Use of CID extension negotiated" \ | 
|  | 2262 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2263 | -c "Copy CIDs into SSL transform" \ | 
|  | 2264 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2265 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 2266 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2267 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2268 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2270 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2271 | 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] | 2272 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2273 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2274 | 0 \ | 
|  | 2275 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2276 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2277 | -c "client hello, adding CID extension" \ | 
|  | 2278 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2279 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2280 | -s "server hello, adding CID extension" \ | 
|  | 2281 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2282 | -c "Use of CID extension negotiated" \ | 
|  | 2283 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2284 | -c "Copy CIDs into SSL transform" \ | 
|  | 2285 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2286 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 2287 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2288 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2289 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2291 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2292 | 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] | 2293 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2294 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2295 | 0 \ | 
|  | 2296 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2297 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2298 | -c "client hello, adding CID extension" \ | 
|  | 2299 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2300 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2301 | -s "server hello, adding CID extension" \ | 
|  | 2302 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2303 | -c "Use of CID extension negotiated" \ | 
|  | 2304 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2305 | -c "Copy CIDs into SSL transform" \ | 
|  | 2306 | -S "Use of Connection ID has been negotiated" \ | 
|  | 2307 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2308 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2311 | 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] | 2312 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2313 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2314 | 0 \ | 
|  | 2315 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2316 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2317 | -c "client hello, adding CID extension" \ | 
|  | 2318 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2319 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2320 | -s "server hello, adding CID extension" \ | 
|  | 2321 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2322 | -c "Use of CID extension negotiated" \ | 
|  | 2323 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2324 | -c "Copy CIDs into SSL transform" \ | 
|  | 2325 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2326 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2327 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2328 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2329 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2331 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2332 | 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] | 2333 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2334 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2335 | 0 \ | 
|  | 2336 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2337 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2338 | -c "client hello, adding CID extension" \ | 
|  | 2339 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2340 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2341 | -s "server hello, adding CID extension" \ | 
|  | 2342 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2343 | -c "Use of CID extension negotiated" \ | 
|  | 2344 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2345 | -c "Copy CIDs into SSL transform" \ | 
|  | 2346 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2347 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 2348 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2349 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2350 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2352 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2353 | 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] | 2354 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2355 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2356 | 0 \ | 
|  | 2357 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2358 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2359 | -c "client hello, adding CID extension" \ | 
|  | 2360 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2361 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2362 | -s "server hello, adding CID extension" \ | 
|  | 2363 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2364 | -c "Use of CID extension negotiated" \ | 
|  | 2365 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2366 | -c "Copy CIDs into SSL transform" \ | 
|  | 2367 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2368 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 2369 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2370 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2371 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2373 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2374 | 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] | 2375 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2376 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2377 | 0 \ | 
|  | 2378 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2379 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2380 | -c "client hello, adding CID extension" \ | 
|  | 2381 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2382 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2383 | -s "server hello, adding CID extension" \ | 
|  | 2384 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2385 | -c "Use of CID extension negotiated" \ | 
|  | 2386 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2387 | -c "Copy CIDs into SSL transform" \ | 
|  | 2388 | -S "Use of Connection ID has been negotiated" \ | 
|  | 2389 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2390 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2392 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2393 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2394 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2395 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2396 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2397 | 0 \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2398 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2399 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2400 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2401 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2402 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2403 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2404 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2405 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2406 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2408 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2410 | run_test    "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2411 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2412 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2413 | 0 \ | 
|  | 2414 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2415 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2416 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2417 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2418 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2419 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2420 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2421 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2422 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2424 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2425 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2426 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ | 
|  | 2427 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2428 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2429 | 0 \ | 
|  | 2430 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2431 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2432 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2433 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2434 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2435 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2436 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2437 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2438 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2442 | 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] | 2443 | -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] | 2444 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2445 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2446 | 0 \ | 
|  | 2447 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2448 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2449 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2450 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2451 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2452 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2453 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2454 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2455 | -c "ignoring unexpected CID" \ | 
|  | 2456 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2457 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2459 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2460 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2461 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2462 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2463 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2464 | 0 \ | 
|  | 2465 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2466 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2467 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2468 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2469 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2470 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2471 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2472 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2473 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2477 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ | 
|  | 2478 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2479 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2480 | 0 \ | 
|  | 2481 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2482 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2483 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2484 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2485 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2486 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2487 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2488 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2489 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2491 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2493 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2494 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2495 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2496 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2497 | 0 \ | 
|  | 2498 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2499 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2500 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2501 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2502 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2503 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2504 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2505 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2506 | -c "ignoring unexpected CID" \ | 
|  | 2507 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2508 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2511 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2512 | run_test    "Connection ID: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2513 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2514 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 2515 | 0 \ | 
|  | 2516 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2517 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2518 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2519 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2520 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2521 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2522 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2524 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2526 | run_test    "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ | 
|  | 2527 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2528 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 2529 | 0 \ | 
|  | 2530 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2531 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2532 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2533 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2534 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2535 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2536 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2540 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2541 | -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] | 2542 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2543 | "$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" \ | 
|  | 2544 | 0 \ | 
|  | 2545 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2546 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2547 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2548 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2549 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2550 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2551 | -c "ignoring unexpected CID" \ | 
|  | 2552 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2553 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2555 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2556 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2557 | run_test    "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2558 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2559 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2560 | 0 \ | 
|  | 2561 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2562 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2563 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2564 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2565 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2566 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2567 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2568 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2569 | -s "(after renegotiation) Use of Connection ID was not offered by client" | 
|  | 2570 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2572 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2573 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2574 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2575 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2576 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2577 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2578 | 0 \ | 
|  | 2579 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2580 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2581 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2582 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2583 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2584 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2585 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2586 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2587 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ | 
|  | 2588 | -c "ignoring unexpected CID" \ | 
|  | 2589 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2590 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2592 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2593 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2594 | run_test    "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ | 
|  | 2595 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2596 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2597 | 0 \ | 
|  | 2598 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2599 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2600 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2601 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2602 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2603 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2604 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2605 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2606 | -c "(after renegotiation) Use of Connection ID was rejected by the server" | 
|  | 2607 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2609 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2610 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2611 | run_test    "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2612 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2613 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2614 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2615 | 0 \ | 
|  | 2616 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2617 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2618 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2619 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2620 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2621 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2622 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2623 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2624 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ | 
|  | 2625 | -c "ignoring unexpected CID" \ | 
|  | 2626 | -s "ignoring unexpected CID" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2627 |  | 
| Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2628 | # 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] | 2629 | # tests check that the buffer contents are reallocated when the message is | 
|  | 2630 | # larger than the buffer. | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2632 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2633 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH | 
| Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2634 | requires_max_content_len 513 | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2635 | run_test    "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ | 
|  | 2636 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ | 
|  | 2637 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2638 | 0 \ | 
|  | 2639 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2640 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2641 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2642 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2643 | -s "Reallocating in_buf" \ | 
|  | 2644 | -s "Reallocating out_buf" | 
|  | 2645 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2647 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2648 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH | 
| Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2649 | requires_max_content_len 1025 | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2650 | run_test    "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ | 
|  | 2651 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ | 
|  | 2652 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2653 | 0 \ | 
|  | 2654 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2655 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2656 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2657 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2658 | -s "Reallocating in_buf" \ | 
|  | 2659 | -s "Reallocating out_buf" | 
|  | 2660 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2661 | # Tests for Encrypt-then-MAC extension | 
|  | 2662 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2664 | run_test    "Encrypt then MAC: default" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2665 | "$P_SRV debug_level=3 \ | 
|  | 2666 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2667 | "$P_CLI debug_level=3" \ | 
|  | 2668 | 0 \ | 
|  | 2669 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2670 | -s "found encrypt then mac extension" \ | 
|  | 2671 | -s "server hello, adding encrypt then mac extension" \ | 
|  | 2672 | -c "found encrypt_then_mac extension" \ | 
|  | 2673 | -c "using encrypt then mac" \ | 
|  | 2674 | -s "using encrypt then mac" | 
|  | 2675 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2677 | run_test    "Encrypt then MAC: client enabled, server disabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2678 | "$P_SRV debug_level=3 etm=0 \ | 
|  | 2679 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2680 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 2681 | 0 \ | 
|  | 2682 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2683 | -s "found encrypt then mac extension" \ | 
|  | 2684 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2685 | -C "found encrypt_then_mac extension" \ | 
|  | 2686 | -C "using encrypt then mac" \ | 
|  | 2687 | -S "using encrypt then mac" | 
|  | 2688 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2690 | run_test    "Encrypt then MAC: client enabled, aead cipher" \ | 
|  | 2691 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2692 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 2693 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 2694 | 0 \ | 
|  | 2695 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2696 | -s "found encrypt then mac extension" \ | 
|  | 2697 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2698 | -C "found encrypt_then_mac extension" \ | 
|  | 2699 | -C "using encrypt then mac" \ | 
|  | 2700 | -S "using encrypt then mac" | 
|  | 2701 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2703 | run_test    "Encrypt then MAC: client disabled, server enabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2704 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2705 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2706 | "$P_CLI debug_level=3 etm=0" \ | 
|  | 2707 | 0 \ | 
|  | 2708 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 2709 | -S "found encrypt then mac extension" \ | 
|  | 2710 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2711 | -C "found encrypt_then_mac extension" \ | 
|  | 2712 | -C "using encrypt then mac" \ | 
|  | 2713 | -S "using encrypt then mac" | 
|  | 2714 |  | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2715 | # Tests for Extended Master Secret extension | 
|  | 2716 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2718 | run_test    "Extended Master Secret: default" \ | 
|  | 2719 | "$P_SRV debug_level=3" \ | 
|  | 2720 | "$P_CLI debug_level=3" \ | 
|  | 2721 | 0 \ | 
|  | 2722 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 2723 | -s "found extended master secret extension" \ | 
|  | 2724 | -s "server hello, adding extended master secret extension" \ | 
|  | 2725 | -c "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2726 | -c "session hash for extended master secret" \ | 
|  | 2727 | -s "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2728 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2730 | run_test    "Extended Master Secret: client enabled, server disabled" \ | 
|  | 2731 | "$P_SRV debug_level=3 extended_ms=0" \ | 
|  | 2732 | "$P_CLI debug_level=3 extended_ms=1" \ | 
|  | 2733 | 0 \ | 
|  | 2734 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 2735 | -s "found extended master secret extension" \ | 
|  | 2736 | -S "server hello, adding extended master secret extension" \ | 
|  | 2737 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2738 | -C "session hash for extended master secret" \ | 
|  | 2739 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2740 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2742 | run_test    "Extended Master Secret: client disabled, server enabled" \ | 
|  | 2743 | "$P_SRV debug_level=3 extended_ms=1" \ | 
|  | 2744 | "$P_CLI debug_level=3 extended_ms=0" \ | 
|  | 2745 | 0 \ | 
|  | 2746 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 2747 | -S "found extended master secret extension" \ | 
|  | 2748 | -S "server hello, adding extended master secret extension" \ | 
|  | 2749 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2750 | -C "session hash for extended master secret" \ | 
|  | 2751 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2752 |  | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2753 | # Test sending and receiving empty application data records | 
|  | 2754 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2756 | run_test    "Encrypt then MAC: empty application data record" \ | 
|  | 2757 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ | 
|  | 2758 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 2759 | 0 \ | 
|  | 2760 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 2761 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2762 | -c "0 bytes written in 1 fragments" | 
|  | 2763 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2765 | run_test    "Encrypt then MAC: disabled, empty application data record" \ | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2766 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ | 
|  | 2767 | "$P_CLI auth_mode=none etm=0 request_size=0" \ | 
|  | 2768 | 0 \ | 
|  | 2769 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2770 | -c "0 bytes written in 1 fragments" | 
|  | 2771 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2773 | run_test    "Encrypt then MAC, DTLS: empty application data record" \ | 
|  | 2774 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ | 
|  | 2775 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ | 
|  | 2776 | 0 \ | 
|  | 2777 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 2778 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2779 | -c "0 bytes written in 1 fragments" | 
|  | 2780 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2782 | run_test    "Encrypt then MAC, DTLS: disabled, empty application data record" \ | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2783 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ | 
|  | 2784 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ | 
|  | 2785 | 0 \ | 
|  | 2786 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2787 | -c "0 bytes written in 1 fragments" | 
|  | 2788 |  | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2789 | # Tests for CBC 1/n-1 record splitting | 
|  | 2790 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2792 | run_test    "CBC Record splitting: TLS 1.2, no splitting" \ | 
|  | 2793 | "$P_SRV" \ | 
|  | 2794 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2795 | request_size=123 force_version=tls12" \ | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2796 | 0 \ | 
|  | 2797 | -s "Read from client: 123 bytes read" \ | 
|  | 2798 | -S "Read from client: 1 bytes read" \ | 
|  | 2799 | -S "122 bytes read" | 
|  | 2800 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2801 | # Tests for Session Tickets | 
|  | 2802 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2804 | run_test    "Session resume using tickets: basic" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2805 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 2806 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2807 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2808 | -c "client hello, adding session ticket extension" \ | 
|  | 2809 | -s "found session ticket extension" \ | 
|  | 2810 | -s "server hello, adding session ticket extension" \ | 
|  | 2811 | -c "found session_ticket extension" \ | 
|  | 2812 | -c "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2813 | -S "session successfully restored from cache" \ | 
|  | 2814 | -s "session successfully restored from ticket" \ | 
|  | 2815 | -s "a session has been resumed" \ | 
|  | 2816 | -c "a session has been resumed" | 
|  | 2817 |  | 
| Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 2818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 2819 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 2820 | run_test    "Session resume using tickets: manual rotation" \ | 
|  | 2821 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ | 
|  | 2822 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2823 | 0 \ | 
|  | 2824 | -c "client hello, adding session ticket extension" \ | 
|  | 2825 | -s "found session ticket extension" \ | 
|  | 2826 | -s "server hello, adding session ticket extension" \ | 
|  | 2827 | -c "found session_ticket extension" \ | 
|  | 2828 | -c "parse new session ticket" \ | 
|  | 2829 | -S "session successfully restored from cache" \ | 
|  | 2830 | -s "session successfully restored from ticket" \ | 
|  | 2831 | -s "a session has been resumed" \ | 
|  | 2832 | -c "a session has been resumed" | 
|  | 2833 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2835 | run_test    "Session resume using tickets: cache disabled" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2836 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 2837 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2838 | 0 \ | 
|  | 2839 | -c "client hello, adding session ticket extension" \ | 
|  | 2840 | -s "found session ticket extension" \ | 
|  | 2841 | -s "server hello, adding session ticket extension" \ | 
|  | 2842 | -c "found session_ticket extension" \ | 
|  | 2843 | -c "parse new session ticket" \ | 
|  | 2844 | -S "session successfully restored from cache" \ | 
|  | 2845 | -s "session successfully restored from ticket" \ | 
|  | 2846 | -s "a session has been resumed" \ | 
|  | 2847 | -c "a session has been resumed" | 
|  | 2848 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2850 | run_test    "Session resume using tickets: timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2851 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ | 
|  | 2852 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_delay=2" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2853 | 0 \ | 
|  | 2854 | -c "client hello, adding session ticket extension" \ | 
|  | 2855 | -s "found session ticket extension" \ | 
|  | 2856 | -s "server hello, adding session ticket extension" \ | 
|  | 2857 | -c "found session_ticket extension" \ | 
|  | 2858 | -c "parse new session ticket" \ | 
|  | 2859 | -S "session successfully restored from cache" \ | 
|  | 2860 | -S "session successfully restored from ticket" \ | 
|  | 2861 | -S "a session has been resumed" \ | 
|  | 2862 | -C "a session has been resumed" | 
|  | 2863 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2865 | run_test    "Session resume using tickets: session copy" \ | 
|  | 2866 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 2867 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ | 
|  | 2868 | 0 \ | 
|  | 2869 | -c "client hello, adding session ticket extension" \ | 
|  | 2870 | -s "found session ticket extension" \ | 
|  | 2871 | -s "server hello, adding session ticket extension" \ | 
|  | 2872 | -c "found session_ticket extension" \ | 
|  | 2873 | -c "parse new session ticket" \ | 
|  | 2874 | -S "session successfully restored from cache" \ | 
|  | 2875 | -s "session successfully restored from ticket" \ | 
|  | 2876 | -s "a session has been resumed" \ | 
|  | 2877 | -c "a session has been resumed" | 
|  | 2878 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2880 | run_test    "Session resume using tickets: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2881 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2882 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2883 | 0 \ | 
|  | 2884 | -c "client hello, adding session ticket extension" \ | 
|  | 2885 | -c "found session_ticket extension" \ | 
|  | 2886 | -c "parse new session ticket" \ | 
|  | 2887 | -c "a session has been resumed" | 
|  | 2888 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2890 | run_test    "Session resume using tickets: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2891 | "$P_SRV debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2892 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 2893 | $O_CLI -sess_in $SESSION; \ | 
|  | 2894 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2895 | 0 \ | 
|  | 2896 | -s "found session ticket extension" \ | 
|  | 2897 | -s "server hello, adding session ticket extension" \ | 
|  | 2898 | -S "session successfully restored from cache" \ | 
|  | 2899 | -s "session successfully restored from ticket" \ | 
|  | 2900 | -s "a session has been resumed" | 
|  | 2901 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2903 | run_test    "Session resume using tickets: AES-128-GCM" \ | 
|  | 2904 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ | 
|  | 2905 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2906 | 0 \ | 
|  | 2907 | -c "client hello, adding session ticket extension" \ | 
|  | 2908 | -s "found session ticket extension" \ | 
|  | 2909 | -s "server hello, adding session ticket extension" \ | 
|  | 2910 | -c "found session_ticket extension" \ | 
|  | 2911 | -c "parse new session ticket" \ | 
|  | 2912 | -S "session successfully restored from cache" \ | 
|  | 2913 | -s "session successfully restored from ticket" \ | 
|  | 2914 | -s "a session has been resumed" \ | 
|  | 2915 | -c "a session has been resumed" | 
|  | 2916 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2918 | run_test    "Session resume using tickets: AES-192-GCM" \ | 
|  | 2919 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ | 
|  | 2920 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2921 | 0 \ | 
|  | 2922 | -c "client hello, adding session ticket extension" \ | 
|  | 2923 | -s "found session ticket extension" \ | 
|  | 2924 | -s "server hello, adding session ticket extension" \ | 
|  | 2925 | -c "found session_ticket extension" \ | 
|  | 2926 | -c "parse new session ticket" \ | 
|  | 2927 | -S "session successfully restored from cache" \ | 
|  | 2928 | -s "session successfully restored from ticket" \ | 
|  | 2929 | -s "a session has been resumed" \ | 
|  | 2930 | -c "a session has been resumed" | 
|  | 2931 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2933 | run_test    "Session resume using tickets: AES-128-CCM" \ | 
|  | 2934 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ | 
|  | 2935 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2936 | 0 \ | 
|  | 2937 | -c "client hello, adding session ticket extension" \ | 
|  | 2938 | -s "found session ticket extension" \ | 
|  | 2939 | -s "server hello, adding session ticket extension" \ | 
|  | 2940 | -c "found session_ticket extension" \ | 
|  | 2941 | -c "parse new session ticket" \ | 
|  | 2942 | -S "session successfully restored from cache" \ | 
|  | 2943 | -s "session successfully restored from ticket" \ | 
|  | 2944 | -s "a session has been resumed" \ | 
|  | 2945 | -c "a session has been resumed" | 
|  | 2946 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2948 | run_test    "Session resume using tickets: AES-192-CCM" \ | 
|  | 2949 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ | 
|  | 2950 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2951 | 0 \ | 
|  | 2952 | -c "client hello, adding session ticket extension" \ | 
|  | 2953 | -s "found session ticket extension" \ | 
|  | 2954 | -s "server hello, adding session ticket extension" \ | 
|  | 2955 | -c "found session_ticket extension" \ | 
|  | 2956 | -c "parse new session ticket" \ | 
|  | 2957 | -S "session successfully restored from cache" \ | 
|  | 2958 | -s "session successfully restored from ticket" \ | 
|  | 2959 | -s "a session has been resumed" \ | 
|  | 2960 | -c "a session has been resumed" | 
|  | 2961 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2963 | run_test    "Session resume using tickets: AES-256-CCM" \ | 
|  | 2964 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ | 
|  | 2965 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2966 | 0 \ | 
|  | 2967 | -c "client hello, adding session ticket extension" \ | 
|  | 2968 | -s "found session ticket extension" \ | 
|  | 2969 | -s "server hello, adding session ticket extension" \ | 
|  | 2970 | -c "found session_ticket extension" \ | 
|  | 2971 | -c "parse new session ticket" \ | 
|  | 2972 | -S "session successfully restored from cache" \ | 
|  | 2973 | -s "session successfully restored from ticket" \ | 
|  | 2974 | -s "a session has been resumed" \ | 
|  | 2975 | -c "a session has been resumed" | 
|  | 2976 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2978 | run_test    "Session resume using tickets: CAMELLIA-128-CCM" \ | 
|  | 2979 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ | 
|  | 2980 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2981 | 0 \ | 
|  | 2982 | -c "client hello, adding session ticket extension" \ | 
|  | 2983 | -s "found session ticket extension" \ | 
|  | 2984 | -s "server hello, adding session ticket extension" \ | 
|  | 2985 | -c "found session_ticket extension" \ | 
|  | 2986 | -c "parse new session ticket" \ | 
|  | 2987 | -S "session successfully restored from cache" \ | 
|  | 2988 | -s "session successfully restored from ticket" \ | 
|  | 2989 | -s "a session has been resumed" \ | 
|  | 2990 | -c "a session has been resumed" | 
|  | 2991 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2993 | run_test    "Session resume using tickets: CAMELLIA-192-CCM" \ | 
|  | 2994 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ | 
|  | 2995 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2996 | 0 \ | 
|  | 2997 | -c "client hello, adding session ticket extension" \ | 
|  | 2998 | -s "found session ticket extension" \ | 
|  | 2999 | -s "server hello, adding session ticket extension" \ | 
|  | 3000 | -c "found session_ticket extension" \ | 
|  | 3001 | -c "parse new session ticket" \ | 
|  | 3002 | -S "session successfully restored from cache" \ | 
|  | 3003 | -s "session successfully restored from ticket" \ | 
|  | 3004 | -s "a session has been resumed" \ | 
|  | 3005 | -c "a session has been resumed" | 
|  | 3006 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3008 | run_test    "Session resume using tickets: CAMELLIA-256-CCM" \ | 
|  | 3009 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ | 
|  | 3010 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 3011 | 0 \ | 
|  | 3012 | -c "client hello, adding session ticket extension" \ | 
|  | 3013 | -s "found session ticket extension" \ | 
|  | 3014 | -s "server hello, adding session ticket extension" \ | 
|  | 3015 | -c "found session_ticket extension" \ | 
|  | 3016 | -c "parse new session ticket" \ | 
|  | 3017 | -S "session successfully restored from cache" \ | 
|  | 3018 | -s "session successfully restored from ticket" \ | 
|  | 3019 | -s "a session has been resumed" \ | 
|  | 3020 | -c "a session has been resumed" | 
|  | 3021 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3023 | run_test    "Session resume using tickets: ARIA-128-GCM" \ | 
|  | 3024 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ | 
|  | 3025 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 3026 | 0 \ | 
|  | 3027 | -c "client hello, adding session ticket extension" \ | 
|  | 3028 | -s "found session ticket extension" \ | 
|  | 3029 | -s "server hello, adding session ticket extension" \ | 
|  | 3030 | -c "found session_ticket extension" \ | 
|  | 3031 | -c "parse new session ticket" \ | 
|  | 3032 | -S "session successfully restored from cache" \ | 
|  | 3033 | -s "session successfully restored from ticket" \ | 
|  | 3034 | -s "a session has been resumed" \ | 
|  | 3035 | -c "a session has been resumed" | 
|  | 3036 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3038 | run_test    "Session resume using tickets: ARIA-192-GCM" \ | 
|  | 3039 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ | 
|  | 3040 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 3041 | 0 \ | 
|  | 3042 | -c "client hello, adding session ticket extension" \ | 
|  | 3043 | -s "found session ticket extension" \ | 
|  | 3044 | -s "server hello, adding session ticket extension" \ | 
|  | 3045 | -c "found session_ticket extension" \ | 
|  | 3046 | -c "parse new session ticket" \ | 
|  | 3047 | -S "session successfully restored from cache" \ | 
|  | 3048 | -s "session successfully restored from ticket" \ | 
|  | 3049 | -s "a session has been resumed" \ | 
|  | 3050 | -c "a session has been resumed" | 
|  | 3051 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3053 | run_test    "Session resume using tickets: ARIA-256-GCM" \ | 
|  | 3054 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ | 
|  | 3055 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 3056 | 0 \ | 
|  | 3057 | -c "client hello, adding session ticket extension" \ | 
|  | 3058 | -s "found session ticket extension" \ | 
|  | 3059 | -s "server hello, adding session ticket extension" \ | 
|  | 3060 | -c "found session_ticket extension" \ | 
|  | 3061 | -c "parse new session ticket" \ | 
|  | 3062 | -S "session successfully restored from cache" \ | 
|  | 3063 | -s "session successfully restored from ticket" \ | 
|  | 3064 | -s "a session has been resumed" \ | 
|  | 3065 | -c "a session has been resumed" | 
|  | 3066 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3068 | run_test    "Session resume using tickets: ARIA-128-CCM" \ | 
|  | 3069 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ | 
|  | 3070 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 3071 | 0 \ | 
|  | 3072 | -c "client hello, adding session ticket extension" \ | 
|  | 3073 | -s "found session ticket extension" \ | 
|  | 3074 | -s "server hello, adding session ticket extension" \ | 
|  | 3075 | -c "found session_ticket extension" \ | 
|  | 3076 | -c "parse new session ticket" \ | 
|  | 3077 | -S "session successfully restored from cache" \ | 
|  | 3078 | -s "session successfully restored from ticket" \ | 
|  | 3079 | -s "a session has been resumed" \ | 
|  | 3080 | -c "a session has been resumed" | 
|  | 3081 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3083 | run_test    "Session resume using tickets: ARIA-192-CCM" \ | 
|  | 3084 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ | 
|  | 3085 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 3086 | 0 \ | 
|  | 3087 | -c "client hello, adding session ticket extension" \ | 
|  | 3088 | -s "found session ticket extension" \ | 
|  | 3089 | -s "server hello, adding session ticket extension" \ | 
|  | 3090 | -c "found session_ticket extension" \ | 
|  | 3091 | -c "parse new session ticket" \ | 
|  | 3092 | -S "session successfully restored from cache" \ | 
|  | 3093 | -s "session successfully restored from ticket" \ | 
|  | 3094 | -s "a session has been resumed" \ | 
|  | 3095 | -c "a session has been resumed" | 
|  | 3096 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3098 | run_test    "Session resume using tickets: ARIA-256-CCM" \ | 
|  | 3099 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ | 
|  | 3100 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
|  | 3101 | 0 \ | 
|  | 3102 | -c "client hello, adding session ticket extension" \ | 
|  | 3103 | -s "found session ticket extension" \ | 
|  | 3104 | -s "server hello, adding session ticket extension" \ | 
|  | 3105 | -c "found session_ticket extension" \ | 
|  | 3106 | -c "parse new session ticket" \ | 
|  | 3107 | -S "session successfully restored from cache" \ | 
|  | 3108 | -s "session successfully restored from ticket" \ | 
|  | 3109 | -s "a session has been resumed" \ | 
|  | 3110 | -c "a session has been resumed" | 
|  | 3111 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3112 | # Tests for Session Tickets with DTLS | 
|  | 3113 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3115 | run_test    "Session resume using tickets, DTLS: basic" \ | 
|  | 3116 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3117 | "$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] | 3118 | 0 \ | 
|  | 3119 | -c "client hello, adding session ticket extension" \ | 
|  | 3120 | -s "found session ticket extension" \ | 
|  | 3121 | -s "server hello, adding session ticket extension" \ | 
|  | 3122 | -c "found session_ticket extension" \ | 
|  | 3123 | -c "parse new session ticket" \ | 
|  | 3124 | -S "session successfully restored from cache" \ | 
|  | 3125 | -s "session successfully restored from ticket" \ | 
|  | 3126 | -s "a session has been resumed" \ | 
|  | 3127 | -c "a session has been resumed" | 
|  | 3128 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3130 | run_test    "Session resume using tickets, DTLS: cache disabled" \ | 
|  | 3131 | "$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] | 3132 | "$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] | 3133 | 0 \ | 
|  | 3134 | -c "client hello, adding session ticket extension" \ | 
|  | 3135 | -s "found session ticket extension" \ | 
|  | 3136 | -s "server hello, adding session ticket extension" \ | 
|  | 3137 | -c "found session_ticket extension" \ | 
|  | 3138 | -c "parse new session ticket" \ | 
|  | 3139 | -S "session successfully restored from cache" \ | 
|  | 3140 | -s "session successfully restored from ticket" \ | 
|  | 3141 | -s "a session has been resumed" \ | 
|  | 3142 | -c "a session has been resumed" | 
|  | 3143 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3145 | run_test    "Session resume using tickets, DTLS: timeout" \ | 
|  | 3146 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3147 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2" \ | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3148 | 0 \ | 
|  | 3149 | -c "client hello, adding session ticket extension" \ | 
|  | 3150 | -s "found session ticket extension" \ | 
|  | 3151 | -s "server hello, adding session ticket extension" \ | 
|  | 3152 | -c "found session_ticket extension" \ | 
|  | 3153 | -c "parse new session ticket" \ | 
|  | 3154 | -S "session successfully restored from cache" \ | 
|  | 3155 | -S "session successfully restored from ticket" \ | 
|  | 3156 | -S "a session has been resumed" \ | 
|  | 3157 | -C "a session has been resumed" | 
|  | 3158 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3160 | run_test    "Session resume using tickets, DTLS: session copy" \ | 
|  | 3161 | "$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] | 3162 | "$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] | 3163 | 0 \ | 
|  | 3164 | -c "client hello, adding session ticket extension" \ | 
|  | 3165 | -s "found session ticket extension" \ | 
|  | 3166 | -s "server hello, adding session ticket extension" \ | 
|  | 3167 | -c "found session_ticket extension" \ | 
|  | 3168 | -c "parse new session ticket" \ | 
|  | 3169 | -S "session successfully restored from cache" \ | 
|  | 3170 | -s "session successfully restored from ticket" \ | 
|  | 3171 | -s "a session has been resumed" \ | 
|  | 3172 | -c "a session has been resumed" | 
|  | 3173 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3175 | run_test    "Session resume using tickets, DTLS: openssl server" \ | 
|  | 3176 | "$O_SRV -dtls" \ | 
|  | 3177 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ | 
|  | 3178 | 0 \ | 
|  | 3179 | -c "client hello, adding session ticket extension" \ | 
|  | 3180 | -c "found session_ticket extension" \ | 
|  | 3181 | -c "parse new session ticket" \ | 
|  | 3182 | -c "a session has been resumed" | 
|  | 3183 |  | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3184 | # 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] | 3185 | # 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] | 3186 | requires_openssl_next | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3188 | run_test    "Session resume using tickets, DTLS: openssl client" \ | 
|  | 3189 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3190 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ | 
|  | 3191 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3192 | rm -f $SESSION )" \ | 
|  | 3193 | 0 \ | 
|  | 3194 | -s "found session ticket extension" \ | 
|  | 3195 | -s "server hello, adding session ticket extension" \ | 
|  | 3196 | -S "session successfully restored from cache" \ | 
|  | 3197 | -s "session successfully restored from ticket" \ | 
|  | 3198 | -s "a session has been resumed" | 
|  | 3199 |  | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3200 | # Tests for Session Resume based on session-ID and cache | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3201 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3203 | run_test    "Session resume using cache: tickets enabled on client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3204 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 3205 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3206 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3207 | -c "client hello, adding session ticket extension" \ | 
|  | 3208 | -s "found session ticket extension" \ | 
|  | 3209 | -S "server hello, adding session ticket extension" \ | 
|  | 3210 | -C "found session_ticket extension" \ | 
|  | 3211 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3212 | -s "session successfully restored from cache" \ | 
|  | 3213 | -S "session successfully restored from ticket" \ | 
|  | 3214 | -s "a session has been resumed" \ | 
|  | 3215 | -c "a session has been resumed" | 
|  | 3216 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3218 | run_test    "Session resume using cache: tickets enabled on server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3219 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 3220 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3221 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3222 | -C "client hello, adding session ticket extension" \ | 
|  | 3223 | -S "found session ticket extension" \ | 
|  | 3224 | -S "server hello, adding session ticket extension" \ | 
|  | 3225 | -C "found session_ticket extension" \ | 
|  | 3226 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3227 | -s "session successfully restored from cache" \ | 
|  | 3228 | -S "session successfully restored from ticket" \ | 
|  | 3229 | -s "a session has been resumed" \ | 
|  | 3230 | -c "a session has been resumed" | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3231 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3233 | run_test    "Session resume using cache: cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3234 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ | 
|  | 3235 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3236 | 0 \ | 
|  | 3237 | -S "session successfully restored from cache" \ | 
|  | 3238 | -S "session successfully restored from ticket" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3239 | -S "a session has been resumed" \ | 
|  | 3240 | -C "a session has been resumed" | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3241 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3243 | run_test    "Session resume using cache: cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3244 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ | 
|  | 3245 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3246 | 0 \ | 
|  | 3247 | -s "session successfully restored from cache" \ | 
|  | 3248 | -S "session successfully restored from ticket" \ | 
|  | 3249 | -s "a session has been resumed" \ | 
|  | 3250 | -c "a session has been resumed" | 
|  | 3251 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3253 | run_test    "Session resume using cache: timeout > delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3254 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 3255 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3256 | 0 \ | 
|  | 3257 | -s "session successfully restored from cache" \ | 
|  | 3258 | -S "session successfully restored from ticket" \ | 
|  | 3259 | -s "a session has been resumed" \ | 
|  | 3260 | -c "a session has been resumed" | 
|  | 3261 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3263 | run_test    "Session resume using cache: timeout < delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3264 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ | 
|  | 3265 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3266 | 0 \ | 
|  | 3267 | -S "session successfully restored from cache" \ | 
|  | 3268 | -S "session successfully restored from ticket" \ | 
|  | 3269 | -S "a session has been resumed" \ | 
|  | 3270 | -C "a session has been resumed" | 
|  | 3271 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3273 | run_test    "Session resume using cache: no timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3274 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ | 
|  | 3275 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3276 | 0 \ | 
|  | 3277 | -s "session successfully restored from cache" \ | 
|  | 3278 | -S "session successfully restored from ticket" \ | 
|  | 3279 | -s "a session has been resumed" \ | 
|  | 3280 | -c "a session has been resumed" | 
|  | 3281 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3283 | run_test    "Session resume using cache: session copy" \ | 
|  | 3284 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 3285 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ | 
|  | 3286 | 0 \ | 
|  | 3287 | -s "session successfully restored from cache" \ | 
|  | 3288 | -S "session successfully restored from ticket" \ | 
|  | 3289 | -s "a session has been resumed" \ | 
|  | 3290 | -c "a session has been resumed" | 
|  | 3291 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3293 | run_test    "Session resume using cache: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3294 | "$P_SRV debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3295 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 3296 | $O_CLI -sess_in $SESSION; \ | 
|  | 3297 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3298 | 0 \ | 
|  | 3299 | -s "found session ticket extension" \ | 
|  | 3300 | -S "server hello, adding session ticket extension" \ | 
|  | 3301 | -s "session successfully restored from cache" \ | 
|  | 3302 | -S "session successfully restored from ticket" \ | 
|  | 3303 | -s "a session has been resumed" | 
|  | 3304 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3306 | run_test    "Session resume using cache: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3307 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3308 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3309 | 0 \ | 
|  | 3310 | -C "found session_ticket extension" \ | 
|  | 3311 | -C "parse new session ticket" \ | 
|  | 3312 | -c "a session has been resumed" | 
|  | 3313 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3314 | # Tests for Session Resume based on session-ID and cache, DTLS | 
|  | 3315 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3317 | run_test    "Session resume using cache, DTLS: tickets enabled on client" \ | 
|  | 3318 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3319 | "$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] | 3320 | 0 \ | 
|  | 3321 | -c "client hello, adding session ticket extension" \ | 
|  | 3322 | -s "found session ticket extension" \ | 
|  | 3323 | -S "server hello, adding session ticket extension" \ | 
|  | 3324 | -C "found session_ticket extension" \ | 
|  | 3325 | -C "parse new session ticket" \ | 
|  | 3326 | -s "session successfully restored from cache" \ | 
|  | 3327 | -S "session successfully restored from ticket" \ | 
|  | 3328 | -s "a session has been resumed" \ | 
|  | 3329 | -c "a session has been resumed" | 
|  | 3330 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3332 | run_test    "Session resume using cache, DTLS: tickets enabled on server" \ | 
|  | 3333 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3334 | "$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] | 3335 | 0 \ | 
|  | 3336 | -C "client hello, adding session ticket extension" \ | 
|  | 3337 | -S "found session ticket extension" \ | 
|  | 3338 | -S "server hello, adding session ticket extension" \ | 
|  | 3339 | -C "found session_ticket extension" \ | 
|  | 3340 | -C "parse new session ticket" \ | 
|  | 3341 | -s "session successfully restored from cache" \ | 
|  | 3342 | -S "session successfully restored from ticket" \ | 
|  | 3343 | -s "a session has been resumed" \ | 
|  | 3344 | -c "a session has been resumed" | 
|  | 3345 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3347 | run_test    "Session resume using cache, DTLS: cache_max=0" \ | 
|  | 3348 | "$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] | 3349 | "$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] | 3350 | 0 \ | 
|  | 3351 | -S "session successfully restored from cache" \ | 
|  | 3352 | -S "session successfully restored from ticket" \ | 
|  | 3353 | -S "a session has been resumed" \ | 
|  | 3354 | -C "a session has been resumed" | 
|  | 3355 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3357 | run_test    "Session resume using cache, DTLS: cache_max=1" \ | 
|  | 3358 | "$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] | 3359 | "$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] | 3360 | 0 \ | 
|  | 3361 | -s "session successfully restored from cache" \ | 
|  | 3362 | -S "session successfully restored from ticket" \ | 
|  | 3363 | -s "a session has been resumed" \ | 
|  | 3364 | -c "a session has been resumed" | 
|  | 3365 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3367 | run_test    "Session resume using cache, DTLS: timeout > delay" \ | 
|  | 3368 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3369 | "$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] | 3370 | 0 \ | 
|  | 3371 | -s "session successfully restored from cache" \ | 
|  | 3372 | -S "session successfully restored from ticket" \ | 
|  | 3373 | -s "a session has been resumed" \ | 
|  | 3374 | -c "a session has been resumed" | 
|  | 3375 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3377 | run_test    "Session resume using cache, DTLS: timeout < delay" \ | 
|  | 3378 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3379 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \ | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3380 | 0 \ | 
|  | 3381 | -S "session successfully restored from cache" \ | 
|  | 3382 | -S "session successfully restored from ticket" \ | 
|  | 3383 | -S "a session has been resumed" \ | 
|  | 3384 | -C "a session has been resumed" | 
|  | 3385 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3387 | run_test    "Session resume using cache, DTLS: no timeout" \ | 
|  | 3388 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3389 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \ | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3390 | 0 \ | 
|  | 3391 | -s "session successfully restored from cache" \ | 
|  | 3392 | -S "session successfully restored from ticket" \ | 
|  | 3393 | -s "a session has been resumed" \ | 
|  | 3394 | -c "a session has been resumed" | 
|  | 3395 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3397 | run_test    "Session resume using cache, DTLS: session copy" \ | 
|  | 3398 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3399 | "$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] | 3400 | 0 \ | 
|  | 3401 | -s "session successfully restored from cache" \ | 
|  | 3402 | -S "session successfully restored from ticket" \ | 
|  | 3403 | -s "a session has been resumed" \ | 
|  | 3404 | -c "a session has been resumed" | 
|  | 3405 |  | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3406 | # 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] | 3407 | # 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] | 3408 | requires_openssl_next | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3410 | run_test    "Session resume using cache, DTLS: openssl client" \ | 
|  | 3411 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3412 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ | 
|  | 3413 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3414 | rm -f $SESSION )" \ | 
|  | 3415 | 0 \ | 
|  | 3416 | -s "found session ticket extension" \ | 
|  | 3417 | -S "server hello, adding session ticket extension" \ | 
|  | 3418 | -s "session successfully restored from cache" \ | 
|  | 3419 | -S "session successfully restored from ticket" \ | 
|  | 3420 | -s "a session has been resumed" | 
|  | 3421 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3423 | run_test    "Session resume using cache, DTLS: openssl server" \ | 
|  | 3424 | "$O_SRV -dtls" \ | 
|  | 3425 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ | 
|  | 3426 | 0 \ | 
|  | 3427 | -C "found session_ticket extension" \ | 
|  | 3428 | -C "parse new session ticket" \ | 
|  | 3429 | -c "a session has been resumed" | 
|  | 3430 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3431 | # Tests for Max Fragment Length extension | 
|  | 3432 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3433 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3435 | run_test    "Max fragment length: enabled, default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3436 | "$P_SRV debug_level=3" \ | 
|  | 3437 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3438 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3439 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3440 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3441 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3442 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3443 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 3444 | -S "found max fragment length extension" \ | 
|  | 3445 | -S "server hello, max_fragment_length extension" \ | 
|  | 3446 | -C "found max_fragment_length extension" | 
|  | 3447 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3448 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3450 | run_test    "Max fragment length: enabled, default, larger message" \ | 
|  | 3451 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3452 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3453 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3454 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3455 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3456 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3457 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3458 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 3459 | -S "found max fragment length extension" \ | 
|  | 3460 | -S "server hello, max_fragment_length extension" \ | 
|  | 3461 | -C "found max_fragment_length extension" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3462 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 3463 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3464 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3465 |  | 
|  | 3466 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3468 | run_test    "Max fragment length, DTLS: enabled, default, larger message" \ | 
|  | 3469 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3470 | "$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] | 3471 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3472 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3473 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3474 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3475 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3476 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 3477 | -S "found max fragment length extension" \ | 
|  | 3478 | -S "server hello, max_fragment_length extension" \ | 
|  | 3479 | -C "found max_fragment_length extension" \ | 
|  | 3480 | -c "fragment larger than.*maximum " | 
|  | 3481 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3482 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled | 
|  | 3483 | # (session fragment length will be 16384 regardless of mbedtls | 
|  | 3484 | # content length configuration.) | 
|  | 3485 |  | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3486 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3488 | run_test    "Max fragment length: disabled, larger message" \ | 
|  | 3489 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3490 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3491 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3492 | -C "Maximum incoming record payload length is 16384" \ | 
|  | 3493 | -C "Maximum outgoing record payload length is 16384" \ | 
|  | 3494 | -S "Maximum incoming record payload length is 16384" \ | 
|  | 3495 | -S "Maximum outgoing record payload length is 16384" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3496 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 3497 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3498 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3499 |  | 
|  | 3500 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3502 | run_test    "Max fragment length, DTLS: disabled, larger message" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3503 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3504 | "$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] | 3505 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3506 | -C "Maximum incoming record payload length is 16384" \ | 
|  | 3507 | -C "Maximum outgoing record payload length is 16384" \ | 
|  | 3508 | -S "Maximum incoming record payload length is 16384" \ | 
|  | 3509 | -S "Maximum outgoing record payload length is 16384" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3510 | -c "fragment larger than.*maximum " | 
|  | 3511 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3512 | requires_max_content_len 4096 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3513 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3515 | run_test    "Max fragment length: used by client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3516 | "$P_SRV debug_level=3" \ | 
|  | 3517 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3518 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3519 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3520 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 3521 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 3522 | -s "Maximum outgoing record payload length is 4096" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3523 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3524 | -s "found max fragment length extension" \ | 
|  | 3525 | -s "server hello, max_fragment_length extension" \ | 
|  | 3526 | -c "found max_fragment_length extension" | 
|  | 3527 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3528 | requires_max_content_len 1024 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3529 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3531 | run_test    "Max fragment length: client 512, server 1024" \ | 
|  | 3532 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3533 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3534 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3535 | -c "Maximum incoming record payload length is 512" \ | 
|  | 3536 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 3537 | -s "Maximum incoming record payload length is 512" \ | 
|  | 3538 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3539 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3540 | -s "found max fragment length extension" \ | 
|  | 3541 | -s "server hello, max_fragment_length extension" \ | 
|  | 3542 | -c "found max_fragment_length extension" | 
|  | 3543 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3544 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3545 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3547 | run_test    "Max fragment length: client 512, server 2048" \ | 
|  | 3548 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3549 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3550 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3551 | -c "Maximum incoming record payload length is 512" \ | 
|  | 3552 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 3553 | -s "Maximum incoming record payload length is 512" \ | 
|  | 3554 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3555 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3556 | -s "found max fragment length extension" \ | 
|  | 3557 | -s "server hello, max_fragment_length extension" \ | 
|  | 3558 | -c "found max_fragment_length extension" | 
|  | 3559 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3560 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3561 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3563 | run_test    "Max fragment length: client 512, server 4096" \ | 
|  | 3564 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3565 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3566 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3567 | -c "Maximum incoming record payload length is 512" \ | 
|  | 3568 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 3569 | -s "Maximum incoming record payload length is 512" \ | 
|  | 3570 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3571 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3572 | -s "found max fragment length extension" \ | 
|  | 3573 | -s "server hello, max_fragment_length extension" \ | 
|  | 3574 | -c "found max_fragment_length extension" | 
|  | 3575 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3576 | requires_max_content_len 1024 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3577 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3579 | run_test    "Max fragment length: client 1024, server 512" \ | 
|  | 3580 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3581 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3582 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3583 | -c "Maximum incoming record payload length is 1024" \ | 
|  | 3584 | -c "Maximum outgoing record payload length is 1024" \ | 
|  | 3585 | -s "Maximum incoming record payload length is 1024" \ | 
|  | 3586 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3587 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3588 | -s "found max fragment length extension" \ | 
|  | 3589 | -s "server hello, max_fragment_length extension" \ | 
|  | 3590 | -c "found max_fragment_length extension" | 
|  | 3591 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3592 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3593 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3595 | run_test    "Max fragment length: client 1024, server 2048" \ | 
|  | 3596 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3597 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3598 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3599 | -c "Maximum incoming record payload length is 1024" \ | 
|  | 3600 | -c "Maximum outgoing record payload length is 1024" \ | 
|  | 3601 | -s "Maximum incoming record payload length is 1024" \ | 
|  | 3602 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3603 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3604 | -s "found max fragment length extension" \ | 
|  | 3605 | -s "server hello, max_fragment_length extension" \ | 
|  | 3606 | -c "found max_fragment_length extension" | 
|  | 3607 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3608 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3609 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3611 | run_test    "Max fragment length: client 1024, server 4096" \ | 
|  | 3612 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3613 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3614 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3615 | -c "Maximum incoming record payload length is 1024" \ | 
|  | 3616 | -c "Maximum outgoing record payload length is 1024" \ | 
|  | 3617 | -s "Maximum incoming record payload length is 1024" \ | 
|  | 3618 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3619 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3620 | -s "found max fragment length extension" \ | 
|  | 3621 | -s "server hello, max_fragment_length extension" \ | 
|  | 3622 | -c "found max_fragment_length extension" | 
|  | 3623 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3624 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3625 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3627 | run_test    "Max fragment length: client 2048, server 512" \ | 
|  | 3628 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3629 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3630 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3631 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3632 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3633 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3634 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3635 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3636 | -s "found max fragment length extension" \ | 
|  | 3637 | -s "server hello, max_fragment_length extension" \ | 
|  | 3638 | -c "found max_fragment_length extension" | 
|  | 3639 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3640 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3641 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3643 | run_test    "Max fragment length: client 2048, server 1024" \ | 
|  | 3644 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3645 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3646 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3647 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3648 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3649 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3650 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3651 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3652 | -s "found max fragment length extension" \ | 
|  | 3653 | -s "server hello, max_fragment_length extension" \ | 
|  | 3654 | -c "found max_fragment_length extension" | 
|  | 3655 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3656 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3657 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3659 | run_test    "Max fragment length: client 2048, server 4096" \ | 
|  | 3660 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3661 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3662 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3663 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3664 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3665 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3666 | -s "Maximum outgoing record payload length is 2048" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3667 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3668 | -s "found max fragment length extension" \ | 
|  | 3669 | -s "server hello, max_fragment_length extension" \ | 
|  | 3670 | -c "found max_fragment_length extension" | 
|  | 3671 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3672 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3673 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3675 | run_test    "Max fragment length: client 4096, server 512" \ | 
|  | 3676 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3677 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3678 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3679 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3680 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 3681 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 3682 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3683 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3684 | -s "found max fragment length extension" \ | 
|  | 3685 | -s "server hello, max_fragment_length extension" \ | 
|  | 3686 | -c "found max_fragment_length extension" | 
|  | 3687 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3688 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3689 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3691 | run_test    "Max fragment length: client 4096, server 1024" \ | 
|  | 3692 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3693 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3694 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3695 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3696 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 3697 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 3698 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3699 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3700 | -s "found max fragment length extension" \ | 
|  | 3701 | -s "server hello, max_fragment_length extension" \ | 
|  | 3702 | -c "found max_fragment_length extension" | 
|  | 3703 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3704 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3705 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3707 | run_test    "Max fragment length: client 4096, server 2048" \ | 
|  | 3708 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3709 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3710 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3711 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3712 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 3713 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 3714 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3715 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3716 | -s "found max fragment length extension" \ | 
|  | 3717 | -s "server hello, max_fragment_length extension" \ | 
|  | 3718 | -c "found max_fragment_length extension" | 
|  | 3719 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3720 | requires_max_content_len 4096 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3721 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3723 | run_test    "Max fragment length: used by server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3724 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3725 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3726 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3727 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3728 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3729 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3730 | -s "Maximum outgoing record payload length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3731 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 3732 | -S "found max fragment length extension" \ | 
|  | 3733 | -S "server hello, max_fragment_length extension" \ | 
|  | 3734 | -C "found max_fragment_length extension" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3735 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3736 | requires_max_content_len 4096 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3737 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3738 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3739 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3740 | run_test    "Max fragment length: gnutls server" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3741 | "$G_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3742 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3743 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3744 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3745 | -c "Maximum outgoing record payload length is 4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3746 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3747 | -c "found max_fragment_length extension" | 
|  | 3748 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3749 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3750 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3752 | run_test    "Max fragment length: client, message just fits" \ | 
|  | 3753 | "$P_SRV debug_level=3" \ | 
|  | 3754 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ | 
|  | 3755 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3756 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3757 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3758 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3759 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3760 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3761 | -s "found max fragment length extension" \ | 
|  | 3762 | -s "server hello, max_fragment_length extension" \ | 
|  | 3763 | -c "found max_fragment_length extension" \ | 
|  | 3764 | -c "2048 bytes written in 1 fragments" \ | 
|  | 3765 | -s "2048 bytes read" | 
|  | 3766 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3767 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3768 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3770 | run_test    "Max fragment length: client, larger message" \ | 
|  | 3771 | "$P_SRV debug_level=3" \ | 
|  | 3772 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ | 
|  | 3773 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3774 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3775 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3776 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3777 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3778 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3779 | -s "found max fragment length extension" \ | 
|  | 3780 | -s "server hello, max_fragment_length extension" \ | 
|  | 3781 | -c "found max_fragment_length extension" \ | 
|  | 3782 | -c "2345 bytes written in 2 fragments" \ | 
|  | 3783 | -s "2048 bytes read" \ | 
|  | 3784 | -s "297 bytes read" | 
|  | 3785 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3786 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3789 | run_test    "Max fragment length: DTLS client, larger message" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3790 | "$P_SRV debug_level=3 dtls=1" \ | 
|  | 3791 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ | 
|  | 3792 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3793 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3794 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3795 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3796 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3797 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3798 | -s "found max fragment length extension" \ | 
|  | 3799 | -s "server hello, max_fragment_length extension" \ | 
|  | 3800 | -c "found max_fragment_length extension" \ | 
|  | 3801 | -c "fragment larger than.*maximum" | 
|  | 3802 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3803 | # Tests for renegotiation | 
|  | 3804 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3805 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3807 | run_test    "Renegotiation: none, for reference" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3808 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3809 | "$P_CLI debug_level=3 exchanges=2" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3810 | 0 \ | 
|  | 3811 | -C "client hello, adding renegotiation extension" \ | 
|  | 3812 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3813 | -S "found renegotiation extension" \ | 
|  | 3814 | -s "server hello, secure renegotiation extension" \ | 
|  | 3815 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3816 | -C "=> renegotiate" \ | 
|  | 3817 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3818 | -S "write hello request" | 
|  | 3819 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3820 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3822 | run_test    "Renegotiation: client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3823 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3824 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3825 | 0 \ | 
|  | 3826 | -c "client hello, adding renegotiation extension" \ | 
|  | 3827 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3828 | -s "found renegotiation extension" \ | 
|  | 3829 | -s "server hello, secure renegotiation extension" \ | 
|  | 3830 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3831 | -c "=> renegotiate" \ | 
|  | 3832 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3833 | -S "write hello request" | 
|  | 3834 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3835 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3837 | run_test    "Renegotiation: server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3838 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3839 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3840 | 0 \ | 
|  | 3841 | -c "client hello, adding renegotiation extension" \ | 
|  | 3842 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3843 | -s "found renegotiation extension" \ | 
|  | 3844 | -s "server hello, secure renegotiation extension" \ | 
|  | 3845 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3846 | -c "=> renegotiate" \ | 
|  | 3847 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3848 | -s "write hello request" | 
|  | 3849 |  | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3850 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 3851 | # 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] | 3852 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3853 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3855 | run_test    "Renegotiation: Signature Algorithms parsing, client-initiated" \ | 
|  | 3856 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
|  | 3857 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 3858 | 0 \ | 
|  | 3859 | -c "client hello, adding renegotiation extension" \ | 
|  | 3860 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3861 | -s "found renegotiation extension" \ | 
|  | 3862 | -s "server hello, secure renegotiation extension" \ | 
|  | 3863 | -c "found renegotiation extension" \ | 
|  | 3864 | -c "=> renegotiate" \ | 
|  | 3865 | -s "=> renegotiate" \ | 
|  | 3866 | -S "write hello request" \ | 
|  | 3867 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 3868 |  | 
|  | 3869 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 3870 | # 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] | 3871 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3872 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3874 | run_test    "Renegotiation: Signature Algorithms parsing, server-initiated" \ | 
|  | 3875 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
|  | 3876 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 3877 | 0 \ | 
|  | 3878 | -c "client hello, adding renegotiation extension" \ | 
|  | 3879 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3880 | -s "found renegotiation extension" \ | 
|  | 3881 | -s "server hello, secure renegotiation extension" \ | 
|  | 3882 | -c "found renegotiation extension" \ | 
|  | 3883 | -c "=> renegotiate" \ | 
|  | 3884 | -s "=> renegotiate" \ | 
|  | 3885 | -s "write hello request" \ | 
|  | 3886 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 3887 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3888 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3890 | run_test    "Renegotiation: double" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3891 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3892 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3893 | 0 \ | 
|  | 3894 | -c "client hello, adding renegotiation extension" \ | 
|  | 3895 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3896 | -s "found renegotiation extension" \ | 
|  | 3897 | -s "server hello, secure renegotiation extension" \ | 
|  | 3898 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3899 | -c "=> renegotiate" \ | 
|  | 3900 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3901 | -s "write hello request" | 
|  | 3902 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3903 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3904 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3905 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3907 | run_test    "Renegotiation with max fragment length: client 2048, server 512" \ | 
|  | 3908 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ | 
|  | 3909 | "$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" \ | 
|  | 3910 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3911 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3912 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3913 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3914 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3915 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3916 | -s "found max fragment length extension" \ | 
|  | 3917 | -s "server hello, max_fragment_length extension" \ | 
|  | 3918 | -c "found max_fragment_length extension" \ | 
|  | 3919 | -c "client hello, adding renegotiation extension" \ | 
|  | 3920 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3921 | -s "found renegotiation extension" \ | 
|  | 3922 | -s "server hello, secure renegotiation extension" \ | 
|  | 3923 | -c "found renegotiation extension" \ | 
|  | 3924 | -c "=> renegotiate" \ | 
|  | 3925 | -s "=> renegotiate" \ | 
|  | 3926 | -s "write hello request" | 
|  | 3927 |  | 
|  | 3928 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3930 | run_test    "Renegotiation: client-initiated, server-rejected" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3931 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3932 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3933 | 1 \ | 
|  | 3934 | -c "client hello, adding renegotiation extension" \ | 
|  | 3935 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3936 | -S "found renegotiation extension" \ | 
|  | 3937 | -s "server hello, secure renegotiation extension" \ | 
|  | 3938 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3939 | -c "=> renegotiate" \ | 
|  | 3940 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3941 | -S "write hello request" \ | 
| Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3942 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3943 | -c "failed" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3944 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3945 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3947 | run_test    "Renegotiation: server-initiated, client-rejected, default" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3948 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3949 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3950 | 0 \ | 
|  | 3951 | -C "client hello, adding renegotiation extension" \ | 
|  | 3952 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3953 | -S "found renegotiation extension" \ | 
|  | 3954 | -s "server hello, secure renegotiation extension" \ | 
|  | 3955 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3956 | -C "=> renegotiate" \ | 
|  | 3957 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3958 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3959 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3960 | -S "failed" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3961 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3962 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3964 | run_test    "Renegotiation: server-initiated, client-rejected, not enforced" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3965 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3966 | renego_delay=-1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3967 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3968 | 0 \ | 
|  | 3969 | -C "client hello, adding renegotiation extension" \ | 
|  | 3970 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3971 | -S "found renegotiation extension" \ | 
|  | 3972 | -s "server hello, secure renegotiation extension" \ | 
|  | 3973 | -c "found renegotiation extension" \ | 
|  | 3974 | -C "=> renegotiate" \ | 
|  | 3975 | -S "=> renegotiate" \ | 
|  | 3976 | -s "write hello request" \ | 
|  | 3977 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3978 | -S "failed" | 
|  | 3979 |  | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3980 | # delay 2 for 1 alert record + 1 application data record | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3981 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3983 | run_test    "Renegotiation: server-initiated, client-rejected, delay 2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3984 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3985 | renego_delay=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3986 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3987 | 0 \ | 
|  | 3988 | -C "client hello, adding renegotiation extension" \ | 
|  | 3989 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3990 | -S "found renegotiation extension" \ | 
|  | 3991 | -s "server hello, secure renegotiation extension" \ | 
|  | 3992 | -c "found renegotiation extension" \ | 
|  | 3993 | -C "=> renegotiate" \ | 
|  | 3994 | -S "=> renegotiate" \ | 
|  | 3995 | -s "write hello request" \ | 
|  | 3996 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3997 | -S "failed" | 
|  | 3998 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4000 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4001 | run_test    "Renegotiation: server-initiated, client-rejected, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4002 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4003 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4004 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4005 | 0 \ | 
|  | 4006 | -C "client hello, adding renegotiation extension" \ | 
|  | 4007 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4008 | -S "found renegotiation extension" \ | 
|  | 4009 | -s "server hello, secure renegotiation extension" \ | 
|  | 4010 | -c "found renegotiation extension" \ | 
|  | 4011 | -C "=> renegotiate" \ | 
|  | 4012 | -S "=> renegotiate" \ | 
|  | 4013 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4014 | -s "SSL - An unexpected message was received from our peer" | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4015 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4016 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4018 | run_test    "Renegotiation: server-initiated, client-accepted, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4019 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4020 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4021 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4022 | 0 \ | 
|  | 4023 | -c "client hello, adding renegotiation extension" \ | 
|  | 4024 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4025 | -s "found renegotiation extension" \ | 
|  | 4026 | -s "server hello, secure renegotiation extension" \ | 
|  | 4027 | -c "found renegotiation extension" \ | 
|  | 4028 | -c "=> renegotiate" \ | 
|  | 4029 | -s "=> renegotiate" \ | 
|  | 4030 | -s "write hello request" \ | 
|  | 4031 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4032 | -S "failed" | 
|  | 4033 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4036 | run_test    "Renegotiation: periodic, just below period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4037 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4038 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 4039 | 0 \ | 
|  | 4040 | -C "client hello, adding renegotiation extension" \ | 
|  | 4041 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4042 | -S "found renegotiation extension" \ | 
|  | 4043 | -s "server hello, secure renegotiation extension" \ | 
|  | 4044 | -c "found renegotiation extension" \ | 
|  | 4045 | -S "record counter limit reached: renegotiate" \ | 
|  | 4046 | -C "=> renegotiate" \ | 
|  | 4047 | -S "=> renegotiate" \ | 
|  | 4048 | -S "write hello request" \ | 
|  | 4049 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4050 | -S "failed" | 
|  | 4051 |  | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4052 | # one extra exchange to be able to complete renego | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4053 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4055 | run_test    "Renegotiation: periodic, just above period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4056 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4057 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4058 | 0 \ | 
|  | 4059 | -c "client hello, adding renegotiation extension" \ | 
|  | 4060 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4061 | -s "found renegotiation extension" \ | 
|  | 4062 | -s "server hello, secure renegotiation extension" \ | 
|  | 4063 | -c "found renegotiation extension" \ | 
|  | 4064 | -s "record counter limit reached: renegotiate" \ | 
|  | 4065 | -c "=> renegotiate" \ | 
|  | 4066 | -s "=> renegotiate" \ | 
|  | 4067 | -s "write hello request" \ | 
|  | 4068 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4069 | -S "failed" | 
|  | 4070 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4071 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4073 | run_test    "Renegotiation: periodic, two times period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4074 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4075 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4076 | 0 \ | 
|  | 4077 | -c "client hello, adding renegotiation extension" \ | 
|  | 4078 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4079 | -s "found renegotiation extension" \ | 
|  | 4080 | -s "server hello, secure renegotiation extension" \ | 
|  | 4081 | -c "found renegotiation extension" \ | 
|  | 4082 | -s "record counter limit reached: renegotiate" \ | 
|  | 4083 | -c "=> renegotiate" \ | 
|  | 4084 | -s "=> renegotiate" \ | 
|  | 4085 | -s "write hello request" \ | 
|  | 4086 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4087 | -S "failed" | 
|  | 4088 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4089 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4091 | run_test    "Renegotiation: periodic, above period, disabled" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4092 | "$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4093 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
|  | 4094 | 0 \ | 
|  | 4095 | -C "client hello, adding renegotiation extension" \ | 
|  | 4096 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4097 | -S "found renegotiation extension" \ | 
|  | 4098 | -s "server hello, secure renegotiation extension" \ | 
|  | 4099 | -c "found renegotiation extension" \ | 
|  | 4100 | -S "record counter limit reached: renegotiate" \ | 
|  | 4101 | -C "=> renegotiate" \ | 
|  | 4102 | -S "=> renegotiate" \ | 
|  | 4103 | -S "write hello request" \ | 
|  | 4104 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 4105 | -S "failed" | 
|  | 4106 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4107 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4109 | run_test    "Renegotiation: nbio, client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4110 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4111 | "$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ | 
| Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 4112 | 0 \ | 
|  | 4113 | -c "client hello, adding renegotiation extension" \ | 
|  | 4114 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4115 | -s "found renegotiation extension" \ | 
|  | 4116 | -s "server hello, secure renegotiation extension" \ | 
|  | 4117 | -c "found renegotiation extension" \ | 
|  | 4118 | -c "=> renegotiate" \ | 
|  | 4119 | -s "=> renegotiate" \ | 
|  | 4120 | -S "write hello request" | 
|  | 4121 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4122 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4124 | run_test    "Renegotiation: nbio, server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4125 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4126 | "$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] | 4127 | 0 \ | 
|  | 4128 | -c "client hello, adding renegotiation extension" \ | 
|  | 4129 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4130 | -s "found renegotiation extension" \ | 
|  | 4131 | -s "server hello, secure renegotiation extension" \ | 
|  | 4132 | -c "found renegotiation extension" \ | 
|  | 4133 | -c "=> renegotiate" \ | 
|  | 4134 | -s "=> renegotiate" \ | 
|  | 4135 | -s "write hello request" | 
|  | 4136 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4137 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4139 | run_test    "Renegotiation: openssl server, client-initiated" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4140 | "$O_SRV -www" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4141 | "$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] | 4142 | 0 \ | 
|  | 4143 | -c "client hello, adding renegotiation extension" \ | 
|  | 4144 | -c "found renegotiation extension" \ | 
|  | 4145 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4146 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4147 | -C "error" \ | 
|  | 4148 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 4149 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4150 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4151 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4153 | run_test    "Renegotiation: gnutls server strict, client-initiated" \ | 
|  | 4154 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4155 | "$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] | 4156 | 0 \ | 
|  | 4157 | -c "client hello, adding renegotiation extension" \ | 
|  | 4158 | -c "found renegotiation extension" \ | 
|  | 4159 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4160 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4161 | -C "error" \ | 
|  | 4162 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 4163 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4164 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4165 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4167 | run_test    "Renegotiation: gnutls server unsafe, client-initiated default" \ | 
|  | 4168 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 4169 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 4170 | 1 \ | 
|  | 4171 | -c "client hello, adding renegotiation extension" \ | 
|  | 4172 | -C "found renegotiation extension" \ | 
|  | 4173 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4174 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4175 | -c "error" \ | 
|  | 4176 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 4177 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4178 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4179 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4181 | run_test    "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ | 
|  | 4182 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 4183 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 4184 | allow_legacy=0" \ | 
|  | 4185 | 1 \ | 
|  | 4186 | -c "client hello, adding renegotiation extension" \ | 
|  | 4187 | -C "found renegotiation extension" \ | 
|  | 4188 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4189 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4190 | -c "error" \ | 
|  | 4191 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 4192 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4193 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4194 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4196 | run_test    "Renegotiation: gnutls server unsafe, client-inititated legacy" \ | 
|  | 4197 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 4198 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 4199 | allow_legacy=1" \ | 
|  | 4200 | 0 \ | 
|  | 4201 | -c "client hello, adding renegotiation extension" \ | 
|  | 4202 | -C "found renegotiation extension" \ | 
|  | 4203 | -c "=> renegotiate" \ | 
|  | 4204 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4205 | -C "error" \ | 
|  | 4206 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 4207 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4210 | run_test    "Renegotiation: DTLS, client-initiated" \ | 
|  | 4211 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ | 
|  | 4212 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 4213 | 0 \ | 
|  | 4214 | -c "client hello, adding renegotiation extension" \ | 
|  | 4215 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4216 | -s "found renegotiation extension" \ | 
|  | 4217 | -s "server hello, secure renegotiation extension" \ | 
|  | 4218 | -c "found renegotiation extension" \ | 
|  | 4219 | -c "=> renegotiate" \ | 
|  | 4220 | -s "=> renegotiate" \ | 
|  | 4221 | -S "write hello request" | 
|  | 4222 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4223 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4225 | run_test    "Renegotiation: DTLS, server-initiated" \ | 
|  | 4226 | "$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] | 4227 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ | 
|  | 4228 | read_timeout=1000 max_resend=2" \ | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4229 | 0 \ | 
|  | 4230 | -c "client hello, adding renegotiation extension" \ | 
|  | 4231 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4232 | -s "found renegotiation extension" \ | 
|  | 4233 | -s "server hello, secure renegotiation extension" \ | 
|  | 4234 | -c "found renegotiation extension" \ | 
|  | 4235 | -c "=> renegotiate" \ | 
|  | 4236 | -s "=> renegotiate" \ | 
|  | 4237 | -s "write hello request" | 
|  | 4238 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4241 | run_test    "Renegotiation: DTLS, renego_period overflow" \ | 
|  | 4242 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ | 
|  | 4243 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ | 
|  | 4244 | 0 \ | 
|  | 4245 | -c "client hello, adding renegotiation extension" \ | 
|  | 4246 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 4247 | -s "found renegotiation extension" \ | 
|  | 4248 | -s "server hello, secure renegotiation extension" \ | 
|  | 4249 | -s "record counter limit reached: renegotiate" \ | 
|  | 4250 | -c "=> renegotiate" \ | 
|  | 4251 | -s "=> renegotiate" \ | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4252 | -s "write hello request" | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4253 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4254 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4255 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4257 | run_test    "Renegotiation: DTLS, gnutls server, client-initiated" \ | 
|  | 4258 | "$G_SRV -u --mtu 4096" \ | 
|  | 4259 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 4260 | 0 \ | 
|  | 4261 | -c "client hello, adding renegotiation extension" \ | 
|  | 4262 | -c "found renegotiation extension" \ | 
|  | 4263 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4264 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4265 | -C "error" \ | 
|  | 4266 | -s "Extra-header:" | 
|  | 4267 |  | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4268 | # Test for the "secure renegotation" extension only (no actual renegotiation) | 
|  | 4269 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4270 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4272 | run_test    "Renego ext: gnutls server strict, client default" \ | 
|  | 4273 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 4274 | "$P_CLI debug_level=3" \ | 
|  | 4275 | 0 \ | 
|  | 4276 | -c "found renegotiation extension" \ | 
|  | 4277 | -C "error" \ | 
|  | 4278 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 4279 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4280 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4282 | run_test    "Renego ext: gnutls server unsafe, client default" \ | 
|  | 4283 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 4284 | "$P_CLI debug_level=3" \ | 
|  | 4285 | 0 \ | 
|  | 4286 | -C "found renegotiation extension" \ | 
|  | 4287 | -C "error" \ | 
|  | 4288 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 4289 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4290 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4292 | run_test    "Renego ext: gnutls server unsafe, client break legacy" \ | 
|  | 4293 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 4294 | "$P_CLI debug_level=3 allow_legacy=-1" \ | 
|  | 4295 | 1 \ | 
|  | 4296 | -C "found renegotiation extension" \ | 
|  | 4297 | -c "error" \ | 
|  | 4298 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 4299 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4300 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4302 | run_test    "Renego ext: gnutls client strict, server default" \ | 
|  | 4303 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4304 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4305 | 0 \ | 
|  | 4306 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 4307 | -s "server hello, secure renegotiation extension" | 
|  | 4308 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4309 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4311 | run_test    "Renego ext: gnutls client unsafe, server default" \ | 
|  | 4312 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4313 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4314 | 0 \ | 
|  | 4315 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 4316 | -S "server hello, secure renegotiation extension" | 
|  | 4317 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4318 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4320 | run_test    "Renego ext: gnutls client unsafe, server break legacy" \ | 
|  | 4321 | "$P_SRV debug_level=3 allow_legacy=-1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4322 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4323 | 1 \ | 
|  | 4324 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 4325 | -S "server hello, secure renegotiation extension" | 
|  | 4326 |  | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4327 | # Tests for silently dropping trailing extra bytes in .der certificates | 
|  | 4328 |  | 
|  | 4329 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4331 | run_test    "DER format: no trailing bytes" \ | 
|  | 4332 | "$P_SRV crt_file=data_files/server5-der0.crt \ | 
|  | 4333 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4334 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4335 | 0 \ | 
|  | 4336 | -c "Handshake was completed" \ | 
|  | 4337 |  | 
|  | 4338 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4340 | run_test    "DER format: with a trailing zero byte" \ | 
|  | 4341 | "$P_SRV crt_file=data_files/server5-der1a.crt \ | 
|  | 4342 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4343 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4344 | 0 \ | 
|  | 4345 | -c "Handshake was completed" \ | 
|  | 4346 |  | 
|  | 4347 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4349 | run_test    "DER format: with a trailing random byte" \ | 
|  | 4350 | "$P_SRV crt_file=data_files/server5-der1b.crt \ | 
|  | 4351 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4352 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4353 | 0 \ | 
|  | 4354 | -c "Handshake was completed" \ | 
|  | 4355 |  | 
|  | 4356 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4358 | run_test    "DER format: with 2 trailing random bytes" \ | 
|  | 4359 | "$P_SRV crt_file=data_files/server5-der2.crt \ | 
|  | 4360 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4361 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4362 | 0 \ | 
|  | 4363 | -c "Handshake was completed" \ | 
|  | 4364 |  | 
|  | 4365 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4367 | run_test    "DER format: with 4 trailing random bytes" \ | 
|  | 4368 | "$P_SRV crt_file=data_files/server5-der4.crt \ | 
|  | 4369 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4370 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4371 | 0 \ | 
|  | 4372 | -c "Handshake was completed" \ | 
|  | 4373 |  | 
|  | 4374 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4376 | run_test    "DER format: with 8 trailing random bytes" \ | 
|  | 4377 | "$P_SRV crt_file=data_files/server5-der8.crt \ | 
|  | 4378 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4379 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4380 | 0 \ | 
|  | 4381 | -c "Handshake was completed" \ | 
|  | 4382 |  | 
|  | 4383 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4385 | run_test    "DER format: with 9 trailing random bytes" \ | 
|  | 4386 | "$P_SRV crt_file=data_files/server5-der9.crt \ | 
|  | 4387 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4388 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4389 | 0 \ | 
|  | 4390 | -c "Handshake was completed" \ | 
|  | 4391 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4392 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication | 
|  | 4393 | # When updating these tests, modify the matching authentication tests accordingly | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4394 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4396 | run_test    "Authentication: server badcert, client required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4397 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 4398 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4399 | "$P_CLI debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4400 | 1 \ | 
|  | 4401 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4402 | -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] | 4403 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4404 | -c "X509 - Certificate verification failed" | 
|  | 4405 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4407 | run_test    "Authentication: server badcert, client optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4408 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 4409 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4410 | "$P_CLI debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4411 | 0 \ | 
|  | 4412 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4413 | -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] | 4414 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4415 | -C "X509 - Certificate verification failed" | 
|  | 4416 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4418 | run_test    "Authentication: server goodcert, client optional, no trusted CA" \ | 
|  | 4419 | "$P_SRV" \ | 
|  | 4420 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ | 
|  | 4421 | 0 \ | 
|  | 4422 | -c "x509_verify_cert() returned" \ | 
|  | 4423 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4424 | -c "! Certificate verification flags"\ | 
|  | 4425 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4426 | -C "X509 - Certificate verification failed" \ | 
|  | 4427 | -C "SSL - No CA Chain is set, but required to operate" | 
|  | 4428 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4430 | run_test    "Authentication: server goodcert, client required, no trusted CA" \ | 
|  | 4431 | "$P_SRV" \ | 
|  | 4432 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ | 
|  | 4433 | 1 \ | 
|  | 4434 | -c "x509_verify_cert() returned" \ | 
|  | 4435 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4436 | -c "! Certificate verification flags"\ | 
|  | 4437 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4438 | -c "SSL - No CA Chain is set, but required to operate" | 
|  | 4439 |  | 
|  | 4440 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 4441 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 4442 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 4443 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 4444 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 4445 | # different means to have the server ignoring the client's supported curve list. | 
|  | 4446 |  | 
|  | 4447 | requires_config_enabled MBEDTLS_ECP_C | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4449 | run_test    "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 4450 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4451 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4452 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 4453 | 1 \ | 
|  | 4454 | -c "bad certificate (EC key curve)"\ | 
|  | 4455 | -c "! Certificate verification flags"\ | 
|  | 4456 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 4457 |  | 
|  | 4458 | requires_config_enabled MBEDTLS_ECP_C | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4460 | run_test    "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 4461 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4462 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4463 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 4464 | 1 \ | 
|  | 4465 | -c "bad certificate (EC key curve)"\ | 
|  | 4466 | -c "! Certificate verification flags"\ | 
|  | 4467 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 4468 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4470 | run_test    "Authentication: server badcert, client none" \ | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4471 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4472 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4473 | "$P_CLI debug_level=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4474 | 0 \ | 
|  | 4475 | -C "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4476 | -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] | 4477 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4478 | -C "X509 - Certificate verification failed" | 
|  | 4479 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4481 | run_test    "Authentication: client SHA256, server required" \ | 
|  | 4482 | "$P_SRV auth_mode=required" \ | 
|  | 4483 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4484 | key_file=data_files/server6.key \ | 
|  | 4485 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 4486 | 0 \ | 
|  | 4487 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4488 | -c "Supported Signature Algorithm found: 5," | 
|  | 4489 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4491 | run_test    "Authentication: client SHA384, server required" \ | 
|  | 4492 | "$P_SRV auth_mode=required" \ | 
|  | 4493 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4494 | key_file=data_files/server6.key \ | 
|  | 4495 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 4496 | 0 \ | 
|  | 4497 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4498 | -c "Supported Signature Algorithm found: 5," | 
|  | 4499 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4501 | run_test    "Authentication: client has no cert, server required (TLS)" \ | 
|  | 4502 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4503 | "$P_CLI debug_level=3 crt_file=none \ | 
|  | 4504 | key_file=data_files/server5.key" \ | 
|  | 4505 | 1 \ | 
|  | 4506 | -S "skip write certificate request" \ | 
|  | 4507 | -C "skip parse certificate request" \ | 
|  | 4508 | -c "got a certificate request" \ | 
|  | 4509 | -c "= write certificate$" \ | 
|  | 4510 | -C "skip write certificate$" \ | 
|  | 4511 | -S "x509_verify_cert() returned" \ | 
|  | 4512 | -s "client has no certificate" \ | 
|  | 4513 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4514 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4515 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 4516 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4518 | run_test    "Authentication: client badcert, server required" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4519 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4520 | "$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] | 4521 | key_file=data_files/server5.key" \ | 
|  | 4522 | 1 \ | 
|  | 4523 | -S "skip write certificate request" \ | 
|  | 4524 | -C "skip parse certificate request" \ | 
|  | 4525 | -c "got a certificate request" \ | 
|  | 4526 | -C "skip write certificate" \ | 
|  | 4527 | -C "skip write certificate verify" \ | 
|  | 4528 | -S "skip parse certificate verify" \ | 
|  | 4529 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4530 | -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] | 4531 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4532 | -s "send alert level=2 message=48" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4533 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4534 | -s "X509 - Certificate verification failed" | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4535 | # We don't check that the client receives the alert because it might | 
|  | 4536 | # detect that its write end of the connection is closed and abort | 
|  | 4537 | # before reading the alert message. | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4538 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4540 | run_test    "Authentication: client cert self-signed and trusted, server required" \ | 
|  | 4541 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ | 
|  | 4542 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4543 | key_file=data_files/server5.key" \ | 
|  | 4544 | 0 \ | 
|  | 4545 | -S "skip write certificate request" \ | 
|  | 4546 | -C "skip parse certificate request" \ | 
|  | 4547 | -c "got a certificate request" \ | 
|  | 4548 | -C "skip write certificate" \ | 
|  | 4549 | -C "skip write certificate verify" \ | 
|  | 4550 | -S "skip parse certificate verify" \ | 
|  | 4551 | -S "x509_verify_cert() returned" \ | 
|  | 4552 | -S "! The certificate is not correctly signed" \ | 
|  | 4553 | -S "X509 - Certificate verification failed" | 
|  | 4554 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4556 | run_test    "Authentication: client cert not trusted, server required" \ | 
|  | 4557 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4558 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4559 | key_file=data_files/server5.key" \ | 
|  | 4560 | 1 \ | 
|  | 4561 | -S "skip write certificate request" \ | 
|  | 4562 | -C "skip parse certificate request" \ | 
|  | 4563 | -c "got a certificate request" \ | 
|  | 4564 | -C "skip write certificate" \ | 
|  | 4565 | -C "skip write certificate verify" \ | 
|  | 4566 | -S "skip parse certificate verify" \ | 
|  | 4567 | -s "x509_verify_cert() returned" \ | 
|  | 4568 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4569 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4570 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4571 | -s "X509 - Certificate verification failed" | 
|  | 4572 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4574 | run_test    "Authentication: client badcert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4575 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 4576 | "$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] | 4577 | key_file=data_files/server5.key" \ | 
|  | 4578 | 0 \ | 
|  | 4579 | -S "skip write certificate request" \ | 
|  | 4580 | -C "skip parse certificate request" \ | 
|  | 4581 | -c "got a certificate request" \ | 
|  | 4582 | -C "skip write certificate" \ | 
|  | 4583 | -C "skip write certificate verify" \ | 
|  | 4584 | -S "skip parse certificate verify" \ | 
|  | 4585 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4586 | -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] | 4587 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4588 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4589 | -S "X509 - Certificate verification failed" | 
|  | 4590 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4592 | run_test    "Authentication: client badcert, server none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4593 | "$P_SRV debug_level=3 auth_mode=none" \ | 
|  | 4594 | "$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] | 4595 | key_file=data_files/server5.key" \ | 
|  | 4596 | 0 \ | 
|  | 4597 | -s "skip write certificate request" \ | 
|  | 4598 | -C "skip parse certificate request" \ | 
|  | 4599 | -c "got no certificate request" \ | 
|  | 4600 | -c "skip write certificate" \ | 
|  | 4601 | -c "skip write certificate verify" \ | 
|  | 4602 | -s "skip parse certificate verify" \ | 
|  | 4603 | -S "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4604 | -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] | 4605 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4606 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4607 | -S "X509 - Certificate verification failed" | 
|  | 4608 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4610 | run_test    "Authentication: client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4611 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 4612 | "$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] | 4613 | 0 \ | 
|  | 4614 | -S "skip write certificate request" \ | 
|  | 4615 | -C "skip parse certificate request" \ | 
|  | 4616 | -c "got a certificate request" \ | 
|  | 4617 | -C "skip write certificate$" \ | 
|  | 4618 | -C "got no certificate to send" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4619 | -c "skip write certificate verify" \ | 
|  | 4620 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4621 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4622 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4623 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4624 | -S "X509 - Certificate verification failed" | 
|  | 4625 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4627 | run_test    "Authentication: openssl client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4628 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4629 | "$O_CLI" \ | 
|  | 4630 | 0 \ | 
|  | 4631 | -S "skip write certificate request" \ | 
|  | 4632 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4633 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4634 | -S "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4635 | -S "X509 - Certificate verification failed" | 
|  | 4636 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4638 | run_test    "Authentication: client no cert, openssl server optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4639 | "$O_SRV -verify 10" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4640 | "$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] | 4641 | 0 \ | 
|  | 4642 | -C "skip parse certificate request" \ | 
|  | 4643 | -c "got a certificate request" \ | 
|  | 4644 | -C "skip write certificate$" \ | 
|  | 4645 | -c "skip write certificate verify" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4646 | -C "! mbedtls_ssl_handshake returned" | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4647 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4649 | run_test    "Authentication: client no cert, openssl server required" \ | 
|  | 4650 | "$O_SRV -Verify 10" \ | 
|  | 4651 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
|  | 4652 | 1 \ | 
|  | 4653 | -C "skip parse certificate request" \ | 
|  | 4654 | -c "got a certificate request" \ | 
|  | 4655 | -C "skip write certificate$" \ | 
|  | 4656 | -c "skip write certificate verify" \ | 
|  | 4657 | -c "! mbedtls_ssl_handshake returned" | 
|  | 4658 |  | 
| Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4659 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default | 
|  | 4660 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the | 
|  | 4661 | # library is configured with a different value. | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4662 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4663 | MAX_IM_CA='8' | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4664 |  | 
| Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4665 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA | 
|  | 4666 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 | 
|  | 4667 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions | 
|  | 4668 | # 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] | 4669 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4670 | requires_full_size_output_buffer | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4672 | run_test    "Authentication: server max_int chain, client default" \ | 
|  | 4673 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4674 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4675 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4676 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4677 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4678 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4679 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4680 | requires_full_size_output_buffer | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4682 | run_test    "Authentication: server max_int+1 chain, client default" \ | 
|  | 4683 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4684 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4685 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4686 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4687 | -c "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4688 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4689 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4690 | requires_full_size_output_buffer | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4691 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4692 | run_test    "Authentication: server max_int+1 chain, client optional" \ | 
|  | 4693 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4694 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4695 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4696 | auth_mode=optional" \ | 
|  | 4697 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4698 | -c "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4699 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4700 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4701 | requires_full_size_output_buffer | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4703 | run_test    "Authentication: server max_int+1 chain, client none" \ | 
|  | 4704 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4705 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4706 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4707 | auth_mode=none" \ | 
|  | 4708 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4709 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4710 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4711 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4712 | requires_full_size_output_buffer | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4714 | run_test    "Authentication: client max_int+1 chain, server default" \ | 
|  | 4715 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4716 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4717 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4718 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4719 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4720 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4721 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4722 | requires_full_size_output_buffer | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4724 | run_test    "Authentication: client max_int+1 chain, server optional" \ | 
|  | 4725 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 4726 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4727 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4728 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4729 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4730 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4731 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4732 | requires_full_size_output_buffer | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4734 | run_test    "Authentication: client max_int+1 chain, server required" \ | 
|  | 4735 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4736 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4737 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4738 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4739 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4740 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4741 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4742 | requires_full_size_output_buffer | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4744 | run_test    "Authentication: client max_int chain, server required" \ | 
|  | 4745 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4746 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4747 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4748 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4749 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4750 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4751 | # Tests for CA list in CertificateRequest messages | 
|  | 4752 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4754 | run_test    "Authentication: send CA list in CertificateRequest  (default)" \ | 
|  | 4755 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4756 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 4757 | key_file=data_files/server6.key" \ | 
|  | 4758 | 0 \ | 
|  | 4759 | -s "requested DN" | 
|  | 4760 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4762 | run_test    "Authentication: do not send CA list in CertificateRequest" \ | 
|  | 4763 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 4764 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 4765 | key_file=data_files/server6.key" \ | 
|  | 4766 | 0 \ | 
|  | 4767 | -S "requested DN" | 
|  | 4768 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4770 | run_test    "Authentication: send CA list in CertificateRequest, client self signed" \ | 
|  | 4771 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 4772 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4773 | key_file=data_files/server5.key" \ | 
|  | 4774 | 1 \ | 
|  | 4775 | -S "requested DN" \ | 
|  | 4776 | -s "x509_verify_cert() returned" \ | 
|  | 4777 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4778 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4779 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4780 | -s "X509 - Certificate verification failed" | 
|  | 4781 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4782 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests | 
|  | 4783 | # When updating these tests, modify the matching authentication tests accordingly | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4784 |  | 
|  | 4785 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4787 | run_test    "Authentication, CA callback: server badcert, client required" \ | 
|  | 4788 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 4789 | key_file=data_files/server5.key" \ | 
|  | 4790 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4791 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4792 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4793 | -c "x509_verify_cert() returned" \ | 
|  | 4794 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4795 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4796 | -c "X509 - Certificate verification failed" | 
|  | 4797 |  | 
|  | 4798 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4800 | run_test    "Authentication, CA callback: server badcert, client optional" \ | 
|  | 4801 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 4802 | key_file=data_files/server5.key" \ | 
|  | 4803 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ | 
|  | 4804 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4805 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4806 | -c "x509_verify_cert() returned" \ | 
|  | 4807 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4808 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4809 | -C "X509 - Certificate verification failed" | 
|  | 4810 |  | 
|  | 4811 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 4812 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 4813 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 4814 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 4815 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 4816 | # different means to have the server ignoring the client's supported curve list. | 
|  | 4817 |  | 
|  | 4818 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 4819 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4821 | run_test    "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 4822 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4823 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4824 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 4825 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4826 | -c "use CA callback for X.509 CRT verification" \ | 
|  | 4827 | -c "bad certificate (EC key curve)" \ | 
|  | 4828 | -c "! Certificate verification flags" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4829 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 4830 |  | 
|  | 4831 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 4832 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4834 | run_test    "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 4835 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4836 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4837 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 4838 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4839 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4840 | -c "bad certificate (EC key curve)"\ | 
|  | 4841 | -c "! Certificate verification flags"\ | 
|  | 4842 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 4843 |  | 
|  | 4844 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4846 | run_test    "Authentication, CA callback: client SHA256, server required" \ | 
|  | 4847 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4848 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4849 | key_file=data_files/server6.key \ | 
|  | 4850 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 4851 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4852 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4853 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4854 | -c "Supported Signature Algorithm found: 5," | 
|  | 4855 |  | 
|  | 4856 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4858 | run_test    "Authentication, CA callback: client SHA384, server required" \ | 
|  | 4859 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4860 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4861 | key_file=data_files/server6.key \ | 
|  | 4862 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 4863 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4864 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4865 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4866 | -c "Supported Signature Algorithm found: 5," | 
|  | 4867 |  | 
|  | 4868 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4870 | run_test    "Authentication, CA callback: client badcert, server required" \ | 
|  | 4871 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4872 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 4873 | key_file=data_files/server5.key" \ | 
|  | 4874 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4875 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4876 | -S "skip write certificate request" \ | 
|  | 4877 | -C "skip parse certificate request" \ | 
|  | 4878 | -c "got a certificate request" \ | 
|  | 4879 | -C "skip write certificate" \ | 
|  | 4880 | -C "skip write certificate verify" \ | 
|  | 4881 | -S "skip parse certificate verify" \ | 
|  | 4882 | -s "x509_verify_cert() returned" \ | 
|  | 4883 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4884 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4885 | -s "send alert level=2 message=48" \ | 
|  | 4886 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4887 | -s "X509 - Certificate verification failed" | 
|  | 4888 | # We don't check that the client receives the alert because it might | 
|  | 4889 | # detect that its write end of the connection is closed and abort | 
|  | 4890 | # before reading the alert message. | 
|  | 4891 |  | 
|  | 4892 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4893 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4894 | run_test    "Authentication, CA callback: client cert not trusted, server required" \ | 
|  | 4895 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4896 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4897 | key_file=data_files/server5.key" \ | 
|  | 4898 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4899 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4900 | -S "skip write certificate request" \ | 
|  | 4901 | -C "skip parse certificate request" \ | 
|  | 4902 | -c "got a certificate request" \ | 
|  | 4903 | -C "skip write certificate" \ | 
|  | 4904 | -C "skip write certificate verify" \ | 
|  | 4905 | -S "skip parse certificate verify" \ | 
|  | 4906 | -s "x509_verify_cert() returned" \ | 
|  | 4907 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4908 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4909 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4910 | -s "X509 - Certificate verification failed" | 
|  | 4911 |  | 
|  | 4912 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4914 | run_test    "Authentication, CA callback: client badcert, server optional" \ | 
|  | 4915 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ | 
|  | 4916 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 4917 | key_file=data_files/server5.key" \ | 
|  | 4918 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4919 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4920 | -S "skip write certificate request" \ | 
|  | 4921 | -C "skip parse certificate request" \ | 
|  | 4922 | -c "got a certificate request" \ | 
|  | 4923 | -C "skip write certificate" \ | 
|  | 4924 | -C "skip write certificate verify" \ | 
|  | 4925 | -S "skip parse certificate verify" \ | 
|  | 4926 | -s "x509_verify_cert() returned" \ | 
|  | 4927 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4928 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4929 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4930 | -S "X509 - Certificate verification failed" | 
|  | 4931 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4932 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4933 | requires_full_size_output_buffer | 
|  | 4934 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4935 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4936 | run_test    "Authentication, CA callback: server max_int chain, client default" \ | 
|  | 4937 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4938 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4939 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4940 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4941 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4942 | -C "X509 - A fatal error occurred" | 
|  | 4943 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4944 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4945 | requires_full_size_output_buffer | 
|  | 4946 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4948 | run_test    "Authentication, CA callback: server max_int+1 chain, client default" \ | 
|  | 4949 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4950 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4951 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4952 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4953 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4954 | -c "X509 - A fatal error occurred" | 
|  | 4955 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4956 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4957 | requires_full_size_output_buffer | 
|  | 4958 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4960 | run_test    "Authentication, CA callback: server max_int+1 chain, client optional" \ | 
|  | 4961 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4962 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4963 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4964 | debug_level=3 auth_mode=optional" \ | 
|  | 4965 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4966 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4967 | -c "X509 - A fatal error occurred" | 
|  | 4968 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4969 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4970 | requires_full_size_output_buffer | 
|  | 4971 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4973 | run_test    "Authentication, CA callback: client max_int+1 chain, server optional" \ | 
|  | 4974 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 4975 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4976 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4977 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4978 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4979 | -s "X509 - A fatal error occurred" | 
|  | 4980 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4981 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4982 | requires_full_size_output_buffer | 
|  | 4983 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4985 | run_test    "Authentication, CA callback: client max_int+1 chain, server required" \ | 
|  | 4986 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4987 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4988 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4989 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4990 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4991 | -s "X509 - A fatal error occurred" | 
|  | 4992 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4993 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4994 | requires_full_size_output_buffer | 
|  | 4995 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4997 | run_test    "Authentication, CA callback: client max_int chain, server required" \ | 
|  | 4998 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4999 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 5000 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 5001 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5002 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5003 | -S "X509 - A fatal error occurred" | 
|  | 5004 |  | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5005 | # Tests for certificate selection based on SHA verson | 
|  | 5006 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5007 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5009 | run_test    "Certificate hash: client TLS 1.2 -> SHA-2" \ | 
|  | 5010 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 5011 | key_file=data_files/server5.key \ | 
|  | 5012 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 5013 | key_file2=data_files/server5.key" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5014 | "$P_CLI force_version=tls12" \ | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5015 | 0 \ | 
|  | 5016 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 5017 | -C "signed using.*ECDSA with SHA1" | 
|  | 5018 |  | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5019 | # tests for SNI | 
|  | 5020 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5021 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5023 | run_test    "SNI: no SNI callback" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5024 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5025 | 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] | 5026 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5027 | 0 \ | 
|  | 5028 | -S "parse ServerName extension" \ | 
|  | 5029 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 5030 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5031 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5032 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5034 | run_test    "SNI: matching cert 1" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5035 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5036 | 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] | 5037 | 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] | 5038 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5039 | 0 \ | 
|  | 5040 | -s "parse ServerName extension" \ | 
|  | 5041 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 5042 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5043 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5044 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5046 | run_test    "SNI: matching cert 2" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5047 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5048 | 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] | 5049 | 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] | 5050 | "$P_CLI server_name=polarssl.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5051 | 0 \ | 
|  | 5052 | -s "parse ServerName extension" \ | 
|  | 5053 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 5054 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5055 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5056 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5058 | run_test    "SNI: no matching cert" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5059 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5060 | 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] | 5061 | 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] | 5062 | "$P_CLI server_name=nonesuch.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5063 | 1 \ | 
|  | 5064 | -s "parse ServerName extension" \ | 
|  | 5065 | -s "ssl_sni_wrapper() returned" \ | 
|  | 5066 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 5067 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 5068 | -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] | 5069 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5071 | run_test    "SNI: client auth no override: optional" \ | 
|  | 5072 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 5073 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5074 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 5075 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5076 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5077 | -S "skip write certificate request" \ | 
|  | 5078 | -C "skip parse certificate request" \ | 
|  | 5079 | -c "got a certificate request" \ | 
|  | 5080 | -C "skip write certificate" \ | 
|  | 5081 | -C "skip write certificate verify" \ | 
|  | 5082 | -S "skip parse certificate verify" | 
|  | 5083 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5085 | run_test    "SNI: client auth override: none -> optional" \ | 
|  | 5086 | "$P_SRV debug_level=3 auth_mode=none \ | 
|  | 5087 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5088 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 5089 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5090 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5091 | -S "skip write certificate request" \ | 
|  | 5092 | -C "skip parse certificate request" \ | 
|  | 5093 | -c "got a certificate request" \ | 
|  | 5094 | -C "skip write certificate" \ | 
|  | 5095 | -C "skip write certificate verify" \ | 
|  | 5096 | -S "skip parse certificate verify" | 
|  | 5097 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5099 | run_test    "SNI: client auth override: optional -> none" \ | 
|  | 5100 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 5101 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5102 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 5103 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5104 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5105 | -s "skip write certificate request" \ | 
|  | 5106 | -C "skip parse certificate request" \ | 
|  | 5107 | -c "got no certificate request" \ | 
|  | 5108 | -c "skip write certificate" \ | 
|  | 5109 | -c "skip write certificate verify" \ | 
|  | 5110 | -s "skip parse certificate verify" | 
|  | 5111 |  | 
| 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 | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5113 | run_test    "SNI: CA no override" \ | 
|  | 5114 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 5115 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5116 | ca_file=data_files/test-ca.crt \ | 
|  | 5117 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 5118 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 5119 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 5120 | 1 \ | 
|  | 5121 | -S "skip write certificate request" \ | 
|  | 5122 | -C "skip parse certificate request" \ | 
|  | 5123 | -c "got a certificate request" \ | 
|  | 5124 | -C "skip write certificate" \ | 
|  | 5125 | -C "skip write certificate verify" \ | 
|  | 5126 | -S "skip parse certificate verify" \ | 
|  | 5127 | -s "x509_verify_cert() returned" \ | 
|  | 5128 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5129 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 5130 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5132 | run_test    "SNI: CA override" \ | 
|  | 5133 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 5134 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5135 | ca_file=data_files/test-ca.crt \ | 
|  | 5136 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 5137 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 5138 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 5139 | 0 \ | 
|  | 5140 | -S "skip write certificate request" \ | 
|  | 5141 | -C "skip parse certificate request" \ | 
|  | 5142 | -c "got a certificate request" \ | 
|  | 5143 | -C "skip write certificate" \ | 
|  | 5144 | -C "skip write certificate verify" \ | 
|  | 5145 | -S "skip parse certificate verify" \ | 
|  | 5146 | -S "x509_verify_cert() returned" \ | 
|  | 5147 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5148 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 5149 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5151 | run_test    "SNI: CA override with CRL" \ | 
|  | 5152 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 5153 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5154 | ca_file=data_files/test-ca.crt \ | 
|  | 5155 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 5156 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 5157 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 5158 | 1 \ | 
|  | 5159 | -S "skip write certificate request" \ | 
|  | 5160 | -C "skip parse certificate request" \ | 
|  | 5161 | -c "got a certificate request" \ | 
|  | 5162 | -C "skip write certificate" \ | 
|  | 5163 | -C "skip write certificate verify" \ | 
|  | 5164 | -S "skip parse certificate verify" \ | 
|  | 5165 | -s "x509_verify_cert() returned" \ | 
|  | 5166 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5167 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 5168 |  | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5169 | # Tests for SNI and DTLS | 
|  | 5170 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5171 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5173 | run_test    "SNI: DTLS, no SNI callback" \ | 
|  | 5174 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 5175 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 5176 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 5177 | 0 \ | 
|  | 5178 | -S "parse ServerName extension" \ | 
|  | 5179 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 5180 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 5181 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5182 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5184 | run_test    "SNI: DTLS, matching cert 1" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5185 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 5186 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5187 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 5188 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 5189 | 0 \ | 
|  | 5190 | -s "parse ServerName extension" \ | 
|  | 5191 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 5192 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 5193 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5194 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5196 | run_test    "SNI: DTLS, matching cert 2" \ | 
|  | 5197 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 5198 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5199 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 5200 | "$P_CLI server_name=polarssl.example dtls=1" \ | 
|  | 5201 | 0 \ | 
|  | 5202 | -s "parse ServerName extension" \ | 
|  | 5203 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 5204 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 5205 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5207 | run_test    "SNI: DTLS, no matching cert" \ | 
|  | 5208 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 5209 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5210 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 5211 | "$P_CLI server_name=nonesuch.example dtls=1" \ | 
|  | 5212 | 1 \ | 
|  | 5213 | -s "parse ServerName extension" \ | 
|  | 5214 | -s "ssl_sni_wrapper() returned" \ | 
|  | 5215 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 5216 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 5217 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 5218 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5220 | run_test    "SNI: DTLS, client auth no override: optional" \ | 
|  | 5221 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 5222 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5223 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 5224 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 5225 | 0 \ | 
|  | 5226 | -S "skip write certificate request" \ | 
|  | 5227 | -C "skip parse certificate request" \ | 
|  | 5228 | -c "got a certificate request" \ | 
|  | 5229 | -C "skip write certificate" \ | 
|  | 5230 | -C "skip write certificate verify" \ | 
|  | 5231 | -S "skip parse certificate verify" | 
|  | 5232 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5234 | run_test    "SNI: DTLS, client auth override: none -> optional" \ | 
|  | 5235 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ | 
|  | 5236 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5237 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 5238 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 5239 | 0 \ | 
|  | 5240 | -S "skip write certificate request" \ | 
|  | 5241 | -C "skip parse certificate request" \ | 
|  | 5242 | -c "got a certificate request" \ | 
|  | 5243 | -C "skip write certificate" \ | 
|  | 5244 | -C "skip write certificate verify" \ | 
|  | 5245 | -S "skip parse certificate verify" | 
|  | 5246 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5248 | run_test    "SNI: DTLS, client auth override: optional -> none" \ | 
|  | 5249 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 5250 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5251 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 5252 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 5253 | 0 \ | 
|  | 5254 | -s "skip write certificate request" \ | 
|  | 5255 | -C "skip parse certificate request" \ | 
|  | 5256 | -c "got no certificate request" \ | 
|  | 5257 | -c "skip write certificate" \ | 
|  | 5258 | -c "skip write certificate verify" \ | 
|  | 5259 | -s "skip parse certificate verify" | 
|  | 5260 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5262 | run_test    "SNI: DTLS, CA no override" \ | 
|  | 5263 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 5264 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5265 | ca_file=data_files/test-ca.crt \ | 
|  | 5266 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 5267 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 5268 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 5269 | 1 \ | 
|  | 5270 | -S "skip write certificate request" \ | 
|  | 5271 | -C "skip parse certificate request" \ | 
|  | 5272 | -c "got a certificate request" \ | 
|  | 5273 | -C "skip write certificate" \ | 
|  | 5274 | -C "skip write certificate verify" \ | 
|  | 5275 | -S "skip parse certificate verify" \ | 
|  | 5276 | -s "x509_verify_cert() returned" \ | 
|  | 5277 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5278 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 5279 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5281 | run_test    "SNI: DTLS, CA override" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5282 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 5283 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 5284 | ca_file=data_files/test-ca.crt \ | 
|  | 5285 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 5286 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 5287 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 5288 | 0 \ | 
|  | 5289 | -S "skip write certificate request" \ | 
|  | 5290 | -C "skip parse certificate request" \ | 
|  | 5291 | -c "got a certificate request" \ | 
|  | 5292 | -C "skip write certificate" \ | 
|  | 5293 | -C "skip write certificate verify" \ | 
|  | 5294 | -S "skip parse certificate verify" \ | 
|  | 5295 | -S "x509_verify_cert() returned" \ | 
|  | 5296 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5297 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 5298 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5300 | run_test    "SNI: DTLS, CA override with CRL" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5301 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 5302 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ | 
|  | 5303 | ca_file=data_files/test-ca.crt \ | 
|  | 5304 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 5305 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 5306 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 5307 | 1 \ | 
|  | 5308 | -S "skip write certificate request" \ | 
|  | 5309 | -C "skip parse certificate request" \ | 
|  | 5310 | -c "got a certificate request" \ | 
|  | 5311 | -C "skip write certificate" \ | 
|  | 5312 | -C "skip write certificate verify" \ | 
|  | 5313 | -S "skip parse certificate verify" \ | 
|  | 5314 | -s "x509_verify_cert() returned" \ | 
|  | 5315 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 5316 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 5317 |  | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5318 | # Tests for non-blocking I/O: exercise a variety of handshake flows | 
|  | 5319 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5321 | run_test    "Non-blocking I/O: basic handshake" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5322 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 5323 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 5324 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5325 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5326 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5327 | -c "Read from server: .* bytes read" | 
|  | 5328 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5330 | run_test    "Non-blocking I/O: client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5331 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ | 
|  | 5332 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 5333 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5334 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5335 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5336 | -c "Read from server: .* bytes read" | 
|  | 5337 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5339 | run_test    "Non-blocking I/O: ticket" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5340 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 5341 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 5342 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5343 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5344 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5345 | -c "Read from server: .* bytes read" | 
|  | 5346 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5348 | run_test    "Non-blocking I/O: ticket + client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5349 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 5350 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 5351 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5352 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5353 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5354 | -c "Read from server: .* bytes read" | 
|  | 5355 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5357 | run_test    "Non-blocking I/O: ticket + client auth + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5358 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 5359 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 5360 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5361 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5362 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5363 | -c "Read from server: .* bytes read" | 
|  | 5364 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5366 | run_test    "Non-blocking I/O: ticket + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5367 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 5368 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 5369 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5370 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5371 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5372 | -c "Read from server: .* bytes read" | 
|  | 5373 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5375 | run_test    "Non-blocking I/O: session-id resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5376 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 5377 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ | 
|  | 5378 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5379 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5380 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5381 | -c "Read from server: .* bytes read" | 
|  | 5382 |  | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5383 | # Tests for event-driven I/O: exercise a variety of handshake flows | 
|  | 5384 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5386 | run_test    "Event-driven I/O: basic handshake" \ | 
|  | 5387 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 5388 | "$P_CLI event=1 tickets=0" \ | 
|  | 5389 | 0 \ | 
|  | 5390 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5391 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 5392 | -c "Read from server: .* bytes read" | 
|  | 5393 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5395 | run_test    "Event-driven I/O: client auth" \ | 
|  | 5396 | "$P_SRV event=1 tickets=0 auth_mode=required" \ | 
|  | 5397 | "$P_CLI event=1 tickets=0" \ | 
|  | 5398 | 0 \ | 
|  | 5399 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5400 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 5401 | -c "Read from server: .* bytes read" | 
|  | 5402 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5404 | run_test    "Event-driven I/O: ticket" \ | 
|  | 5405 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 5406 | "$P_CLI event=1 tickets=1" \ | 
|  | 5407 | 0 \ | 
|  | 5408 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5409 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 5410 | -c "Read from server: .* bytes read" | 
|  | 5411 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5413 | run_test    "Event-driven I/O: ticket + client auth" \ | 
|  | 5414 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 5415 | "$P_CLI event=1 tickets=1" \ | 
|  | 5416 | 0 \ | 
|  | 5417 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5418 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 5419 | -c "Read from server: .* bytes read" | 
|  | 5420 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5422 | run_test    "Event-driven I/O: ticket + client auth + resume" \ | 
|  | 5423 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 5424 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 5425 | 0 \ | 
|  | 5426 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5427 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 5428 | -c "Read from server: .* bytes read" | 
|  | 5429 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5431 | run_test    "Event-driven I/O: ticket + resume" \ | 
|  | 5432 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 5433 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 5434 | 0 \ | 
|  | 5435 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5436 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 5437 | -c "Read from server: .* bytes read" | 
|  | 5438 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5440 | run_test    "Event-driven I/O: session-id resume" \ | 
|  | 5441 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 5442 | "$P_CLI event=1 tickets=0 reconnect=1" \ | 
|  | 5443 | 0 \ | 
|  | 5444 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5445 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 5446 | -c "Read from server: .* bytes read" | 
|  | 5447 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5449 | run_test    "Event-driven I/O, DTLS: basic handshake" \ | 
|  | 5450 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 5451 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 5452 | 0 \ | 
|  | 5453 | -c "Read from server: .* bytes read" | 
|  | 5454 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5456 | run_test    "Event-driven I/O, DTLS: client auth" \ | 
|  | 5457 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 5458 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 5459 | 0 \ | 
|  | 5460 | -c "Read from server: .* bytes read" | 
|  | 5461 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5463 | run_test    "Event-driven I/O, DTLS: ticket" \ | 
|  | 5464 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 5465 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 5466 | 0 \ | 
|  | 5467 | -c "Read from server: .* bytes read" | 
|  | 5468 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5470 | run_test    "Event-driven I/O, DTLS: ticket + client auth" \ | 
|  | 5471 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 5472 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 5473 | 0 \ | 
|  | 5474 | -c "Read from server: .* bytes read" | 
|  | 5475 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5477 | run_test    "Event-driven I/O, DTLS: ticket + client auth + resume" \ | 
|  | 5478 | "$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] | 5479 | "$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] | 5480 | 0 \ | 
|  | 5481 | -c "Read from server: .* bytes read" | 
|  | 5482 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5484 | run_test    "Event-driven I/O, DTLS: ticket + resume" \ | 
|  | 5485 | "$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] | 5486 | "$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] | 5487 | 0 \ | 
|  | 5488 | -c "Read from server: .* bytes read" | 
|  | 5489 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5491 | run_test    "Event-driven I/O, DTLS: session-id resume" \ | 
|  | 5492 | "$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] | 5493 | "$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] | 5494 | 0 \ | 
|  | 5495 | -c "Read from server: .* bytes read" | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5496 |  | 
|  | 5497 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. | 
|  | 5498 | # During session resumption, the client will send its ApplicationData record | 
|  | 5499 | # within the same datagram as the Finished messages. In this situation, the | 
|  | 5500 | # server MUST NOT idle on the underlying transport after handshake completion, | 
|  | 5501 | # because the ApplicationData request has already been queued internally. | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5503 | run_test    "Event-driven I/O, DTLS: session-id resume, UDP packing" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5504 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5505 | "$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] | 5506 | "$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] | 5507 | 0 \ | 
|  | 5508 | -c "Read from server: .* bytes read" | 
|  | 5509 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5510 | # Tests for version negotiation | 
|  | 5511 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5513 | run_test    "Version check: all -> 1.2" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5514 | "$P_SRV" \ | 
|  | 5515 | "$P_CLI" \ | 
|  | 5516 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5517 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5518 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5519 | -s "Protocol is TLSv1.2" \ | 
|  | 5520 | -c "Protocol is TLSv1.2" | 
|  | 5521 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5523 | run_test    "Not supported version check: cli TLS 1.0" \ | 
|  | 5524 | "$P_SRV" \ | 
|  | 5525 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ | 
|  | 5526 | 1 \ | 
|  | 5527 | -s "Handshake protocol not within min/max boundaries" \ | 
|  | 5528 | -c "Error in protocol version" \ | 
|  | 5529 | -S "Protocol is TLSv1.0" \ | 
|  | 5530 | -C "Handshake was completed" | 
|  | 5531 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5533 | run_test    "Not supported version check: cli TLS 1.1" \ | 
|  | 5534 | "$P_SRV" \ | 
|  | 5535 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ | 
|  | 5536 | 1 \ | 
|  | 5537 | -s "Handshake protocol not within min/max boundaries" \ | 
|  | 5538 | -c "Error in protocol version" \ | 
|  | 5539 | -S "Protocol is TLSv1.1" \ | 
|  | 5540 | -C "Handshake was completed" | 
|  | 5541 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5543 | run_test    "Not supported version check: srv max TLS 1.0" \ | 
|  | 5544 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ | 
|  | 5545 | "$P_CLI" \ | 
|  | 5546 | 1 \ | 
|  | 5547 | -s "Error in protocol version" \ | 
|  | 5548 | -c "Handshake protocol not within min/max boundaries" \ | 
|  | 5549 | -S "Version: TLS1.0" \ | 
|  | 5550 | -C "Protocol is TLSv1.0" | 
|  | 5551 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5553 | run_test    "Not supported version check: srv max TLS 1.1" \ | 
|  | 5554 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ | 
|  | 5555 | "$P_CLI" \ | 
|  | 5556 | 1 \ | 
|  | 5557 | -s "Error in protocol version" \ | 
|  | 5558 | -c "Handshake protocol not within min/max boundaries" \ | 
|  | 5559 | -S "Version: TLS1.1" \ | 
|  | 5560 | -C "Protocol is TLSv1.1" | 
|  | 5561 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5562 | # Tests for ALPN extension | 
|  | 5563 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5565 | run_test    "ALPN: none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5566 | "$P_SRV debug_level=3" \ | 
|  | 5567 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5568 | 0 \ | 
|  | 5569 | -C "client hello, adding alpn extension" \ | 
|  | 5570 | -S "found alpn extension" \ | 
|  | 5571 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5572 | -S "server hello, adding alpn extension" \ | 
|  | 5573 | -C "found alpn extension " \ | 
|  | 5574 | -C "Application Layer Protocol is" \ | 
|  | 5575 | -S "Application Layer Protocol is" | 
|  | 5576 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5578 | run_test    "ALPN: client only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5579 | "$P_SRV debug_level=3" \ | 
|  | 5580 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5581 | 0 \ | 
|  | 5582 | -c "client hello, adding alpn extension" \ | 
|  | 5583 | -s "found alpn extension" \ | 
|  | 5584 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5585 | -S "server hello, adding alpn extension" \ | 
|  | 5586 | -C "found alpn extension " \ | 
|  | 5587 | -c "Application Layer Protocol is (none)" \ | 
|  | 5588 | -S "Application Layer Protocol is" | 
|  | 5589 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5591 | run_test    "ALPN: server only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5592 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 5593 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5594 | 0 \ | 
|  | 5595 | -C "client hello, adding alpn extension" \ | 
|  | 5596 | -S "found alpn extension" \ | 
|  | 5597 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5598 | -S "server hello, adding alpn extension" \ | 
|  | 5599 | -C "found alpn extension " \ | 
|  | 5600 | -C "Application Layer Protocol is" \ | 
|  | 5601 | -s "Application Layer Protocol is (none)" | 
|  | 5602 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5604 | run_test    "ALPN: both, common cli1-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5605 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 5606 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5607 | 0 \ | 
|  | 5608 | -c "client hello, adding alpn extension" \ | 
|  | 5609 | -s "found alpn extension" \ | 
|  | 5610 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5611 | -s "server hello, adding alpn extension" \ | 
|  | 5612 | -c "found alpn extension" \ | 
|  | 5613 | -c "Application Layer Protocol is abc" \ | 
|  | 5614 | -s "Application Layer Protocol is abc" | 
|  | 5615 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5617 | run_test    "ALPN: both, common cli2-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5618 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 5619 | "$P_CLI debug_level=3 alpn=1234,abc" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5620 | 0 \ | 
|  | 5621 | -c "client hello, adding alpn extension" \ | 
|  | 5622 | -s "found alpn extension" \ | 
|  | 5623 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5624 | -s "server hello, adding alpn extension" \ | 
|  | 5625 | -c "found alpn extension" \ | 
|  | 5626 | -c "Application Layer Protocol is abc" \ | 
|  | 5627 | -s "Application Layer Protocol is abc" | 
|  | 5628 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5630 | run_test    "ALPN: both, common cli1-srv2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5631 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 5632 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5633 | 0 \ | 
|  | 5634 | -c "client hello, adding alpn extension" \ | 
|  | 5635 | -s "found alpn extension" \ | 
|  | 5636 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5637 | -s "server hello, adding alpn extension" \ | 
|  | 5638 | -c "found alpn extension" \ | 
|  | 5639 | -c "Application Layer Protocol is 1234" \ | 
|  | 5640 | -s "Application Layer Protocol is 1234" | 
|  | 5641 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5643 | run_test    "ALPN: both, no common" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5644 | "$P_SRV debug_level=3 alpn=abc,123" \ | 
|  | 5645 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5646 | 1 \ | 
|  | 5647 | -c "client hello, adding alpn extension" \ | 
|  | 5648 | -s "found alpn extension" \ | 
|  | 5649 | -c "got an alert message, type: \\[2:120]" \ | 
|  | 5650 | -S "server hello, adding alpn extension" \ | 
|  | 5651 | -C "found alpn extension" \ | 
|  | 5652 | -C "Application Layer Protocol is 1234" \ | 
|  | 5653 | -S "Application Layer Protocol is 1234" | 
|  | 5654 |  | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5655 |  | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5656 | # Tests for keyUsage in leaf certificates, part 1: | 
|  | 5657 | # server-side certificate/suite selection | 
|  | 5658 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5660 | run_test    "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5661 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 5662 | crt_file=data_files/server2.ku-ds.crt" \ | 
|  | 5663 | "$P_CLI" \ | 
|  | 5664 | 0 \ | 
| Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5665 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5666 |  | 
|  | 5667 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5669 | run_test    "keyUsage srv: RSA, keyEncipherment -> RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5670 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 5671 | crt_file=data_files/server2.ku-ke.crt" \ | 
|  | 5672 | "$P_CLI" \ | 
|  | 5673 | 0 \ | 
|  | 5674 | -c "Ciphersuite is TLS-RSA-WITH-" | 
|  | 5675 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5677 | run_test    "keyUsage srv: RSA, keyAgreement -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5678 | "$P_SRV key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5679 | crt_file=data_files/server2.ku-ka.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5680 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5681 | 1 \ | 
|  | 5682 | -C "Ciphersuite is " | 
|  | 5683 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5685 | run_test    "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5686 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5687 | crt_file=data_files/server5.ku-ds.crt" \ | 
|  | 5688 | "$P_CLI" \ | 
|  | 5689 | 0 \ | 
|  | 5690 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" | 
|  | 5691 |  | 
|  | 5692 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5694 | run_test    "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5695 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5696 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 5697 | "$P_CLI" \ | 
|  | 5698 | 0 \ | 
|  | 5699 | -c "Ciphersuite is TLS-ECDH-" | 
|  | 5700 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5702 | run_test    "keyUsage srv: ECDSA, keyEncipherment -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5703 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5704 | crt_file=data_files/server5.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5705 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5706 | 1 \ | 
|  | 5707 | -C "Ciphersuite is " | 
|  | 5708 |  | 
|  | 5709 | # Tests for keyUsage in leaf certificates, part 2: | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5710 | # client-side checking of server cert | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5711 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5713 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5714 | "$O_SRV -key data_files/server2.key \ | 
|  | 5715 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5716 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5717 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5718 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5719 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5720 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5721 | -c "Ciphersuite is TLS-" | 
|  | 5722 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5724 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5725 | "$O_SRV -key data_files/server2.key \ | 
|  | 5726 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5727 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5728 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5729 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5730 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5731 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5732 | -c "Ciphersuite is TLS-" | 
|  | 5733 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5735 | run_test    "keyUsage cli: KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5736 | "$O_SRV -key data_files/server2.key \ | 
|  | 5737 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5738 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5739 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5740 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5741 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5742 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5743 | -c "Ciphersuite is TLS-" | 
|  | 5744 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5746 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5747 | "$O_SRV -key data_files/server2.key \ | 
|  | 5748 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5749 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5750 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5751 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5752 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5753 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5754 | -C "Ciphersuite is TLS-" | 
|  | 5755 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5757 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ | 
|  | 5758 | "$O_SRV -key data_files/server2.key \ | 
|  | 5759 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5760 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 5761 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5762 | 0 \ | 
|  | 5763 | -c "bad certificate (usage extensions)" \ | 
|  | 5764 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5765 | -c "Ciphersuite is TLS-" \ | 
|  | 5766 | -c "! Usage does not match the keyUsage extension" | 
|  | 5767 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5769 | run_test    "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5770 | "$O_SRV -key data_files/server2.key \ | 
|  | 5771 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5772 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5773 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5774 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5775 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5776 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5777 | -c "Ciphersuite is TLS-" | 
|  | 5778 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5780 | run_test    "keyUsage cli: DigitalSignature, RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5781 | "$O_SRV -key data_files/server2.key \ | 
|  | 5782 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5783 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5784 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5785 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5786 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5787 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5788 | -C "Ciphersuite is TLS-" | 
|  | 5789 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5791 | run_test    "keyUsage cli: DigitalSignature, RSA: fail, soft" \ | 
|  | 5792 | "$O_SRV -key data_files/server2.key \ | 
|  | 5793 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 5794 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 5795 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5796 | 0 \ | 
|  | 5797 | -c "bad certificate (usage extensions)" \ | 
|  | 5798 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5799 | -c "Ciphersuite is TLS-" \ | 
|  | 5800 | -c "! Usage does not match the keyUsage extension" | 
|  | 5801 |  | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5802 | # Tests for keyUsage in leaf certificates, part 3: | 
|  | 5803 | # server-side checking of client cert | 
|  | 5804 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5806 | run_test    "keyUsage cli-auth: RSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5807 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5808 | "$O_CLI -key data_files/server2.key \ | 
|  | 5809 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 5810 | 0 \ | 
|  | 5811 | -S "bad certificate (usage extensions)" \ | 
|  | 5812 | -S "Processing of the Certificate handshake message failed" | 
|  | 5813 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5815 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5816 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5817 | "$O_CLI -key data_files/server2.key \ | 
|  | 5818 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5819 | 0 \ | 
|  | 5820 | -s "bad certificate (usage extensions)" \ | 
|  | 5821 | -S "Processing of the Certificate handshake message failed" | 
|  | 5822 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5824 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5825 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5826 | "$O_CLI -key data_files/server2.key \ | 
|  | 5827 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5828 | 1 \ | 
|  | 5829 | -s "bad certificate (usage extensions)" \ | 
|  | 5830 | -s "Processing of the Certificate handshake message failed" | 
|  | 5831 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5833 | run_test    "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5834 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5835 | "$O_CLI -key data_files/server5.key \ | 
|  | 5836 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 5837 | 0 \ | 
|  | 5838 | -S "bad certificate (usage extensions)" \ | 
|  | 5839 | -S "Processing of the Certificate handshake message failed" | 
|  | 5840 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5842 | run_test    "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5843 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5844 | "$O_CLI -key data_files/server5.key \ | 
|  | 5845 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 5846 | 0 \ | 
|  | 5847 | -s "bad certificate (usage extensions)" \ | 
|  | 5848 | -S "Processing of the Certificate handshake message failed" | 
|  | 5849 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5850 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection | 
|  | 5851 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5853 | run_test    "extKeyUsage srv: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5854 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5855 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 5856 | "$P_CLI" \ | 
|  | 5857 | 0 | 
|  | 5858 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5860 | run_test    "extKeyUsage srv: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5861 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5862 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 5863 | "$P_CLI" \ | 
|  | 5864 | 0 | 
|  | 5865 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5867 | run_test    "extKeyUsage srv: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5868 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5869 | crt_file=data_files/server5.eku-cs_any.crt" \ | 
|  | 5870 | "$P_CLI" \ | 
|  | 5871 | 0 | 
|  | 5872 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5874 | run_test    "extKeyUsage srv: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5875 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5876 | crt_file=data_files/server5.eku-cli.crt" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5877 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5878 | 1 | 
|  | 5879 |  | 
|  | 5880 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert | 
|  | 5881 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5883 | run_test    "extKeyUsage cli: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5884 | "$O_SRV -key data_files/server5.key \ | 
|  | 5885 | -cert data_files/server5.eku-srv.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5886 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5887 | 0 \ | 
|  | 5888 | -C "bad certificate (usage extensions)" \ | 
|  | 5889 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5890 | -c "Ciphersuite is TLS-" | 
|  | 5891 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5893 | run_test    "extKeyUsage cli: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5894 | "$O_SRV -key data_files/server5.key \ | 
|  | 5895 | -cert data_files/server5.eku-srv_cli.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5896 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5897 | 0 \ | 
|  | 5898 | -C "bad certificate (usage extensions)" \ | 
|  | 5899 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5900 | -c "Ciphersuite is TLS-" | 
|  | 5901 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5903 | run_test    "extKeyUsage cli: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5904 | "$O_SRV -key data_files/server5.key \ | 
|  | 5905 | -cert data_files/server5.eku-cs_any.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5906 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5907 | 0 \ | 
|  | 5908 | -C "bad certificate (usage extensions)" \ | 
|  | 5909 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5910 | -c "Ciphersuite is TLS-" | 
|  | 5911 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5912 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5913 | run_test    "extKeyUsage cli: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5914 | "$O_SRV -key data_files/server5.key \ | 
|  | 5915 | -cert data_files/server5.eku-cs.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5916 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5917 | 1 \ | 
|  | 5918 | -c "bad certificate (usage extensions)" \ | 
|  | 5919 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5920 | -C "Ciphersuite is TLS-" | 
|  | 5921 |  | 
|  | 5922 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert | 
|  | 5923 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5925 | run_test    "extKeyUsage cli-auth: clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5926 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5927 | "$O_CLI -key data_files/server5.key \ | 
|  | 5928 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 5929 | 0 \ | 
|  | 5930 | -S "bad certificate (usage extensions)" \ | 
|  | 5931 | -S "Processing of the Certificate handshake message failed" | 
|  | 5932 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5934 | run_test    "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5935 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5936 | "$O_CLI -key data_files/server5.key \ | 
|  | 5937 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 5938 | 0 \ | 
|  | 5939 | -S "bad certificate (usage extensions)" \ | 
|  | 5940 | -S "Processing of the Certificate handshake message failed" | 
|  | 5941 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5943 | run_test    "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5944 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5945 | "$O_CLI -key data_files/server5.key \ | 
|  | 5946 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 5947 | 0 \ | 
|  | 5948 | -S "bad certificate (usage extensions)" \ | 
|  | 5949 | -S "Processing of the Certificate handshake message failed" | 
|  | 5950 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5952 | run_test    "extKeyUsage cli-auth: codeSign -> fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5953 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5954 | "$O_CLI -key data_files/server5.key \ | 
|  | 5955 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 5956 | 0 \ | 
|  | 5957 | -s "bad certificate (usage extensions)" \ | 
|  | 5958 | -S "Processing of the Certificate handshake message failed" | 
|  | 5959 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5961 | run_test    "extKeyUsage cli-auth: codeSign -> fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5962 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5963 | "$O_CLI -key data_files/server5.key \ | 
|  | 5964 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 5965 | 1 \ | 
|  | 5966 | -s "bad certificate (usage extensions)" \ | 
|  | 5967 | -s "Processing of the Certificate handshake message failed" | 
|  | 5968 |  | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5969 | # Tests for DHM parameters loading | 
|  | 5970 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5971 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5972 | run_test    "DHM parameters: reference" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5973 | "$P_SRV" \ | 
|  | 5974 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5975 | debug_level=3" \ | 
|  | 5976 | 0 \ | 
|  | 5977 | -c "value of 'DHM: P ' (2048 bits)" \ | 
| Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5978 | -c "value of 'DHM: G ' (2 bits)" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5979 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5981 | run_test    "DHM parameters: other parameters" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5982 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 5983 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5984 | debug_level=3" \ | 
|  | 5985 | 0 \ | 
|  | 5986 | -c "value of 'DHM: P ' (1024 bits)" \ | 
|  | 5987 | -c "value of 'DHM: G ' (2 bits)" | 
|  | 5988 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5989 | # Tests for DHM client-side size checking | 
|  | 5990 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5992 | run_test    "DHM size: server default, client default, OK" \ | 
|  | 5993 | "$P_SRV" \ | 
|  | 5994 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5995 | debug_level=1" \ | 
|  | 5996 | 0 \ | 
|  | 5997 | -C "DHM prime too short:" | 
|  | 5998 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6000 | run_test    "DHM size: server default, client 2048, OK" \ | 
|  | 6001 | "$P_SRV" \ | 
|  | 6002 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6003 | debug_level=1 dhmlen=2048" \ | 
|  | 6004 | 0 \ | 
|  | 6005 | -C "DHM prime too short:" | 
|  | 6006 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6008 | run_test    "DHM size: server 1024, client default, OK" \ | 
|  | 6009 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 6010 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6011 | debug_level=1" \ | 
|  | 6012 | 0 \ | 
|  | 6013 | -C "DHM prime too short:" | 
|  | 6014 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6016 | run_test    "DHM size: server 999, client 999, OK" \ | 
|  | 6017 | "$P_SRV dhm_file=data_files/dh.999.pem" \ | 
|  | 6018 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6019 | debug_level=1 dhmlen=999" \ | 
|  | 6020 | 0 \ | 
|  | 6021 | -C "DHM prime too short:" | 
|  | 6022 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6024 | run_test    "DHM size: server 1000, client 1000, OK" \ | 
|  | 6025 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 6026 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6027 | debug_level=1 dhmlen=1000" \ | 
|  | 6028 | 0 \ | 
|  | 6029 | -C "DHM prime too short:" | 
|  | 6030 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6032 | run_test    "DHM size: server 1000, client default, rejected" \ | 
|  | 6033 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 6034 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6035 | debug_level=1" \ | 
|  | 6036 | 1 \ | 
|  | 6037 | -c "DHM prime too short:" | 
|  | 6038 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6040 | run_test    "DHM size: server 1000, client 1001, rejected" \ | 
|  | 6041 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 6042 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6043 | debug_level=1 dhmlen=1001" \ | 
|  | 6044 | 1 \ | 
|  | 6045 | -c "DHM prime too short:" | 
|  | 6046 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6048 | run_test    "DHM size: server 999, client 1000, rejected" \ | 
|  | 6049 | "$P_SRV dhm_file=data_files/dh.999.pem" \ | 
|  | 6050 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6051 | debug_level=1 dhmlen=1000" \ | 
|  | 6052 | 1 \ | 
|  | 6053 | -c "DHM prime too short:" | 
|  | 6054 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6056 | run_test    "DHM size: server 998, client 999, rejected" \ | 
|  | 6057 | "$P_SRV dhm_file=data_files/dh.998.pem" \ | 
|  | 6058 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6059 | debug_level=1 dhmlen=999" \ | 
|  | 6060 | 1 \ | 
|  | 6061 | -c "DHM prime too short:" | 
|  | 6062 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6064 | run_test    "DHM size: server default, client 2049, rejected" \ | 
|  | 6065 | "$P_SRV" \ | 
|  | 6066 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 6067 | debug_level=1 dhmlen=2049" \ | 
|  | 6068 | 1 \ | 
|  | 6069 | -c "DHM prime too short:" | 
|  | 6070 |  | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6071 | # Tests for PSK callback | 
|  | 6072 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6074 | run_test    "PSK callback: psk, no callback" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6075 | "$P_SRV psk=abc123 psk_identity=foo" \ | 
|  | 6076 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 6077 | psk_identity=foo psk=abc123" \ | 
|  | 6078 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6079 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6080 | -S "SSL - Unknown identity received" \ | 
|  | 6081 | -S "SSL - Verification of the message MAC failed" | 
|  | 6082 |  | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6083 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6085 | run_test    "PSK callback: opaque psk on client, no callback" \ | 
|  | 6086 | "$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] | 6087 | "$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] | 6088 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6089 | 0 \ | 
|  | 6090 | -c "skip PMS generation for opaque PSK"\ | 
|  | 6091 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6092 | -C "session hash for extended master secret"\ | 
|  | 6093 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6094 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6095 | -S "SSL - Unknown identity received" \ | 
|  | 6096 | -S "SSL - Verification of the message MAC failed" | 
|  | 6097 |  | 
|  | 6098 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6100 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384" \ | 
|  | 6101 | "$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] | 6102 | "$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] | 6103 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6104 | 0 \ | 
|  | 6105 | -c "skip PMS generation for opaque PSK"\ | 
|  | 6106 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6107 | -C "session hash for extended master secret"\ | 
|  | 6108 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6109 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6110 | -S "SSL - Unknown identity received" \ | 
|  | 6111 | -S "SSL - Verification of the message MAC failed" | 
|  | 6112 |  | 
|  | 6113 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6115 | run_test    "PSK callback: opaque psk on client, no callback, EMS" \ | 
|  | 6116 | "$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] | 6117 | "$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] | 6118 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6119 | 0 \ | 
|  | 6120 | -c "skip PMS generation for opaque PSK"\ | 
|  | 6121 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6122 | -c "session hash for extended master secret"\ | 
|  | 6123 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6124 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6125 | -S "SSL - Unknown identity received" \ | 
|  | 6126 | -S "SSL - Verification of the message MAC failed" | 
|  | 6127 |  | 
|  | 6128 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6130 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ | 
|  | 6131 | "$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] | 6132 | "$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] | 6133 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6134 | 0 \ | 
|  | 6135 | -c "skip PMS generation for opaque PSK"\ | 
|  | 6136 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6137 | -c "session hash for extended master secret"\ | 
|  | 6138 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6139 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6140 | -S "SSL - Unknown identity received" \ | 
|  | 6141 | -S "SSL - Verification of the message MAC failed" | 
|  | 6142 |  | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6143 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6145 | 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] | 6146 | "$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" \ | 
|  | 6147 | "$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] | 6148 | psk_identity=foo psk=abc123" \ | 
|  | 6149 | 0 \ | 
|  | 6150 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6151 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6152 | -C "session hash for extended master secret"\ | 
|  | 6153 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6154 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6155 | -S "SSL - Unknown identity received" \ | 
|  | 6156 | -S "SSL - Verification of the message MAC failed" | 
|  | 6157 |  | 
|  | 6158 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6160 | 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] | 6161 | "$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" \ | 
|  | 6162 | "$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] | 6163 | psk_identity=foo psk=abc123" \ | 
|  | 6164 | 0 \ | 
|  | 6165 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6166 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6167 | -C "session hash for extended master secret"\ | 
|  | 6168 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6169 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6170 | -S "SSL - Unknown identity received" \ | 
|  | 6171 | -S "SSL - Verification of the message MAC failed" | 
|  | 6172 |  | 
|  | 6173 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6175 | 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] | 6176 | "$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] | 6177 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6178 | "$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] | 6179 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 6180 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6181 | -c "session hash for extended master secret"\ | 
|  | 6182 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6183 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6184 | -s "skip PMS generation for opaque PSK"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6185 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6186 | -S "SSL - Unknown identity received" \ | 
|  | 6187 | -S "SSL - Verification of the message MAC failed" | 
|  | 6188 |  | 
|  | 6189 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6191 | 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] | 6192 | "$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] | 6193 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6194 | "$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] | 6195 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 6196 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6197 | -c "session hash for extended master secret"\ | 
|  | 6198 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6199 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6200 | -s "skip PMS generation for opaque PSK"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6201 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6202 | -S "SSL - Unknown identity received" \ | 
|  | 6203 | -S "SSL - Verification of the message MAC failed" | 
|  | 6204 |  | 
|  | 6205 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6207 | 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] | 6208 | "$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" \ | 
|  | 6209 | "$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] | 6210 | psk_identity=def psk=beef" \ | 
|  | 6211 | 0 \ | 
|  | 6212 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6213 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6214 | -C "session hash for extended master secret"\ | 
|  | 6215 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6216 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6217 | -S "SSL - Unknown identity received" \ | 
|  | 6218 | -S "SSL - Verification of the message MAC failed" | 
|  | 6219 |  | 
|  | 6220 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6222 | 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] | 6223 | "$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" \ | 
|  | 6224 | "$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] | 6225 | psk_identity=def psk=beef" \ | 
|  | 6226 | 0 \ | 
|  | 6227 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6228 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6229 | -C "session hash for extended master secret"\ | 
|  | 6230 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6231 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6232 | -S "SSL - Unknown identity received" \ | 
|  | 6233 | -S "SSL - Verification of the message MAC failed" | 
|  | 6234 |  | 
|  | 6235 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6237 | 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] | 6238 | "$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] | 6239 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6240 | "$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] | 6241 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 6242 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6243 | -c "session hash for extended master secret"\ | 
|  | 6244 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6245 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6246 | -s "skip PMS generation for opaque PSK"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6247 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6248 | -S "SSL - Unknown identity received" \ | 
|  | 6249 | -S "SSL - Verification of the message MAC failed" | 
|  | 6250 |  | 
|  | 6251 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6253 | 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] | 6254 | "$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] | 6255 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6256 | "$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] | 6257 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 6258 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6259 | -c "session hash for extended master secret"\ | 
|  | 6260 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6261 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6262 | -s "skip PMS generation for opaque PSK"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6263 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6264 | -S "SSL - Unknown identity received" \ | 
|  | 6265 | -S "SSL - Verification of the message MAC failed" | 
|  | 6266 |  | 
|  | 6267 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6269 | 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] | 6270 | "$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" \ | 
|  | 6271 | "$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] | 6272 | psk_identity=def psk=beef" \ | 
|  | 6273 | 0 \ | 
|  | 6274 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6275 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6276 | -C "session hash for extended master secret"\ | 
|  | 6277 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6278 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6279 | -S "SSL - Unknown identity received" \ | 
|  | 6280 | -S "SSL - Verification of the message MAC failed" | 
|  | 6281 |  | 
|  | 6282 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6284 | 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] | 6285 | "$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" \ | 
|  | 6286 | "$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] | 6287 | psk_identity=def psk=beef" \ | 
|  | 6288 | 0 \ | 
|  | 6289 | -C "skip PMS generation for opaque PSK"\ | 
|  | 6290 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6291 | -C "session hash for extended master secret"\ | 
|  | 6292 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6293 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6294 | -S "SSL - Unknown identity received" \ | 
|  | 6295 | -S "SSL - Verification of the message MAC failed" | 
|  | 6296 |  | 
|  | 6297 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6299 | 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] | 6300 | "$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" \ | 
|  | 6301 | "$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] | 6302 | psk_identity=def psk=beef" \ | 
|  | 6303 | 0 \ | 
|  | 6304 | -C "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6305 | -C "session hash for extended master secret"\ | 
|  | 6306 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6307 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6308 | -S "SSL - Unknown identity received" \ | 
|  | 6309 | -S "SSL - Verification of the message MAC failed" | 
|  | 6310 |  | 
|  | 6311 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6313 | 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] | 6314 | "$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" \ | 
|  | 6315 | "$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] | 6316 | psk_identity=def psk=beef" \ | 
|  | 6317 | 0 \ | 
|  | 6318 | -C "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6319 | -C "session hash for extended master secret"\ | 
|  | 6320 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6321 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6322 | -S "SSL - Unknown identity received" \ | 
|  | 6323 | -S "SSL - Verification of the message MAC failed" | 
|  | 6324 |  | 
|  | 6325 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6327 | 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] | 6328 | "$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" \ | 
|  | 6329 | "$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] | 6330 | psk_identity=def psk=beef" \ | 
|  | 6331 | 1 \ | 
|  | 6332 | -s "SSL - Verification of the message MAC failed" | 
|  | 6333 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6334 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6335 | run_test    "PSK callback: no psk, no callback" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6336 | "$P_SRV" \ | 
|  | 6337 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 6338 | psk_identity=foo psk=abc123" \ | 
|  | 6339 | 1 \ | 
| Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 6340 | -s "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6341 | -S "SSL - Unknown identity received" \ | 
|  | 6342 | -S "SSL - Verification of the message MAC failed" | 
|  | 6343 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6345 | run_test    "PSK callback: callback overrides other settings" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6346 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ | 
|  | 6347 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 6348 | psk_identity=foo psk=abc123" \ | 
|  | 6349 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6350 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6351 | -s "SSL - Unknown identity received" \ | 
|  | 6352 | -S "SSL - Verification of the message MAC failed" | 
|  | 6353 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6355 | run_test    "PSK callback: first id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6356 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 6357 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 6358 | psk_identity=abc psk=dead" \ | 
|  | 6359 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6360 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6361 | -S "SSL - Unknown identity received" \ | 
|  | 6362 | -S "SSL - Verification of the message MAC failed" | 
|  | 6363 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6365 | run_test    "PSK callback: second id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6366 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 6367 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 6368 | psk_identity=def psk=beef" \ | 
|  | 6369 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6370 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6371 | -S "SSL - Unknown identity received" \ | 
|  | 6372 | -S "SSL - Verification of the message MAC failed" | 
|  | 6373 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6375 | run_test    "PSK callback: no match" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6376 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 6377 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 6378 | psk_identity=ghi psk=beef" \ | 
|  | 6379 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6380 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6381 | -s "SSL - Unknown identity received" \ | 
|  | 6382 | -S "SSL - Verification of the message MAC failed" | 
|  | 6383 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6385 | run_test    "PSK callback: wrong key" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6386 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 6387 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 6388 | psk_identity=abc psk=beef" \ | 
|  | 6389 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6390 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6391 | -S "SSL - Unknown identity received" \ | 
|  | 6392 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6393 |  | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6394 | # Tests for EC J-PAKE | 
|  | 6395 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6396 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6398 | run_test    "ECJPAKE: client not configured" \ | 
|  | 6399 | "$P_SRV debug_level=3" \ | 
|  | 6400 | "$P_CLI debug_level=3" \ | 
|  | 6401 | 0 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6402 | -C "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6403 | -C "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6404 | -S "found ecjpake kkpp extension" \ | 
|  | 6405 | -S "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6406 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6407 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6408 | -C "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6409 | -S "SSL - The handshake negotiation failed" | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6410 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6411 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6413 | run_test    "ECJPAKE: server not configured" \ | 
|  | 6414 | "$P_SRV debug_level=3" \ | 
|  | 6415 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 6416 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 6417 | 1 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6418 | -c "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6419 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6420 | -s "found ecjpake kkpp extension" \ | 
|  | 6421 | -s "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6422 | -s "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6423 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6424 | -C "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6425 | -s "SSL - The handshake negotiation failed" | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6426 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6427 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6429 | run_test    "ECJPAKE: working, TLS" \ | 
|  | 6430 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 6431 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 6432 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
| Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6433 | 0 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6434 | -c "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6435 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6436 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6437 | -s "found ecjpake kkpp extension" \ | 
|  | 6438 | -S "skip ecjpake kkpp extension" \ | 
|  | 6439 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6440 | -s "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6441 | -c "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6442 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6443 | -S "SSL - Verification of the message MAC failed" | 
|  | 6444 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6445 | server_needs_more_time 1 | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6446 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6448 | run_test    "ECJPAKE: password mismatch, TLS" \ | 
|  | 6449 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 6450 | "$P_CLI debug_level=3 ecjpake_pw=bad \ | 
|  | 6451 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 6452 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6453 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6454 | -s "SSL - Verification of the message MAC failed" | 
|  | 6455 |  | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6456 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6458 | run_test    "ECJPAKE: working, DTLS" \ | 
|  | 6459 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 6460 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 6461 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 6462 | 0 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6463 | -c "re-using cached ecjpake parameters" \ | 
|  | 6464 | -S "SSL - Verification of the message MAC failed" | 
|  | 6465 |  | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6466 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6468 | run_test    "ECJPAKE: working, DTLS, no cookie" \ | 
|  | 6469 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ | 
|  | 6470 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 6471 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 6472 | 0 \ | 
|  | 6473 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6474 | -S "SSL - Verification of the message MAC failed" | 
|  | 6475 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6476 | server_needs_more_time 1 | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6477 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6479 | run_test    "ECJPAKE: password mismatch, DTLS" \ | 
|  | 6480 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 6481 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ | 
|  | 6482 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 6483 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6484 | -c "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6485 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6486 |  | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6487 | # for tests with configs/config-thread.h | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6488 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6490 | run_test    "ECJPAKE: working, DTLS, nolog" \ | 
|  | 6491 | "$P_SRV dtls=1 ecjpake_pw=bla" \ | 
|  | 6492 | "$P_CLI dtls=1 ecjpake_pw=bla \ | 
|  | 6493 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 6494 | 0 | 
|  | 6495 |  | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6496 | # Test for ClientHello without extensions | 
|  | 6497 |  | 
| Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6498 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6500 | run_test    "ClientHello without extensions" \ | 
| Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6501 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6502 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6503 | 0 \ | 
|  | 6504 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 6505 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6506 | # Tests for mbedtls_ssl_get_bytes_avail() | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6507 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6509 | run_test    "mbedtls_ssl_get_bytes_avail: no extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6510 | "$P_SRV" \ | 
|  | 6511 | "$P_CLI request_size=100" \ | 
|  | 6512 | 0 \ | 
|  | 6513 | -s "Read from client: 100 bytes read$" | 
|  | 6514 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6516 | run_test    "mbedtls_ssl_get_bytes_avail: extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6517 | "$P_SRV" \ | 
|  | 6518 | "$P_CLI request_size=500" \ | 
|  | 6519 | 0 \ | 
|  | 6520 | -s "Read from client: 500 bytes read (.*+.*)" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6521 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6522 | # Tests for small client packets | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6523 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6525 | run_test    "Small client packet TLS 1.2 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6526 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6527 | "$P_CLI request_size=1 force_version=tls12 \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6528 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6529 | 0 \ | 
|  | 6530 | -s "Read from client: 1 bytes read" | 
|  | 6531 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6533 | run_test    "Small client packet TLS 1.2 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6534 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6535 | "$P_CLI request_size=1 force_version=tls12 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6536 | 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] | 6537 | 0 \ | 
|  | 6538 | -s "Read from client: 1 bytes read" | 
|  | 6539 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6541 | run_test    "Small client packet TLS 1.2 BlockCipher larger MAC" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6542 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6543 | "$P_CLI request_size=1 force_version=tls12 \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6544 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6545 | 0 \ | 
|  | 6546 | -s "Read from client: 1 bytes read" | 
|  | 6547 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6549 | run_test    "Small client packet TLS 1.2 AEAD" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6550 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6551 | "$P_CLI request_size=1 force_version=tls12 \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6552 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6553 | 0 \ | 
|  | 6554 | -s "Read from client: 1 bytes read" | 
|  | 6555 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6557 | run_test    "Small client packet TLS 1.2 AEAD shorter tag" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6558 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6559 | "$P_CLI request_size=1 force_version=tls12 \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6560 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6561 | 0 \ | 
|  | 6562 | -s "Read from client: 1 bytes read" | 
|  | 6563 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6564 | # Tests for small client packets in DTLS | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6565 |  | 
|  | 6566 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6568 | run_test    "Small client packet DTLS 1.2" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6569 | "$P_SRV dtls=1 force_version=dtls12" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6570 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 6571 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6572 | 0 \ | 
|  | 6573 | -s "Read from client: 1 bytes read" | 
|  | 6574 |  | 
|  | 6575 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6577 | run_test    "Small client packet DTLS 1.2, without EtM" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6578 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6579 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 6580 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6581 | 0 \ | 
|  | 6582 | -s "Read from client: 1 bytes read" | 
|  | 6583 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6584 | # Tests for small server packets | 
|  | 6585 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6587 | run_test    "Small server packet TLS 1.2 BlockCipher" \ | 
|  | 6588 | "$P_SRV response_size=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6589 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6590 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6591 | 0 \ | 
|  | 6592 | -c "Read from server: 1 bytes read" | 
|  | 6593 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6595 | run_test    "Small server packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 6596 | "$P_SRV response_size=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6597 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6598 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
|  | 6599 | 0 \ | 
|  | 6600 | -c "Read from server: 1 bytes read" | 
|  | 6601 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6603 | run_test    "Small server packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 6604 | "$P_SRV response_size=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6605 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6606 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
|  | 6607 | 0 \ | 
|  | 6608 | -c "Read from server: 1 bytes read" | 
|  | 6609 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6611 | run_test    "Small server packet TLS 1.2 AEAD" \ | 
|  | 6612 | "$P_SRV response_size=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6613 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6614 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6615 | 0 \ | 
|  | 6616 | -c "Read from server: 1 bytes read" | 
|  | 6617 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6619 | run_test    "Small server packet TLS 1.2 AEAD shorter tag" \ | 
|  | 6620 | "$P_SRV response_size=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6621 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6622 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6623 | 0 \ | 
|  | 6624 | -c "Read from server: 1 bytes read" | 
|  | 6625 |  | 
|  | 6626 | # Tests for small server packets in DTLS | 
|  | 6627 |  | 
|  | 6628 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6630 | run_test    "Small server packet DTLS 1.2" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6631 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6632 | "$P_CLI dtls=1 \ | 
|  | 6633 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6634 | 0 \ | 
|  | 6635 | -c "Read from server: 1 bytes read" | 
|  | 6636 |  | 
|  | 6637 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6639 | run_test    "Small server packet DTLS 1.2, without EtM" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6640 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6641 | "$P_CLI dtls=1 \ | 
|  | 6642 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6643 | 0 \ | 
|  | 6644 | -c "Read from server: 1 bytes read" | 
|  | 6645 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6646 | # Test for large client packets | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6647 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6648 | # How many fragments do we expect to write $1 bytes? | 
|  | 6649 | fragments_for_write() { | 
|  | 6650 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" | 
|  | 6651 | } | 
|  | 6652 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6654 | run_test    "Large client packet TLS 1.2 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6655 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6656 | "$P_CLI request_size=16384 force_version=tls12 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6657 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6658 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6659 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6660 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6661 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6663 | run_test    "Large client packet TLS 1.2 BlockCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6664 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6665 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6666 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6667 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6668 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6669 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6671 | run_test    "Large client packet TLS 1.2 BlockCipher larger MAC" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6672 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6673 | "$P_CLI request_size=16384 force_version=tls12 \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6674 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6675 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6676 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6677 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6678 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6680 | run_test    "Large client packet TLS 1.2 AEAD" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6681 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6682 | "$P_CLI request_size=16384 force_version=tls12 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6683 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6684 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6685 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6686 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6687 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6689 | run_test    "Large client packet TLS 1.2 AEAD shorter tag" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6690 | "$P_SRV" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6691 | "$P_CLI request_size=16384 force_version=tls12 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6692 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6693 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6694 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6695 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6696 |  | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6697 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6699 | run_test    "Large server packet TLS 1.2 BlockCipher" \ | 
|  | 6700 | "$P_SRV response_size=16384" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6701 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6702 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6703 | 0 \ | 
|  | 6704 | -c "Read from server: 16384 bytes read" | 
|  | 6705 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6707 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 6708 | "$P_SRV response_size=16384" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6709 | "$P_CLI force_version=tls12 etm=0 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6710 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6711 | 0 \ | 
|  | 6712 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6713 | -c "Read from server: 16384 bytes read" | 
|  | 6714 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6716 | run_test    "Large server packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 6717 | "$P_SRV response_size=16384" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6718 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6719 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
|  | 6720 | 0 \ | 
|  | 6721 | -c "Read from server: 16384 bytes read" | 
|  | 6722 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6724 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
|  | 6725 | "$P_SRV response_size=16384 trunc_hmac=1" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6726 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6727 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 6728 | 0 \ | 
|  | 6729 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6730 | -c "Read from server: 16384 bytes read" | 
|  | 6731 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6733 | run_test    "Large server packet TLS 1.2 AEAD" \ | 
|  | 6734 | "$P_SRV response_size=16384" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6735 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6736 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6737 | 0 \ | 
|  | 6738 | -c "Read from server: 16384 bytes read" | 
|  | 6739 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6741 | run_test    "Large server packet TLS 1.2 AEAD shorter tag" \ | 
|  | 6742 | "$P_SRV response_size=16384" \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6743 | "$P_CLI force_version=tls12 \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6745 | 0 \ | 
|  | 6746 | -c "Read from server: 16384 bytes read" | 
|  | 6747 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6748 | # Tests for restartable ECC | 
|  | 6749 |  | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6750 | # Force the use of a curve that supports restartable ECC (secp256r1). | 
|  | 6751 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6752 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6753 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6754 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6755 | run_test    "EC restart: TLS, default" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6756 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6757 | "$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] | 6758 | 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] | 6759 | debug_level=1" \ | 
|  | 6760 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6761 | -C "x509_verify_cert.*4b00" \ | 
|  | 6762 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6763 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6764 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6765 |  | 
|  | 6766 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6767 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6769 | run_test    "EC restart: TLS, max_ops=0" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6770 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6771 | "$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] | 6772 | 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] | 6773 | debug_level=1 ec_max_ops=0" \ | 
|  | 6774 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6775 | -C "x509_verify_cert.*4b00" \ | 
|  | 6776 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6777 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6778 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6779 |  | 
|  | 6780 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6781 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6783 | run_test    "EC restart: TLS, max_ops=65535" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6784 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6785 | "$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] | 6786 | 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] | 6787 | debug_level=1 ec_max_ops=65535" \ | 
|  | 6788 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6789 | -C "x509_verify_cert.*4b00" \ | 
|  | 6790 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6791 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6792 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6793 |  | 
|  | 6794 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6795 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6797 | run_test    "EC restart: TLS, max_ops=1000" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6798 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6799 | "$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] | 6800 | 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] | 6801 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6802 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6803 | -c "x509_verify_cert.*4b00" \ | 
|  | 6804 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6805 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6806 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6807 |  | 
|  | 6808 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6809 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6811 | run_test    "EC restart: TLS, max_ops=1000, badsign" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6812 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6813 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6814 | key_file=data_files/server5.key" \ | 
|  | 6815 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6816 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6817 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6818 | 1 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6819 | -c "x509_verify_cert.*4b00" \ | 
|  | 6820 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6821 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6822 | -C "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6823 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6824 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 6825 | -c "X509 - Certificate verification failed" | 
|  | 6826 |  | 
|  | 6827 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6828 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| 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 | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6830 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6831 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6832 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6833 | key_file=data_files/server5.key" \ | 
|  | 6834 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6835 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6836 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ | 
|  | 6837 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6838 | -c "x509_verify_cert.*4b00" \ | 
|  | 6839 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6840 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6841 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6842 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6843 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 6844 | -C "X509 - Certificate verification failed" | 
|  | 6845 |  | 
|  | 6846 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6847 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6849 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6850 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6851 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6852 | key_file=data_files/server5.key" \ | 
|  | 6853 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6854 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6855 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ | 
|  | 6856 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6857 | -C "x509_verify_cert.*4b00" \ | 
|  | 6858 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6859 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6860 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6861 | -C "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6862 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 6863 | -C "X509 - Certificate verification failed" | 
|  | 6864 |  | 
|  | 6865 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6866 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6868 | run_test    "EC restart: DTLS, max_ops=1000" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6869 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6870 | "$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] | 6871 | 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] | 6872 | dtls=1 debug_level=1 ec_max_ops=1000" \ | 
|  | 6873 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6874 | -c "x509_verify_cert.*4b00" \ | 
|  | 6875 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6876 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6877 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6878 |  | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6879 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6880 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6882 | run_test    "EC restart: TLS, max_ops=1000 no client auth" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6883 | "$P_SRV curves=secp256r1" \ | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6884 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6885 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6886 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6887 | -c "x509_verify_cert.*4b00" \ | 
|  | 6888 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6889 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6890 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6891 |  | 
|  | 6892 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6893 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6895 | run_test    "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6896 | "$P_SRV curves=secp256r1 psk=abc123" \ | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6897 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ | 
|  | 6898 | psk=abc123 debug_level=1 ec_max_ops=1000" \ | 
|  | 6899 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6900 | -C "x509_verify_cert.*4b00" \ | 
|  | 6901 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6902 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6903 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6904 |  | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6905 | # Tests of asynchronous private key support in SSL | 
|  | 6906 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6907 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6909 | run_test    "SSL async private: sign, delay=0" \ | 
|  | 6910 | "$P_SRV \ | 
|  | 6911 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6912 | "$P_CLI" \ | 
|  | 6913 | 0 \ | 
|  | 6914 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6915 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6916 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6917 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6919 | run_test    "SSL async private: sign, delay=1" \ | 
|  | 6920 | "$P_SRV \ | 
|  | 6921 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6922 | "$P_CLI" \ | 
|  | 6923 | 0 \ | 
|  | 6924 | -s "Async sign callback: using key slot " \ | 
|  | 6925 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6926 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 6927 |  | 
| Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6928 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6930 | run_test    "SSL async private: sign, delay=2" \ | 
|  | 6931 | "$P_SRV \ | 
|  | 6932 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ | 
|  | 6933 | "$P_CLI" \ | 
|  | 6934 | 0 \ | 
|  | 6935 | -s "Async sign callback: using key slot " \ | 
|  | 6936 | -U "Async sign callback: using key slot " \ | 
|  | 6937 | -s "Async resume (slot [0-9]): call 1 more times." \ | 
|  | 6938 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6939 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 6940 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6941 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6942 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6944 | run_test    "SSL async private: sign, SNI" \ | 
|  | 6945 | "$P_SRV debug_level=3 \ | 
|  | 6946 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ | 
|  | 6947 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6948 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 6949 | "$P_CLI server_name=polarssl.example" \ | 
|  | 6950 | 0 \ | 
|  | 6951 | -s "Async sign callback: using key slot " \ | 
|  | 6952 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 6953 | -s "parse ServerName extension" \ | 
|  | 6954 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 6955 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 6956 |  | 
|  | 6957 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6958 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6959 | run_test    "SSL async private: decrypt, delay=0" \ | 
|  | 6960 | "$P_SRV \ | 
|  | 6961 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 6962 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6963 | 0 \ | 
|  | 6964 | -s "Async decrypt callback: using key slot " \ | 
|  | 6965 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6966 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6967 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6969 | run_test    "SSL async private: decrypt, delay=1" \ | 
|  | 6970 | "$P_SRV \ | 
|  | 6971 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6972 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6973 | 0 \ | 
|  | 6974 | -s "Async decrypt callback: using key slot " \ | 
|  | 6975 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6976 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6977 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6978 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6980 | run_test    "SSL async private: decrypt RSA-PSK, delay=0" \ | 
|  | 6981 | "$P_SRV psk=abc123 \ | 
|  | 6982 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 6983 | "$P_CLI psk=abc123 \ | 
|  | 6984 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 6985 | 0 \ | 
|  | 6986 | -s "Async decrypt callback: using key slot " \ | 
|  | 6987 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6988 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6989 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6991 | run_test    "SSL async private: decrypt RSA-PSK, delay=1" \ | 
|  | 6992 | "$P_SRV psk=abc123 \ | 
|  | 6993 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6994 | "$P_CLI psk=abc123 \ | 
|  | 6995 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 6996 | 0 \ | 
|  | 6997 | -s "Async decrypt callback: using key slot " \ | 
|  | 6998 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6999 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 7000 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7001 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7003 | run_test    "SSL async private: sign callback not present" \ | 
|  | 7004 | "$P_SRV \ | 
|  | 7005 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 7006 | "$P_CLI; [ \$? -eq 1 ] && | 
|  | 7007 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7008 | 0 \ | 
|  | 7009 | -S "Async sign callback" \ | 
|  | 7010 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7011 | -s "The own private key or pre-shared key is not set, but needed" \ | 
|  | 7012 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ | 
|  | 7013 | -s "Successful connection" | 
|  | 7014 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7015 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7017 | run_test    "SSL async private: decrypt callback not present" \ | 
|  | 7018 | "$P_SRV debug_level=1 \ | 
|  | 7019 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
|  | 7020 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; | 
|  | 7021 | [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 7022 | 0 \ | 
|  | 7023 | -S "Async decrypt callback" \ | 
|  | 7024 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7025 | -s "got no RSA private key" \ | 
|  | 7026 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 7027 | -s "Successful connection" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7028 |  | 
|  | 7029 | # key1: ECDSA, key2: RSA; use key1 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7030 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7032 | run_test    "SSL async private: slot 0 used with key1" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7033 | "$P_SRV \ | 
|  | 7034 | async_operations=s async_private_delay1=1 \ | 
|  | 7035 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7036 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7037 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7038 | 0 \ | 
|  | 7039 | -s "Async sign callback: using key slot 0," \ | 
|  | 7040 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7041 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7042 |  | 
|  | 7043 | # key1: ECDSA, key2: RSA; use key2 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7044 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7046 | run_test    "SSL async private: slot 0 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7047 | "$P_SRV \ | 
|  | 7048 | async_operations=s async_private_delay2=1 \ | 
|  | 7049 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7050 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7051 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7052 | 0 \ | 
|  | 7053 | -s "Async sign callback: using key slot 0," \ | 
|  | 7054 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7055 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7056 |  | 
|  | 7057 | # key1: ECDSA, key2: RSA; use key2 from slot 1 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7058 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7060 | run_test    "SSL async private: slot 1 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7061 | "$P_SRV \ | 
| Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7062 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7063 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7064 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7065 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7066 | 0 \ | 
|  | 7067 | -s "Async sign callback: using key slot 1," \ | 
|  | 7068 | -s "Async resume (slot 1): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7069 | -s "Async resume (slot 1): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7070 |  | 
|  | 7071 | # key1: ECDSA, key2: RSA; use key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7072 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7074 | run_test    "SSL async private: fall back to transparent key" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7075 | "$P_SRV \ | 
|  | 7076 | async_operations=s async_private_delay1=1 \ | 
|  | 7077 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7078 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7079 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7080 | 0 \ | 
|  | 7081 | -s "Async sign callback: no key matches this certificate." | 
|  | 7082 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7083 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7085 | run_test    "SSL async private: sign, error in start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7086 | "$P_SRV \ | 
|  | 7087 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7088 | async_private_error=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7089 | "$P_CLI" \ | 
|  | 7090 | 1 \ | 
|  | 7091 | -s "Async sign callback: injected error" \ | 
|  | 7092 | -S "Async resume" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7093 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7094 | -s "! mbedtls_ssl_handshake returned" | 
|  | 7095 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7096 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7098 | run_test    "SSL async private: sign, cancel after start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7099 | "$P_SRV \ | 
|  | 7100 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7101 | async_private_error=2" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7102 | "$P_CLI" \ | 
|  | 7103 | 1 \ | 
|  | 7104 | -s "Async sign callback: using key slot " \ | 
|  | 7105 | -S "Async resume" \ | 
|  | 7106 | -s "Async cancel" | 
|  | 7107 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7108 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7110 | run_test    "SSL async private: sign, error in resume" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7111 | "$P_SRV \ | 
|  | 7112 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7113 | async_private_error=3" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7114 | "$P_CLI" \ | 
|  | 7115 | 1 \ | 
|  | 7116 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7117 | -s "Async resume callback: sign done but injected error" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7118 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7119 | -s "! mbedtls_ssl_handshake returned" | 
|  | 7120 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7121 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7123 | run_test    "SSL async private: decrypt, error in start" \ | 
|  | 7124 | "$P_SRV \ | 
|  | 7125 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7126 | async_private_error=1" \ | 
|  | 7127 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7128 | 1 \ | 
|  | 7129 | -s "Async decrypt callback: injected error" \ | 
|  | 7130 | -S "Async resume" \ | 
|  | 7131 | -S "Async cancel" \ | 
|  | 7132 | -s "! mbedtls_ssl_handshake returned" | 
|  | 7133 |  | 
|  | 7134 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7136 | run_test    "SSL async private: decrypt, cancel after start" \ | 
|  | 7137 | "$P_SRV \ | 
|  | 7138 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7139 | async_private_error=2" \ | 
|  | 7140 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7141 | 1 \ | 
|  | 7142 | -s "Async decrypt callback: using key slot " \ | 
|  | 7143 | -S "Async resume" \ | 
|  | 7144 | -s "Async cancel" | 
|  | 7145 |  | 
|  | 7146 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7148 | run_test    "SSL async private: decrypt, error in resume" \ | 
|  | 7149 | "$P_SRV \ | 
|  | 7150 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7151 | async_private_error=3" \ | 
|  | 7152 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7153 | 1 \ | 
|  | 7154 | -s "Async decrypt callback: using key slot " \ | 
|  | 7155 | -s "Async resume callback: decrypt done but injected error" \ | 
|  | 7156 | -S "Async cancel" \ | 
|  | 7157 | -s "! mbedtls_ssl_handshake returned" | 
|  | 7158 |  | 
|  | 7159 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7161 | run_test    "SSL async private: cancel after start then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7162 | "$P_SRV \ | 
|  | 7163 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7164 | async_private_error=-2" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7165 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 7166 | 0 \ | 
|  | 7167 | -s "Async cancel" \ | 
|  | 7168 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7169 | -s "Async resume" \ | 
|  | 7170 | -s "Successful connection" | 
|  | 7171 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7172 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7174 | run_test    "SSL async private: error in resume then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7175 | "$P_SRV \ | 
|  | 7176 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7177 | async_private_error=-3" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7178 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 7179 | 0 \ | 
|  | 7180 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7181 | -s "Async resume" \ | 
|  | 7182 | -s "Successful connection" | 
|  | 7183 |  | 
|  | 7184 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7187 | 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] | 7188 | "$P_SRV \ | 
|  | 7189 | async_operations=s async_private_delay1=1 async_private_error=-2 \ | 
|  | 7190 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7191 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7192 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 7193 | [ \$? -eq 1 ] && | 
|  | 7194 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7195 | 0 \ | 
| Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7196 | -s "Async sign callback: using key slot 0" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7197 | -S "Async resume" \ | 
|  | 7198 | -s "Async cancel" \ | 
|  | 7199 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7200 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 7201 | -s "Successful connection" | 
|  | 7202 |  | 
|  | 7203 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7204 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7206 | 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] | 7207 | "$P_SRV \ | 
|  | 7208 | async_operations=s async_private_delay1=1 async_private_error=-3 \ | 
|  | 7209 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7210 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7211 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 7212 | [ \$? -eq 1 ] && | 
|  | 7213 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7214 | 0 \ | 
|  | 7215 | -s "Async resume" \ | 
|  | 7216 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7217 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 7218 | -s "Successful connection" | 
|  | 7219 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7220 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7221 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7223 | run_test    "SSL async private: renegotiation: client-initiated, sign" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7224 | "$P_SRV \ | 
|  | 7225 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7226 | exchanges=2 renegotiation=1" \ | 
|  | 7227 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7228 | 0 \ | 
|  | 7229 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7230 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7231 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7232 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7233 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7235 | run_test    "SSL async private: renegotiation: server-initiated, sign" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7236 | "$P_SRV \ | 
|  | 7237 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7238 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7239 | "$P_CLI exchanges=2 renegotiation=1" \ | 
|  | 7240 | 0 \ | 
|  | 7241 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7242 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 7243 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7244 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7245 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7247 | run_test    "SSL async private: renegotiation: client-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7248 | "$P_SRV \ | 
|  | 7249 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7250 | exchanges=2 renegotiation=1" \ | 
|  | 7251 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 7252 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7253 | 0 \ | 
|  | 7254 | -s "Async decrypt callback: using key slot " \ | 
|  | 7255 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 7256 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7257 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7258 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7260 | run_test    "SSL async private: renegotiation: server-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7261 | "$P_SRV \ | 
|  | 7262 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7263 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7264 | "$P_CLI exchanges=2 renegotiation=1 \ | 
|  | 7265 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7266 | 0 \ | 
|  | 7267 | -s "Async decrypt callback: using key slot " \ | 
|  | 7268 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7269 |  | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7270 | # Tests for ECC extensions (rfc 4492) | 
|  | 7271 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7272 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7273 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7274 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7275 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7277 | run_test    "Force a non ECC ciphersuite in the client side" \ | 
|  | 7278 | "$P_SRV debug_level=3" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7279 | "$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] | 7280 | 0 \ | 
| Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7281 | -C "client hello, adding supported_groups extension" \ | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7282 | -C "client hello, adding supported_point_formats extension" \ | 
|  | 7283 | -S "found supported elliptic curves extension" \ | 
|  | 7284 | -S "found supported point formats extension" | 
|  | 7285 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7286 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7287 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7288 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7289 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7291 | run_test    "Force a non ECC ciphersuite in the server side" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7292 | "$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] | 7293 | "$P_CLI debug_level=3" \ | 
|  | 7294 | 0 \ | 
|  | 7295 | -C "found supported_point_formats extension" \ | 
|  | 7296 | -S "server hello, supported_point_formats extension" | 
|  | 7297 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7298 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7299 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7300 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7301 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7303 | run_test    "Force an ECC ciphersuite in the client side" \ | 
|  | 7304 | "$P_SRV debug_level=3" \ | 
|  | 7305 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7306 | 0 \ | 
| Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7307 | -c "client hello, adding supported_groups extension" \ | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7308 | -c "client hello, adding supported_point_formats extension" \ | 
|  | 7309 | -s "found supported elliptic curves extension" \ | 
|  | 7310 | -s "found supported point formats extension" | 
|  | 7311 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7312 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7313 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7314 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7315 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7317 | run_test    "Force an ECC ciphersuite in the server side" \ | 
|  | 7318 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7319 | "$P_CLI debug_level=3" \ | 
|  | 7320 | 0 \ | 
|  | 7321 | -c "found supported_point_formats extension" \ | 
|  | 7322 | -s "server hello, supported_point_formats extension" | 
|  | 7323 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7324 | # Tests for DTLS HelloVerifyRequest | 
|  | 7325 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7327 | run_test    "DTLS cookie: enabled" \ | 
|  | 7328 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 7329 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7330 | 0 \ | 
|  | 7331 | -s "cookie verification failed" \ | 
|  | 7332 | -s "cookie verification passed" \ | 
|  | 7333 | -S "cookie verification skipped" \ | 
|  | 7334 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7335 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7336 | -S "SSL - The requested feature is not available" | 
|  | 7337 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7339 | run_test    "DTLS cookie: disabled" \ | 
|  | 7340 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ | 
|  | 7341 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7342 | 0 \ | 
|  | 7343 | -S "cookie verification failed" \ | 
|  | 7344 | -S "cookie verification passed" \ | 
|  | 7345 | -s "cookie verification skipped" \ | 
|  | 7346 | -C "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7347 | -S "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7348 | -S "SSL - The requested feature is not available" | 
|  | 7349 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7351 | run_test    "DTLS cookie: default (failing)" \ | 
|  | 7352 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ | 
|  | 7353 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ | 
|  | 7354 | 1 \ | 
|  | 7355 | -s "cookie verification failed" \ | 
|  | 7356 | -S "cookie verification passed" \ | 
|  | 7357 | -S "cookie verification skipped" \ | 
|  | 7358 | -C "received hello verify request" \ | 
|  | 7359 | -S "hello verification requested" \ | 
|  | 7360 | -s "SSL - The requested feature is not available" | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7361 |  | 
|  | 7362 | requires_ipv6 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7364 | run_test    "DTLS cookie: enabled, IPv6" \ | 
|  | 7365 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 7366 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 7367 | 0 \ | 
|  | 7368 | -s "cookie verification failed" \ | 
|  | 7369 | -s "cookie verification passed" \ | 
|  | 7370 | -S "cookie verification skipped" \ | 
|  | 7371 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7372 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7373 | -S "SSL - The requested feature is not available" | 
|  | 7374 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7376 | run_test    "DTLS cookie: enabled, nbio" \ | 
|  | 7377 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ | 
|  | 7378 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7379 | 0 \ | 
|  | 7380 | -s "cookie verification failed" \ | 
|  | 7381 | -s "cookie verification passed" \ | 
|  | 7382 | -S "cookie verification skipped" \ | 
|  | 7383 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7384 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7385 | -S "SSL - The requested feature is not available" | 
|  | 7386 |  | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7387 | # Tests for client reconnecting from the same port with DTLS | 
|  | 7388 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7389 | not_with_valgrind # spurious resend | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7391 | run_test    "DTLS client reconnect from same port: reference" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7392 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ | 
|  | 7393 | "$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] | 7394 | 0 \ | 
|  | 7395 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7396 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7397 | -S "Client initiated reconnection from same port" | 
|  | 7398 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7399 | not_with_valgrind # spurious resend | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7401 | run_test    "DTLS client reconnect from same port: reconnect" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7402 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ | 
|  | 7403 | "$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] | 7404 | 0 \ | 
|  | 7405 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7406 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7407 | -s "Client initiated reconnection from same port" | 
|  | 7408 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7409 | 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] | 7410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7411 | 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] | 7412 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ | 
|  | 7413 | "$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] | 7414 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7415 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7416 | -s "Client initiated reconnection from same port" | 
|  | 7417 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7418 | 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] | 7419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7420 | run_test    "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ | 
|  | 7421 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ | 
|  | 7422 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ | 
|  | 7423 | 0 \ | 
|  | 7424 | -S "The operation timed out" \ | 
|  | 7425 | -s "Client initiated reconnection from same port" | 
|  | 7426 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7428 | run_test    "DTLS client reconnect from same port: no cookies" \ | 
|  | 7429 | "$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] | 7430 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ | 
|  | 7431 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7432 | -s "The operation timed out" \ | 
|  | 7433 | -S "Client initiated reconnection from same port" | 
|  | 7434 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7436 | run_test    "DTLS client reconnect from same port: attacker-injected" \ | 
|  | 7437 | -p "$P_PXY inject_clihlo=1" \ | 
|  | 7438 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ | 
|  | 7439 | "$P_CLI dtls=1 exchanges=2" \ | 
|  | 7440 | 0 \ | 
|  | 7441 | -s "possible client reconnect from the same port" \ | 
|  | 7442 | -S "Client initiated reconnection from same port" | 
|  | 7443 |  | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7444 | # Tests for various cases of client authentication with DTLS | 
|  | 7445 | # (focused on handshake flows and message parsing) | 
|  | 7446 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7448 | run_test    "DTLS client auth: required" \ | 
|  | 7449 | "$P_SRV dtls=1 auth_mode=required" \ | 
|  | 7450 | "$P_CLI dtls=1" \ | 
|  | 7451 | 0 \ | 
|  | 7452 | -s "Verifying peer X.509 certificate... ok" | 
|  | 7453 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7455 | run_test    "DTLS client auth: optional, client has no cert" \ | 
|  | 7456 | "$P_SRV dtls=1 auth_mode=optional" \ | 
|  | 7457 | "$P_CLI dtls=1 crt_file=none key_file=none" \ | 
|  | 7458 | 0 \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7459 | -s "! Certificate was missing" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7460 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7462 | run_test    "DTLS client auth: none, client has no cert" \ | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7463 | "$P_SRV dtls=1 auth_mode=none" \ | 
|  | 7464 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ | 
|  | 7465 | 0 \ | 
|  | 7466 | -c "skip write certificate$" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7467 | -s "! Certificate verification was skipped" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7468 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7470 | run_test    "DTLS wrong PSK: badmac alert" \ | 
|  | 7471 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ | 
|  | 7472 | "$P_CLI dtls=1 psk=abc124" \ | 
|  | 7473 | 1 \ | 
|  | 7474 | -s "SSL - Verification of the message MAC failed" \ | 
|  | 7475 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 7476 |  | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7477 | # Tests for receiving fragmented handshake messages with DTLS | 
|  | 7478 |  | 
|  | 7479 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7481 | run_test    "DTLS reassembly: no fragmentation (gnutls server)" \ | 
|  | 7482 | "$G_SRV -u --mtu 2048 -a" \ | 
|  | 7483 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7484 | 0 \ | 
|  | 7485 | -C "found fragmented DTLS handshake message" \ | 
|  | 7486 | -C "error" | 
|  | 7487 |  | 
|  | 7488 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7490 | run_test    "DTLS reassembly: some fragmentation (gnutls server)" \ | 
|  | 7491 | "$G_SRV -u --mtu 512" \ | 
|  | 7492 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7493 | 0 \ | 
|  | 7494 | -c "found fragmented DTLS handshake message" \ | 
|  | 7495 | -C "error" | 
|  | 7496 |  | 
|  | 7497 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7499 | run_test    "DTLS reassembly: more fragmentation (gnutls server)" \ | 
|  | 7500 | "$G_SRV -u --mtu 128" \ | 
|  | 7501 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7502 | 0 \ | 
|  | 7503 | -c "found fragmented DTLS handshake message" \ | 
|  | 7504 | -C "error" | 
|  | 7505 |  | 
|  | 7506 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7508 | run_test    "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ | 
|  | 7509 | "$G_SRV -u --mtu 128" \ | 
|  | 7510 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7511 | 0 \ | 
|  | 7512 | -c "found fragmented DTLS handshake message" \ | 
|  | 7513 | -C "error" | 
|  | 7514 |  | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7515 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7516 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7518 | run_test    "DTLS reassembly: fragmentation, renego (gnutls server)" \ | 
|  | 7519 | "$G_SRV -u --mtu 256" \ | 
|  | 7520 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 7521 | 0 \ | 
|  | 7522 | -c "found fragmented DTLS handshake message" \ | 
|  | 7523 | -c "client hello, adding renegotiation extension" \ | 
|  | 7524 | -c "found renegotiation extension" \ | 
|  | 7525 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7526 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7527 | -C "error" \ | 
|  | 7528 | -s "Extra-header:" | 
|  | 7529 |  | 
|  | 7530 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7531 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7533 | run_test    "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ | 
|  | 7534 | "$G_SRV -u --mtu 256" \ | 
|  | 7535 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 7536 | 0 \ | 
|  | 7537 | -c "found fragmented DTLS handshake message" \ | 
|  | 7538 | -c "client hello, adding renegotiation extension" \ | 
|  | 7539 | -c "found renegotiation extension" \ | 
|  | 7540 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7541 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7542 | -C "error" \ | 
|  | 7543 | -s "Extra-header:" | 
|  | 7544 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7546 | run_test    "DTLS reassembly: no fragmentation (openssl server)" \ | 
|  | 7547 | "$O_SRV -dtls -mtu 2048" \ | 
|  | 7548 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7549 | 0 \ | 
|  | 7550 | -C "found fragmented DTLS handshake message" \ | 
|  | 7551 | -C "error" | 
|  | 7552 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7554 | run_test    "DTLS reassembly: some fragmentation (openssl server)" \ | 
|  | 7555 | "$O_SRV -dtls -mtu 768" \ | 
|  | 7556 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7557 | 0 \ | 
|  | 7558 | -c "found fragmented DTLS handshake message" \ | 
|  | 7559 | -C "error" | 
|  | 7560 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7562 | run_test    "DTLS reassembly: more fragmentation (openssl server)" \ | 
|  | 7563 | "$O_SRV -dtls -mtu 256" \ | 
|  | 7564 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7565 | 0 \ | 
|  | 7566 | -c "found fragmented DTLS handshake message" \ | 
|  | 7567 | -C "error" | 
|  | 7568 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7570 | run_test    "DTLS reassembly: fragmentation, nbio (openssl server)" \ | 
|  | 7571 | "$O_SRV -dtls -mtu 256" \ | 
|  | 7572 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7573 | 0 \ | 
|  | 7574 | -c "found fragmented DTLS handshake message" \ | 
|  | 7575 | -C "error" | 
|  | 7576 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7577 | # Tests for sending fragmented handshake messages with DTLS | 
|  | 7578 | # | 
|  | 7579 | # Use client auth when we need the client to send large messages, | 
|  | 7580 | # and use large cert chains on both sides too (the long chains we have all use | 
|  | 7581 | # both RSA and ECDSA, but ideally we should have long chains with either). | 
|  | 7582 | # Sizes reached (UDP payload): | 
|  | 7583 | # - 2037B for server certificate | 
|  | 7584 | # - 1542B for client certificate | 
|  | 7585 | # - 1013B for newsessionticket | 
|  | 7586 | # - all others below 512B | 
|  | 7587 | # All those tests assume MAX_CONTENT_LEN is at least 2048 | 
|  | 7588 |  | 
|  | 7589 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7590 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7591 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7592 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7593 | requires_max_content_len 4096 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7595 | run_test    "DTLS fragmenting: none (for reference)" \ | 
|  | 7596 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7597 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7598 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7599 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7600 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7601 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7602 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7603 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7604 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7605 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7606 | 0 \ | 
|  | 7607 | -S "found fragmented DTLS handshake message" \ | 
|  | 7608 | -C "found fragmented DTLS handshake message" \ | 
|  | 7609 | -C "error" | 
|  | 7610 |  | 
|  | 7611 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7612 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7613 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7614 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7615 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7617 | run_test    "DTLS fragmenting: server only (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7618 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7619 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7620 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7621 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7622 | max_frag_len=1024" \ | 
|  | 7623 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7624 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7625 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7626 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7627 | max_frag_len=2048" \ | 
|  | 7628 | 0 \ | 
|  | 7629 | -S "found fragmented DTLS handshake message" \ | 
|  | 7630 | -c "found fragmented DTLS handshake message" \ | 
|  | 7631 | -C "error" | 
|  | 7632 |  | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7633 | # With the MFL extension, the server has no way of forcing | 
|  | 7634 | # the client to not exceed a certain MTU; hence, the following | 
|  | 7635 | # test can't be replicated with an MTU proxy such as the one | 
|  | 7636 | # `client-initiated, server only (max_frag_len)` below. | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7637 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7638 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7639 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7640 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7641 | requires_max_content_len 4096 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7643 | run_test    "DTLS fragmenting: server only (more) (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7644 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7645 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7646 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7647 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7648 | max_frag_len=512" \ | 
|  | 7649 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7650 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7651 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7652 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7653 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7654 | 0 \ | 
|  | 7655 | -S "found fragmented DTLS handshake message" \ | 
|  | 7656 | -c "found fragmented DTLS handshake message" \ | 
|  | 7657 | -C "error" | 
|  | 7658 |  | 
|  | 7659 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7660 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7661 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7662 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7663 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7665 | 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] | 7666 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 7667 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7668 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7669 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7670 | max_frag_len=2048" \ | 
|  | 7671 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7672 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7673 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7674 | hs_timeout=2500-60000 \ | 
|  | 7675 | max_frag_len=1024" \ | 
|  | 7676 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7677 | -S "found fragmented DTLS handshake message" \ | 
|  | 7678 | -c "found fragmented DTLS handshake message" \ | 
|  | 7679 | -C "error" | 
|  | 7680 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7681 | # While not required by the standard defining the MFL extension | 
|  | 7682 | # (according to which it only applies to records, not to datagrams), | 
|  | 7683 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 7684 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 7685 | # to the peer. | 
|  | 7686 | # The next test checks that no datagrams significantly larger than the | 
|  | 7687 | # negotiated MFL are sent. | 
|  | 7688 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7689 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7690 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7691 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7692 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7694 | 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] | 7695 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7696 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 7697 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7698 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7699 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7700 | max_frag_len=2048" \ | 
|  | 7701 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7702 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7703 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7704 | hs_timeout=2500-60000 \ | 
|  | 7705 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7706 | 0 \ | 
|  | 7707 | -S "found fragmented DTLS handshake message" \ | 
|  | 7708 | -c "found fragmented DTLS handshake message" \ | 
|  | 7709 | -C "error" | 
|  | 7710 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7711 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7712 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7713 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7714 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7715 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7717 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7718 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7719 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7720 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7721 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7722 | max_frag_len=2048" \ | 
|  | 7723 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7724 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7725 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7726 | hs_timeout=2500-60000 \ | 
|  | 7727 | max_frag_len=1024" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7728 | 0 \ | 
|  | 7729 | -s "found fragmented DTLS handshake message" \ | 
|  | 7730 | -c "found fragmented DTLS handshake message" \ | 
|  | 7731 | -C "error" | 
|  | 7732 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7733 | # While not required by the standard defining the MFL extension | 
|  | 7734 | # (according to which it only applies to records, not to datagrams), | 
|  | 7735 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 7736 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 7737 | # to the peer. | 
|  | 7738 | # The next test checks that no datagrams significantly larger than the | 
|  | 7739 | # negotiated MFL are sent. | 
|  | 7740 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7741 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7742 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7743 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7744 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7746 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ | 
| Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7747 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7748 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7749 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7750 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7751 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7752 | max_frag_len=2048" \ | 
|  | 7753 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7754 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7755 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7756 | hs_timeout=2500-60000 \ | 
|  | 7757 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7758 | 0 \ | 
|  | 7759 | -s "found fragmented DTLS handshake message" \ | 
|  | 7760 | -c "found fragmented DTLS handshake message" \ | 
|  | 7761 | -C "error" | 
|  | 7762 |  | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7763 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7764 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7765 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7766 | requires_max_content_len 4096 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7768 | run_test    "DTLS fragmenting: none (for reference) (MTU)" \ | 
|  | 7769 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7770 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7771 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7772 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7773 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7774 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7775 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7776 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7777 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7778 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7779 | 0 \ | 
|  | 7780 | -S "found fragmented DTLS handshake message" \ | 
|  | 7781 | -C "found fragmented DTLS handshake message" \ | 
|  | 7782 | -C "error" | 
|  | 7783 |  | 
|  | 7784 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7785 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7786 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7787 | requires_max_content_len 4096 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7789 | run_test    "DTLS fragmenting: client (MTU)" \ | 
|  | 7790 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7791 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7792 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7793 | hs_timeout=3500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7794 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7795 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7796 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7797 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7798 | hs_timeout=3500-60000 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7799 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7800 | 0 \ | 
|  | 7801 | -s "found fragmented DTLS handshake message" \ | 
|  | 7802 | -C "found fragmented DTLS handshake message" \ | 
|  | 7803 | -C "error" | 
|  | 7804 |  | 
|  | 7805 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7806 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7807 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7808 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7810 | run_test    "DTLS fragmenting: server (MTU)" \ | 
|  | 7811 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7812 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7813 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7814 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7815 | mtu=512" \ | 
|  | 7816 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7817 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7818 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7819 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7820 | mtu=2048" \ | 
|  | 7821 | 0 \ | 
|  | 7822 | -S "found fragmented DTLS handshake message" \ | 
|  | 7823 | -c "found fragmented DTLS handshake message" \ | 
|  | 7824 | -C "error" | 
|  | 7825 |  | 
|  | 7826 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7827 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7828 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7829 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7831 | run_test    "DTLS fragmenting: both (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7832 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7833 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7834 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7835 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7836 | hs_timeout=2500-60000 \ | 
| Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7837 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7838 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7839 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7840 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7841 | hs_timeout=2500-60000 \ | 
|  | 7842 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7843 | 0 \ | 
|  | 7844 | -s "found fragmented DTLS handshake message" \ | 
|  | 7845 | -c "found fragmented DTLS handshake message" \ | 
|  | 7846 | -C "error" | 
|  | 7847 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7848 | # 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] | 7849 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7850 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7851 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7852 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7853 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7854 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7855 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7856 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7858 | run_test    "DTLS fragmenting: both (MTU=512)" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7859 | -p "$P_PXY mtu=512" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7860 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7861 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7862 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7863 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7864 | mtu=512" \ | 
|  | 7865 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7866 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7867 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7868 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7869 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7870 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7871 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7872 | -s "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7873 | -c "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7874 | -C "error" | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7875 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7876 | # Test for automatic MTU reduction on repeated resend. | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7877 | # 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] | 7878 | # The ratio of max/min timeout should ideally equal 4 to accept two | 
|  | 7879 | # retransmissions, but in some cases (like both the server and client using | 
|  | 7880 | # fragmentation and auto-reduction) an extra retransmission might occur, | 
|  | 7881 | # hence the ratio of 8. | 
| Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7882 | not_with_valgrind | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7883 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7884 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7885 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7886 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7887 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7888 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7889 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7890 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7891 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7892 | -p "$P_PXY mtu=508" \ | 
|  | 7893 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7894 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7895 | key_file=data_files/server7.key \ | 
|  | 7896 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7897 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7898 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7899 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7900 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7901 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7902 | 0 \ | 
|  | 7903 | -s "found fragmented DTLS handshake message" \ | 
|  | 7904 | -c "found fragmented DTLS handshake message" \ | 
|  | 7905 | -C "error" | 
|  | 7906 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7907 | # 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] | 7908 | only_with_valgrind | 
|  | 7909 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7910 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7911 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7912 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7913 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7914 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7915 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7916 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7917 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7918 | -p "$P_PXY mtu=508" \ | 
|  | 7919 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7920 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7921 | key_file=data_files/server7.key \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7922 | hs_timeout=250-10000" \ | 
|  | 7923 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7924 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7925 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7926 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7927 | hs_timeout=250-10000" \ | 
|  | 7928 | 0 \ | 
|  | 7929 | -s "found fragmented DTLS handshake message" \ | 
|  | 7930 | -c "found fragmented DTLS handshake message" \ | 
|  | 7931 | -C "error" | 
|  | 7932 |  | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7933 | # 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] | 7934 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 7935 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7936 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7937 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7938 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7939 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7940 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7942 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7943 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7944 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7945 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7946 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7947 | hs_timeout=10000-60000 \ | 
|  | 7948 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7949 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7950 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7951 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7952 | hs_timeout=10000-60000 \ | 
|  | 7953 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7954 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7955 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7956 | -s "found fragmented DTLS handshake message" \ | 
|  | 7957 | -c "found fragmented DTLS handshake message" \ | 
|  | 7958 | -C "error" | 
|  | 7959 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7960 | # 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] | 7961 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend | 
|  | 7962 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 7963 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7964 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7965 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7966 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7967 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7968 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7969 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7970 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7971 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7973 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7974 | -p "$P_PXY mtu=512" \ | 
|  | 7975 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7976 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7977 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7978 | hs_timeout=10000-60000 \ | 
|  | 7979 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7980 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7981 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7982 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7983 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7984 | hs_timeout=10000-60000 \ | 
|  | 7985 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7986 | 0 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7987 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7988 | -s "found fragmented DTLS handshake message" \ | 
|  | 7989 | -c "found fragmented DTLS handshake message" \ | 
|  | 7990 | -C "error" | 
|  | 7991 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7992 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 7993 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7994 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7995 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7996 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7998 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7999 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8000 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8001 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8002 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8003 | hs_timeout=10000-60000 \ | 
|  | 8004 | mtu=1024 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8005 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8006 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8007 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8008 | hs_timeout=10000-60000 \ | 
|  | 8009 | mtu=1024 nbio=2" \ | 
|  | 8010 | 0 \ | 
|  | 8011 | -S "autoreduction" \ | 
|  | 8012 | -s "found fragmented DTLS handshake message" \ | 
|  | 8013 | -c "found fragmented DTLS handshake message" \ | 
|  | 8014 | -C "error" | 
|  | 8015 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8016 | # 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] | 8017 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 8018 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8019 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8020 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8021 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8022 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8023 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8024 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8026 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ | 
|  | 8027 | -p "$P_PXY mtu=512" \ | 
|  | 8028 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8029 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8030 | key_file=data_files/server7.key \ | 
|  | 8031 | hs_timeout=10000-60000 \ | 
|  | 8032 | mtu=512 nbio=2" \ | 
|  | 8033 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8034 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8035 | key_file=data_files/server8.key \ | 
|  | 8036 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8037 | hs_timeout=10000-60000 \ | 
|  | 8038 | mtu=512 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8039 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8040 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8041 | -s "found fragmented DTLS handshake message" \ | 
|  | 8042 | -c "found fragmented DTLS handshake message" \ | 
|  | 8043 | -C "error" | 
|  | 8044 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8045 | # 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] | 8046 | # This ensures things still work after session_reset(). | 
|  | 8047 | # It also exercises the "resumed handshake" flow. | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8048 | # Since we don't support reading fragmented ClientHello yet, | 
|  | 8049 | # up the MTU to 1450 (larger than ClientHello with session ticket, | 
|  | 8050 | # but still smaller than client's Certificate to ensure fragmentation). | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8051 | # An autoreduction on the client-side might happen if the server is | 
|  | 8052 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
| Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8053 | # reco_delay avoids races where the client reconnects before the server has | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8054 | # resumed listening, which would result in a spurious autoreduction. | 
|  | 8055 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8056 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8057 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8058 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8059 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8060 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8061 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8062 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8064 | run_test    "DTLS fragmenting: proxy MTU, resumed handshake" \ | 
|  | 8065 | -p "$P_PXY mtu=1450" \ | 
|  | 8066 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8067 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8068 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8069 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8070 | mtu=1450" \ | 
|  | 8071 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8072 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8073 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8074 | hs_timeout=10000-60000 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8075 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8076 | mtu=1450 reconnect=1 skip_close_notify=1 reco_delay=1" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8077 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8078 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8079 | -s "found fragmented DTLS handshake message" \ | 
|  | 8080 | -c "found fragmented DTLS handshake message" \ | 
|  | 8081 | -C "error" | 
|  | 8082 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8083 | # An autoreduction on the client-side might happen if the server is | 
|  | 8084 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8085 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8086 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8087 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8088 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8089 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8090 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8091 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8092 | requires_config_enabled MBEDTLS_CHACHAPOLY_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8093 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8095 | run_test    "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ | 
|  | 8096 | -p "$P_PXY mtu=512" \ | 
|  | 8097 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8098 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8099 | key_file=data_files/server7.key \ | 
|  | 8100 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8101 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8102 | mtu=512" \ | 
|  | 8103 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8104 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8105 | key_file=data_files/server8.key \ | 
|  | 8106 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8107 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8108 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8109 | mtu=512" \ | 
|  | 8110 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8111 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8112 | -s "found fragmented DTLS handshake message" \ | 
|  | 8113 | -c "found fragmented DTLS handshake message" \ | 
|  | 8114 | -C "error" | 
|  | 8115 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8116 | # An autoreduction on the client-side might happen if the server is | 
|  | 8117 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8118 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8119 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8120 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8121 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8122 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8123 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8124 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8125 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8126 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8127 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8129 | run_test    "DTLS fragmenting: proxy MTU, AES-GCM renego" \ | 
|  | 8130 | -p "$P_PXY mtu=512" \ | 
|  | 8131 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8132 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8133 | key_file=data_files/server7.key \ | 
|  | 8134 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8135 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8136 | mtu=512" \ | 
|  | 8137 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8138 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8139 | key_file=data_files/server8.key \ | 
|  | 8140 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8141 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8142 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8143 | mtu=512" \ | 
|  | 8144 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8145 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8146 | -s "found fragmented DTLS handshake message" \ | 
|  | 8147 | -c "found fragmented DTLS handshake message" \ | 
|  | 8148 | -C "error" | 
|  | 8149 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8150 | # An autoreduction on the client-side might happen if the server is | 
|  | 8151 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8152 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8153 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8154 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8155 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8156 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8157 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8158 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8159 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8160 | requires_config_enabled MBEDTLS_CCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8161 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8163 | run_test    "DTLS fragmenting: proxy MTU, AES-CCM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8164 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8165 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8166 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8167 | key_file=data_files/server7.key \ | 
|  | 8168 | exchanges=2 renegotiation=1 \ | 
|  | 8169 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8170 | hs_timeout=10000-60000 \ | 
|  | 8171 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8172 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8173 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8174 | key_file=data_files/server8.key \ | 
|  | 8175 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8176 | hs_timeout=10000-60000 \ | 
|  | 8177 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8178 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8179 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8180 | -s "found fragmented DTLS handshake message" \ | 
|  | 8181 | -c "found fragmented DTLS handshake message" \ | 
|  | 8182 | -C "error" | 
|  | 8183 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8184 | # An autoreduction on the client-side might happen if the server is | 
|  | 8185 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8186 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8187 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8188 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8189 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8190 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8191 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8192 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8193 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8194 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 8195 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8196 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8198 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8199 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8200 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8201 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8202 | key_file=data_files/server7.key \ | 
|  | 8203 | exchanges=2 renegotiation=1 \ | 
|  | 8204 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8205 | hs_timeout=10000-60000 \ | 
|  | 8206 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8207 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8208 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8209 | key_file=data_files/server8.key \ | 
|  | 8210 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8211 | hs_timeout=10000-60000 \ | 
|  | 8212 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8213 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8214 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8215 | -s "found fragmented DTLS handshake message" \ | 
|  | 8216 | -c "found fragmented DTLS handshake message" \ | 
|  | 8217 | -C "error" | 
|  | 8218 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8219 | # An autoreduction on the client-side might happen if the server is | 
|  | 8220 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8221 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8222 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8223 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8224 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8225 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8226 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8227 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8228 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8229 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8230 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8232 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8233 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8234 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8235 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8236 | key_file=data_files/server7.key \ | 
|  | 8237 | exchanges=2 renegotiation=1 \ | 
|  | 8238 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8239 | hs_timeout=10000-60000 \ | 
|  | 8240 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8241 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8242 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8243 | key_file=data_files/server8.key \ | 
|  | 8244 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8245 | hs_timeout=10000-60000 \ | 
|  | 8246 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8247 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8248 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8249 | -s "found fragmented DTLS handshake message" \ | 
|  | 8250 | -c "found fragmented DTLS handshake message" \ | 
|  | 8251 | -C "error" | 
|  | 8252 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8253 | # 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] | 8254 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8255 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8256 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8257 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8258 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8259 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8260 | client_needs_more_time 2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8261 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8263 | run_test    "DTLS fragmenting: proxy MTU + 3d" \ | 
|  | 8264 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8265 | "$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] | 8266 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8267 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8268 | hs_timeout=250-10000 mtu=512" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8269 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8270 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8271 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8272 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8273 | hs_timeout=250-10000 mtu=512" \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8274 | 0 \ | 
|  | 8275 | -s "found fragmented DTLS handshake message" \ | 
|  | 8276 | -c "found fragmented DTLS handshake message" \ | 
|  | 8277 | -C "error" | 
|  | 8278 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8279 | # 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] | 8280 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8281 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8282 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8283 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8284 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8285 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8286 | client_needs_more_time 2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8287 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8289 | run_test    "DTLS fragmenting: proxy MTU + 3d, nbio" \ | 
|  | 8290 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
|  | 8291 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8292 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8293 | key_file=data_files/server7.key \ | 
|  | 8294 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 8295 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8296 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8297 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8298 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8299 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 8300 | 0 \ | 
|  | 8301 | -s "found fragmented DTLS handshake message" \ | 
|  | 8302 | -c "found fragmented DTLS handshake message" \ | 
|  | 8303 | -C "error" | 
|  | 8304 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8305 | # interop tests for DTLS fragmentating with reliable connection | 
|  | 8306 | # | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8307 | # here and below we just want to test that the we fragment in a way that | 
|  | 8308 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 8309 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8310 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8311 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8313 | requires_gnutls | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8314 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8316 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.2" \ | 
|  | 8317 | "$G_SRV -u" \ | 
|  | 8318 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8319 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8320 | key_file=data_files/server8.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8321 | mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8322 | 0 \ | 
|  | 8323 | -c "fragmenting handshake message" \ | 
|  | 8324 | -C "error" | 
|  | 8325 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8326 | # We use --insecure for the GnuTLS client because it expects | 
|  | 8327 | # the hostname / IP it connects to to be the name used in the | 
|  | 8328 | # certificate obtained from the server. Here, however, it | 
|  | 8329 | # connects to 127.0.0.1 while our test certificates use 'localhost' | 
|  | 8330 | # as the server name in the certificate. This will make the | 
|  | 8331 | # certifiate validation fail, but passing --insecure makes | 
|  | 8332 | # GnuTLS continue the connection nonetheless. | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8333 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8334 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8335 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8337 | requires_gnutls | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8338 | requires_not_i686 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8339 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8341 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8342 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8343 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8344 | key_file=data_files/server7.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8345 | mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8346 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8347 | 0 \ | 
|  | 8348 | -s "fragmenting handshake message" | 
|  | 8349 |  | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8350 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8351 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8352 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8354 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8356 | run_test    "DTLS fragmenting: openssl server, DTLS 1.2" \ | 
|  | 8357 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 8358 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8359 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8360 | key_file=data_files/server8.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8361 | mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8362 | 0 \ | 
|  | 8363 | -c "fragmenting handshake message" \ | 
|  | 8364 | -C "error" | 
|  | 8365 |  | 
|  | 8366 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8367 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8368 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8370 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8372 | run_test    "DTLS fragmenting: openssl client, DTLS 1.2" \ | 
|  | 8373 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8374 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8375 | key_file=data_files/server7.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8376 | mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8377 | "$O_CLI -dtls1_2" \ | 
|  | 8378 | 0 \ | 
|  | 8379 | -s "fragmenting handshake message" | 
|  | 8380 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8381 | # interop tests for DTLS fragmentating with unreliable connection | 
|  | 8382 | # | 
|  | 8383 | # again we just want to test that the we fragment in a way that | 
|  | 8384 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 8385 | requires_gnutls_next | 
|  | 8386 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8387 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8388 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8389 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8390 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8391 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8393 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ | 
|  | 8394 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8395 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8396 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8397 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8398 | key_file=data_files/server8.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8399 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8400 | 0 \ | 
|  | 8401 | -c "fragmenting handshake message" \ | 
|  | 8402 | -C "error" | 
|  | 8403 |  | 
|  | 8404 | requires_gnutls_next | 
|  | 8405 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8406 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8407 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8409 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8410 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8412 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ | 
|  | 8413 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8414 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8415 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8416 | key_file=data_files/server7.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8417 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8418 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8419 | 0 \ | 
|  | 8420 | -s "fragmenting handshake message" | 
|  | 8421 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8422 | ## Interop test with OpenSSL might trigger a bug in recent versions (including | 
|  | 8423 | ## all versions installed on the CI machines), reported here: | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8424 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8425 | ## They should be re-enabled once a fixed version of OpenSSL is available | 
|  | 8426 | ## (this should happen in some 1.1.1_ release according to the ticket). | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8427 | skip_next_test | 
|  | 8428 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8429 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8430 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8432 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8433 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8435 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ | 
|  | 8436 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8437 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 8438 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8439 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8440 | key_file=data_files/server8.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8441 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8442 | 0 \ | 
|  | 8443 | -c "fragmenting handshake message" \ | 
|  | 8444 | -C "error" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8445 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8446 | skip_next_test | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8447 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8448 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8449 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8451 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8452 | requires_max_content_len 2048 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8454 | run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ | 
|  | 8455 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8456 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8457 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8458 | key_file=data_files/server7.key \ | 
| Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8459 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8460 | "$O_CLI -dtls1_2" \ | 
|  | 8461 | 0 \ | 
|  | 8462 | -s "fragmenting handshake message" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8463 |  | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8464 | # Tests for DTLS-SRTP (RFC 5764) | 
|  | 8465 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8467 | run_test  "DTLS-SRTP all profiles supported" \ | 
|  | 8468 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8469 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8470 | 0 \ | 
|  | 8471 | -s "found use_srtp extension" \ | 
|  | 8472 | -s "found srtp profile" \ | 
|  | 8473 | -s "selected srtp profile" \ | 
|  | 8474 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8475 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8476 | -c "client hello, adding use_srtp extension" \ | 
|  | 8477 | -c "found use_srtp extension" \ | 
|  | 8478 | -c "found srtp profile" \ | 
|  | 8479 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8480 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8481 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8482 | -C "error" | 
|  | 8483 |  | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8484 |  | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8485 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8487 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile." \ | 
|  | 8488 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8489 | "$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] | 8490 | 0 \ | 
|  | 8491 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8492 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
|  | 8493 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8494 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8495 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8496 | -c "client hello, adding use_srtp extension" \ | 
|  | 8497 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8498 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8499 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8500 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8501 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8502 | -C "error" | 
|  | 8503 |  | 
|  | 8504 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8506 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles." \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8507 | "$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] | 8508 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8509 | 0 \ | 
|  | 8510 | -s "found use_srtp extension" \ | 
|  | 8511 | -s "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8512 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8513 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8514 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8515 | -c "client hello, adding use_srtp extension" \ | 
|  | 8516 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8517 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8518 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8519 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8520 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8521 | -C "error" | 
|  | 8522 |  | 
|  | 8523 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8525 | run_test  "DTLS-SRTP server and Client support only one matching profile." \ | 
|  | 8526 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8527 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8528 | 0 \ | 
|  | 8529 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8530 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 8531 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8532 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8533 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8534 | -c "client hello, adding use_srtp extension" \ | 
|  | 8535 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8536 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8537 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8538 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8539 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8540 | -C "error" | 
|  | 8541 |  | 
|  | 8542 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8544 | run_test  "DTLS-SRTP server and Client support only one different profile." \ | 
|  | 8545 | "$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] | 8546 | "$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] | 8547 | 0 \ | 
|  | 8548 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8549 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8550 | -S "selected srtp profile" \ | 
|  | 8551 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8552 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8553 | -c "client hello, adding use_srtp extension" \ | 
|  | 8554 | -C "found use_srtp extension" \ | 
|  | 8555 | -C "found srtp profile" \ | 
|  | 8556 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8557 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8558 | -C "error" | 
|  | 8559 |  | 
|  | 8560 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8562 | run_test  "DTLS-SRTP server doesn't support use_srtp extension." \ | 
|  | 8563 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 8564 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8565 | 0 \ | 
|  | 8566 | -s "found use_srtp extension" \ | 
|  | 8567 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8568 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8569 | -c "client hello, adding use_srtp extension" \ | 
|  | 8570 | -C "found use_srtp extension" \ | 
|  | 8571 | -C "found srtp profile" \ | 
|  | 8572 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8573 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8574 | -C "error" | 
|  | 8575 |  | 
|  | 8576 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8578 | run_test  "DTLS-SRTP all profiles supported. mki used" \ | 
|  | 8579 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ | 
|  | 8580 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 8581 | 0 \ | 
|  | 8582 | -s "found use_srtp extension" \ | 
|  | 8583 | -s "found srtp profile" \ | 
|  | 8584 | -s "selected srtp profile" \ | 
|  | 8585 | -s "server hello, adding use_srtp extension" \ | 
|  | 8586 | -s "dumping 'using mki' (8 bytes)" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8587 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8588 | -c "client hello, adding use_srtp extension" \ | 
|  | 8589 | -c "found use_srtp extension" \ | 
|  | 8590 | -c "found srtp profile" \ | 
|  | 8591 | -c "selected srtp profile" \ | 
|  | 8592 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 8593 | -c "dumping 'received mki' (8 bytes)" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8594 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8595 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8596 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8597 | -C "error" | 
|  | 8598 |  | 
|  | 8599 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8601 | run_test  "DTLS-SRTP all profiles supported. server doesn't support mki." \ | 
|  | 8602 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8603 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 8604 | 0 \ | 
|  | 8605 | -s "found use_srtp extension" \ | 
|  | 8606 | -s "found srtp profile" \ | 
|  | 8607 | -s "selected srtp profile" \ | 
|  | 8608 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8609 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8610 | -s "DTLS-SRTP no mki value negotiated"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8611 | -S "dumping 'using mki' (8 bytes)" \ | 
|  | 8612 | -c "client hello, adding use_srtp extension" \ | 
|  | 8613 | -c "found use_srtp extension" \ | 
|  | 8614 | -c "found srtp profile" \ | 
|  | 8615 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8616 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8617 | -c "DTLS-SRTP no mki value negotiated"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8618 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8619 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 8620 | -C "dumping 'received mki' (8 bytes)" \ | 
|  | 8621 | -C "error" | 
|  | 8622 |  | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8623 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8625 | run_test  "DTLS-SRTP all profiles supported. openssl client." \ | 
|  | 8626 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8627 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8628 | 0 \ | 
|  | 8629 | -s "found use_srtp extension" \ | 
|  | 8630 | -s "found srtp profile" \ | 
|  | 8631 | -s "selected srtp profile" \ | 
|  | 8632 | -s "server hello, adding use_srtp extension" \ | 
|  | 8633 | -s "DTLS-SRTP key material is"\ | 
|  | 8634 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 8635 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" | 
|  | 8636 |  | 
|  | 8637 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8639 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ | 
|  | 8640 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8641 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8642 | 0 \ | 
|  | 8643 | -s "found use_srtp extension" \ | 
|  | 8644 | -s "found srtp profile" \ | 
|  | 8645 | -s "selected srtp profile" \ | 
|  | 8646 | -s "server hello, adding use_srtp extension" \ | 
|  | 8647 | -s "DTLS-SRTP key material is"\ | 
|  | 8648 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 8649 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 8650 |  | 
|  | 8651 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8653 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ | 
|  | 8654 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8655 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8656 | 0 \ | 
|  | 8657 | -s "found use_srtp extension" \ | 
|  | 8658 | -s "found srtp profile" \ | 
|  | 8659 | -s "selected srtp profile" \ | 
|  | 8660 | -s "server hello, adding use_srtp extension" \ | 
|  | 8661 | -s "DTLS-SRTP key material is"\ | 
|  | 8662 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 8663 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 8664 |  | 
|  | 8665 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8667 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ | 
|  | 8668 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8669 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8670 | 0 \ | 
|  | 8671 | -s "found use_srtp extension" \ | 
|  | 8672 | -s "found srtp profile" \ | 
|  | 8673 | -s "selected srtp profile" \ | 
|  | 8674 | -s "server hello, adding use_srtp extension" \ | 
|  | 8675 | -s "DTLS-SRTP key material is"\ | 
|  | 8676 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 8677 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 8678 |  | 
|  | 8679 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8681 | run_test  "DTLS-SRTP server and Client support only one matching profile. openssl client." \ | 
|  | 8682 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8683 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8684 | 0 \ | 
|  | 8685 | -s "found use_srtp extension" \ | 
|  | 8686 | -s "found srtp profile" \ | 
|  | 8687 | -s "selected srtp profile" \ | 
|  | 8688 | -s "server hello, adding use_srtp extension" \ | 
|  | 8689 | -s "DTLS-SRTP key material is"\ | 
|  | 8690 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 8691 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 8692 |  | 
|  | 8693 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8695 | run_test  "DTLS-SRTP server and Client support only one different profile. openssl client." \ | 
|  | 8696 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ | 
|  | 8697 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8698 | 0 \ | 
|  | 8699 | -s "found use_srtp extension" \ | 
|  | 8700 | -s "found srtp profile" \ | 
|  | 8701 | -S "selected srtp profile" \ | 
|  | 8702 | -S "server hello, adding use_srtp extension" \ | 
|  | 8703 | -S "DTLS-SRTP key material is"\ | 
|  | 8704 | -C "SRTP Extension negotiated, profile" | 
|  | 8705 |  | 
|  | 8706 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8708 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ | 
|  | 8709 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 8710 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8711 | 0 \ | 
|  | 8712 | -s "found use_srtp extension" \ | 
|  | 8713 | -S "server hello, adding use_srtp extension" \ | 
|  | 8714 | -S "DTLS-SRTP key material is"\ | 
|  | 8715 | -C "SRTP Extension negotiated, profile" | 
|  | 8716 |  | 
|  | 8717 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8719 | run_test  "DTLS-SRTP all profiles supported. openssl server" \ | 
|  | 8720 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8721 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8722 | 0 \ | 
|  | 8723 | -c "client hello, adding use_srtp extension" \ | 
|  | 8724 | -c "found use_srtp extension" \ | 
|  | 8725 | -c "found srtp profile" \ | 
|  | 8726 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
|  | 8727 | -c "DTLS-SRTP key material is"\ | 
|  | 8728 | -C "error" | 
|  | 8729 |  | 
|  | 8730 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8732 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ | 
|  | 8733 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8734 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8735 | 0 \ | 
|  | 8736 | -c "client hello, adding use_srtp extension" \ | 
|  | 8737 | -c "found use_srtp extension" \ | 
|  | 8738 | -c "found srtp profile" \ | 
|  | 8739 | -c "selected srtp profile" \ | 
|  | 8740 | -c "DTLS-SRTP key material is"\ | 
|  | 8741 | -C "error" | 
|  | 8742 |  | 
|  | 8743 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8745 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ | 
|  | 8746 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8747 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8748 | 0 \ | 
|  | 8749 | -c "client hello, adding use_srtp extension" \ | 
|  | 8750 | -c "found use_srtp extension" \ | 
|  | 8751 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 8752 | -c "selected srtp profile" \ | 
|  | 8753 | -c "DTLS-SRTP key material is"\ | 
|  | 8754 | -C "error" | 
|  | 8755 |  | 
|  | 8756 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8758 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ | 
|  | 8759 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8760 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8761 | 0 \ | 
|  | 8762 | -c "client hello, adding use_srtp extension" \ | 
|  | 8763 | -c "found use_srtp extension" \ | 
|  | 8764 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 8765 | -c "selected srtp profile" \ | 
|  | 8766 | -c "DTLS-SRTP key material is"\ | 
|  | 8767 | -C "error" | 
|  | 8768 |  | 
|  | 8769 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8771 | run_test  "DTLS-SRTP server and Client support only one matching profile. openssl server." \ | 
|  | 8772 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8773 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8774 | 0 \ | 
|  | 8775 | -c "client hello, adding use_srtp extension" \ | 
|  | 8776 | -c "found use_srtp extension" \ | 
|  | 8777 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 8778 | -c "selected srtp profile" \ | 
|  | 8779 | -c "DTLS-SRTP key material is"\ | 
|  | 8780 | -C "error" | 
|  | 8781 |  | 
|  | 8782 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8784 | run_test  "DTLS-SRTP server and Client support only one different profile. openssl server." \ | 
|  | 8785 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8786 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ | 
|  | 8787 | 0 \ | 
|  | 8788 | -c "client hello, adding use_srtp extension" \ | 
|  | 8789 | -C "found use_srtp extension" \ | 
|  | 8790 | -C "found srtp profile" \ | 
|  | 8791 | -C "selected srtp profile" \ | 
|  | 8792 | -C "DTLS-SRTP key material is"\ | 
|  | 8793 | -C "error" | 
|  | 8794 |  | 
|  | 8795 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8797 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ | 
|  | 8798 | "$O_SRV -dtls" \ | 
|  | 8799 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8800 | 0 \ | 
|  | 8801 | -c "client hello, adding use_srtp extension" \ | 
|  | 8802 | -C "found use_srtp extension" \ | 
|  | 8803 | -C "found srtp profile" \ | 
|  | 8804 | -C "selected srtp profile" \ | 
|  | 8805 | -C "DTLS-SRTP key material is"\ | 
|  | 8806 | -C "error" | 
|  | 8807 |  | 
|  | 8808 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8810 | run_test  "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ | 
|  | 8811 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 8812 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 8813 | 0 \ | 
|  | 8814 | -c "client hello, adding use_srtp extension" \ | 
|  | 8815 | -c "found use_srtp extension" \ | 
|  | 8816 | -c "found srtp profile" \ | 
|  | 8817 | -c "selected srtp profile" \ | 
|  | 8818 | -c "DTLS-SRTP key material is"\ | 
|  | 8819 | -c "DTLS-SRTP no mki value negotiated"\ | 
|  | 8820 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 8821 | -C "dumping 'received mki' (8 bytes)" \ | 
|  | 8822 | -C "error" | 
|  | 8823 |  | 
|  | 8824 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8825 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8827 | run_test  "DTLS-SRTP all profiles supported. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8828 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8829 | "$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] | 8830 | 0 \ | 
|  | 8831 | -s "found use_srtp extension" \ | 
|  | 8832 | -s "found srtp profile" \ | 
|  | 8833 | -s "selected srtp profile" \ | 
|  | 8834 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8835 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8836 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" | 
|  | 8837 |  | 
|  | 8838 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8839 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8841 | 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] | 8842 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8843 | "$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] | 8844 | 0 \ | 
|  | 8845 | -s "found use_srtp extension" \ | 
|  | 8846 | -s "found srtp profile" \ | 
|  | 8847 | -s "selected srtp profile" \ | 
|  | 8848 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8849 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8850 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" | 
|  | 8851 |  | 
|  | 8852 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8853 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8855 | 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] | 8856 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8857 | "$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] | 8858 | 0 \ | 
|  | 8859 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8860 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 8861 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8862 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8863 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8864 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" | 
|  | 8865 |  | 
|  | 8866 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8867 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8869 | 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] | 8870 | "$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] | 8871 | "$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] | 8872 | 0 \ | 
|  | 8873 | -s "found use_srtp extension" \ | 
|  | 8874 | -s "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8875 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8876 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8877 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8878 | -c "SRTP profile: SRTP_NULL_SHA1_32" | 
|  | 8879 |  | 
|  | 8880 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8881 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8883 | 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] | 8884 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8885 | "$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] | 8886 | 0 \ | 
|  | 8887 | -s "found use_srtp extension" \ | 
|  | 8888 | -s "found srtp profile" \ | 
|  | 8889 | -s "selected srtp profile" \ | 
|  | 8890 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8891 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8892 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" | 
|  | 8893 |  | 
|  | 8894 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8895 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8897 | 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] | 8898 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ | 
|  | 8899 | "$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] | 8900 | 0 \ | 
|  | 8901 | -s "found use_srtp extension" \ | 
|  | 8902 | -s "found srtp profile" \ | 
|  | 8903 | -S "selected srtp profile" \ | 
|  | 8904 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8905 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8906 | -C "SRTP profile:" | 
|  | 8907 |  | 
|  | 8908 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8909 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8911 | 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] | 8912 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 8913 | "$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] | 8914 | 0 \ | 
|  | 8915 | -s "found use_srtp extension" \ | 
|  | 8916 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8917 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8918 | -C "SRTP profile:" | 
|  | 8919 |  | 
|  | 8920 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8921 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8923 | run_test  "DTLS-SRTP all profiles supported. gnutls server" \ | 
|  | 8924 | "$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" \ | 
|  | 8925 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8926 | 0 \ | 
|  | 8927 | -c "client hello, adding use_srtp extension" \ | 
|  | 8928 | -c "found use_srtp extension" \ | 
|  | 8929 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8930 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8931 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8932 | -C "error" | 
|  | 8933 |  | 
|  | 8934 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8935 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8937 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ | 
|  | 8938 | "$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" \ | 
|  | 8939 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8940 | 0 \ | 
|  | 8941 | -c "client hello, adding use_srtp extension" \ | 
|  | 8942 | -c "found use_srtp extension" \ | 
|  | 8943 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8944 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8945 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8946 | -C "error" | 
|  | 8947 |  | 
|  | 8948 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8949 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8951 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ | 
|  | 8952 | "$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" \ | 
|  | 8953 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8954 | 0 \ | 
|  | 8955 | -c "client hello, adding use_srtp extension" \ | 
|  | 8956 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8957 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8958 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8959 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8960 | -C "error" | 
|  | 8961 |  | 
|  | 8962 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8963 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8965 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ | 
|  | 8966 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8967 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8968 | 0 \ | 
|  | 8969 | -c "client hello, adding use_srtp extension" \ | 
|  | 8970 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8971 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8972 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8973 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8974 | -C "error" | 
|  | 8975 |  | 
|  | 8976 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8977 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8978 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8979 | run_test  "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ | 
|  | 8980 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 8981 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8982 | 0 \ | 
|  | 8983 | -c "client hello, adding use_srtp extension" \ | 
|  | 8984 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8985 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8986 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8987 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8988 | -C "error" | 
|  | 8989 |  | 
|  | 8990 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8991 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8993 | run_test  "DTLS-SRTP server and Client support only one different profile. gnutls server." \ | 
|  | 8994 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8995 | "$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] | 8996 | 0 \ | 
|  | 8997 | -c "client hello, adding use_srtp extension" \ | 
|  | 8998 | -C "found use_srtp extension" \ | 
|  | 8999 | -C "found srtp profile" \ | 
|  | 9000 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9001 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9002 | -C "error" | 
|  | 9003 |  | 
|  | 9004 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9005 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9007 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ | 
|  | 9008 | "$G_SRV -u" \ | 
|  | 9009 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9010 | 0 \ | 
|  | 9011 | -c "client hello, adding use_srtp extension" \ | 
|  | 9012 | -C "found use_srtp extension" \ | 
|  | 9013 | -C "found srtp profile" \ | 
|  | 9014 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9015 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9016 | -C "error" | 
|  | 9017 |  | 
|  | 9018 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9019 | requires_gnutls | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9021 | run_test  "DTLS-SRTP all profiles supported. mki used. gnutls server." \ | 
|  | 9022 | "$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" \ | 
|  | 9023 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 9024 | 0 \ | 
|  | 9025 | -c "client hello, adding use_srtp extension" \ | 
|  | 9026 | -c "found use_srtp extension" \ | 
|  | 9027 | -c "found srtp profile" \ | 
|  | 9028 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9029 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9030 | -c "DTLS-SRTP mki value:"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9031 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 9032 | -c "dumping 'received mki' (8 bytes)" \ | 
|  | 9033 | -C "error" | 
|  | 9034 |  | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9035 | # Tests for specific things with "unreliable" UDP connection | 
|  | 9036 |  | 
|  | 9037 | not_with_valgrind # spurious resend due to timeout | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9038 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9039 | run_test    "DTLS proxy: reference" \ | 
|  | 9040 | -p "$P_PXY" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9041 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ | 
|  | 9042 | "$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] | 9043 | 0 \ | 
|  | 9044 | -C "replayed record" \ | 
|  | 9045 | -S "replayed record" \ | 
| Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9046 | -C "Buffer record from epoch" \ | 
|  | 9047 | -S "Buffer record from epoch" \ | 
|  | 9048 | -C "ssl_buffer_message" \ | 
|  | 9049 | -S "ssl_buffer_message" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9050 | -C "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9051 | -S "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9052 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9053 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9054 | -c "HTTP/1.0 200 OK" | 
|  | 9055 |  | 
|  | 9056 | not_with_valgrind # spurious resend due to timeout | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9058 | run_test    "DTLS proxy: duplicate every packet" \ | 
|  | 9059 | -p "$P_PXY duplicate=1" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9060 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ | 
|  | 9061 | "$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] | 9062 | 0 \ | 
|  | 9063 | -c "replayed record" \ | 
|  | 9064 | -s "replayed record" \ | 
|  | 9065 | -c "record from another epoch" \ | 
|  | 9066 | -s "record from another epoch" \ | 
|  | 9067 | -S "resend" \ | 
|  | 9068 | -s "Extra-header:" \ | 
|  | 9069 | -c "HTTP/1.0 200 OK" | 
|  | 9070 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9072 | run_test    "DTLS proxy: duplicate every packet, server anti-replay off" \ | 
|  | 9073 | -p "$P_PXY duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9074 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ | 
|  | 9075 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9076 | 0 \ | 
|  | 9077 | -c "replayed record" \ | 
|  | 9078 | -S "replayed record" \ | 
|  | 9079 | -c "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9080 | -s "record from another epoch" \ | 
|  | 9081 | -c "resend" \ | 
|  | 9082 | -s "resend" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9083 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9084 | -c "HTTP/1.0 200 OK" | 
|  | 9085 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9087 | run_test    "DTLS proxy: multiple records in same datagram" \ | 
|  | 9088 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9089 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 9090 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9091 | 0 \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9092 | -c "next record in same datagram" \ | 
|  | 9093 | -s "next record in same datagram" | 
|  | 9094 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9096 | run_test    "DTLS proxy: multiple records in same datagram, duplicate every packet" \ | 
|  | 9097 | -p "$P_PXY pack=50 duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9098 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 9099 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9100 | 0 \ | 
|  | 9101 | -c "next record in same datagram" \ | 
|  | 9102 | -s "next record in same datagram" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9103 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9105 | run_test    "DTLS proxy: inject invalid AD record, default badmac_limit" \ | 
|  | 9106 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9107 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ | 
|  | 9108 | "$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] | 9109 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9110 | -c "discarding invalid record (mac)" \ | 
|  | 9111 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9112 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9113 | -c "HTTP/1.0 200 OK" \ | 
|  | 9114 | -S "too many records with bad MAC" \ | 
|  | 9115 | -S "Verification of the message MAC failed" | 
|  | 9116 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9118 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 1" \ | 
|  | 9119 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9120 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ | 
|  | 9121 | "$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] | 9122 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9123 | -C "discarding invalid record (mac)" \ | 
|  | 9124 | -S "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9125 | -S "Extra-header:" \ | 
|  | 9126 | -C "HTTP/1.0 200 OK" \ | 
|  | 9127 | -s "too many records with bad MAC" \ | 
|  | 9128 | -s "Verification of the message MAC failed" | 
|  | 9129 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9131 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2" \ | 
|  | 9132 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9133 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ | 
|  | 9134 | "$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] | 9135 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9136 | -c "discarding invalid record (mac)" \ | 
|  | 9137 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9138 | -s "Extra-header:" \ | 
|  | 9139 | -c "HTTP/1.0 200 OK" \ | 
|  | 9140 | -S "too many records with bad MAC" \ | 
|  | 9141 | -S "Verification of the message MAC failed" | 
|  | 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 | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9144 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ | 
|  | 9145 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9146 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ | 
|  | 9147 | "$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] | 9148 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9149 | -c "discarding invalid record (mac)" \ | 
|  | 9150 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9151 | -s "Extra-header:" \ | 
|  | 9152 | -c "HTTP/1.0 200 OK" \ | 
|  | 9153 | -s "too many records with bad MAC" \ | 
|  | 9154 | -s "Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9155 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9157 | run_test    "DTLS proxy: delay ChangeCipherSpec" \ | 
|  | 9158 | -p "$P_PXY delay_ccs=1" \ | 
| Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9159 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ | 
|  | 9160 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9161 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9162 | -c "record from another epoch" \ | 
|  | 9163 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9164 | -s "Extra-header:" \ | 
|  | 9165 | -c "HTTP/1.0 200 OK" | 
|  | 9166 |  | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9167 | # Tests for reordering support with DTLS | 
|  | 9168 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9170 | run_test    "DTLS reordering: Buffer out-of-order handshake message on client" \ | 
|  | 9171 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9172 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9173 | hs_timeout=2500-60000" \ | 
|  | 9174 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9175 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9176 | 0 \ | 
|  | 9177 | -c "Buffering HS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9178 | -c "Next handshake message has been buffered - load"\ | 
|  | 9179 | -S "Buffering HS message" \ | 
|  | 9180 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9181 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9182 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9183 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9184 | -S "Remember CCS message" | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9185 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9187 | run_test    "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ | 
|  | 9188 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9189 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9190 | hs_timeout=2500-60000" \ | 
|  | 9191 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9192 | hs_timeout=2500-60000" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9193 | 0 \ | 
|  | 9194 | -c "Buffering HS message" \ | 
|  | 9195 | -c "found fragmented DTLS handshake message"\ | 
|  | 9196 | -c "Next handshake message 1 not or only partially bufffered" \ | 
|  | 9197 | -c "Next handshake message has been buffered - load"\ | 
|  | 9198 | -S "Buffering HS message" \ | 
|  | 9199 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9200 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9201 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9202 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9203 | -S "Remember CCS message" | 
|  | 9204 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9205 | # The client buffers the ServerKeyExchange before receiving the fragmented | 
|  | 9206 | # Certificate message; at the time of writing, together these are aroudn 1200b | 
|  | 9207 | # in size, so that the bound below ensures that the certificate can be reassembled | 
|  | 9208 | # while keeping the ServerKeyExchange. | 
|  | 9209 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9211 | 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] | 9212 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9213 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9214 | hs_timeout=2500-60000" \ | 
|  | 9215 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9216 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9217 | 0 \ | 
|  | 9218 | -c "Buffering HS message" \ | 
|  | 9219 | -c "Next handshake message has been buffered - load"\ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9220 | -C "attempt to make space by freeing buffered messages" \ | 
|  | 9221 | -S "Buffering HS message" \ | 
|  | 9222 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9223 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9224 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9225 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9226 | -S "Remember CCS message" | 
|  | 9227 |  | 
|  | 9228 | # The size constraints ensure that the delayed certificate message can't | 
|  | 9229 | # be reassembled while keeping the ServerKeyExchange message, but it can | 
|  | 9230 | # when dropping it first. | 
|  | 9231 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 | 
|  | 9232 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9234 | run_test    "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ | 
|  | 9235 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9236 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9237 | hs_timeout=2500-60000" \ | 
|  | 9238 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9239 | hs_timeout=2500-60000" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9240 | 0 \ | 
|  | 9241 | -c "Buffering HS message" \ | 
|  | 9242 | -c "attempt to make space by freeing buffered future messages" \ | 
|  | 9243 | -c "Enough space available after freeing buffered HS messages" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9244 | -S "Buffering HS message" \ | 
|  | 9245 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9246 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9247 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9248 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9249 | -S "Remember CCS message" | 
|  | 9250 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9252 | run_test    "DTLS reordering: Buffer out-of-order handshake message on server" \ | 
|  | 9253 | -p "$P_PXY delay_cli=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9254 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ | 
|  | 9255 | hs_timeout=2500-60000" \ | 
|  | 9256 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9257 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9258 | 0 \ | 
|  | 9259 | -C "Buffering HS message" \ | 
|  | 9260 | -C "Next handshake message has been buffered - load"\ | 
|  | 9261 | -s "Buffering HS message" \ | 
|  | 9262 | -s "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9263 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9264 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9265 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9266 | -S "Remember CCS message" | 
|  | 9267 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9269 | run_test    "DTLS reordering: Buffer out-of-order CCS message on client"\ | 
|  | 9270 | -p "$P_PXY delay_srv=NewSessionTicket" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9271 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9272 | hs_timeout=2500-60000" \ | 
|  | 9273 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9274 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9275 | 0 \ | 
|  | 9276 | -C "Buffering HS message" \ | 
|  | 9277 | -C "Next handshake message has been buffered - load"\ | 
|  | 9278 | -S "Buffering HS message" \ | 
|  | 9279 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9280 | -c "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9281 | -c "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9282 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9283 | -S "Remember CCS message" | 
|  | 9284 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9286 | run_test    "DTLS reordering: Buffer out-of-order CCS message on server"\ | 
|  | 9287 | -p "$P_PXY delay_cli=ClientKeyExchange" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9288 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9289 | hs_timeout=2500-60000" \ | 
|  | 9290 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9291 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9292 | 0 \ | 
|  | 9293 | -C "Buffering HS message" \ | 
|  | 9294 | -C "Next handshake message has been buffered - load"\ | 
|  | 9295 | -S "Buffering HS message" \ | 
|  | 9296 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9297 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9298 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9299 | -s "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9300 | -s "Remember CCS message" | 
|  | 9301 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9303 | run_test    "DTLS reordering: Buffer encrypted Finished message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9304 | -p "$P_PXY delay_ccs=1" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9305 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9306 | hs_timeout=2500-60000" \ | 
|  | 9307 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9308 | hs_timeout=2500-60000" \ | 
| Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9309 | 0 \ | 
|  | 9310 | -s "Buffer record from epoch 1" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9311 | -s "Found buffered record from current epoch - load" \ | 
|  | 9312 | -c "Buffer record from epoch 1" \ | 
|  | 9313 | -c "Found buffered record from current epoch - load" | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9314 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9315 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec | 
|  | 9316 | # from the server are delayed, so that the encrypted Finished message | 
|  | 9317 | # is received and buffered. When the fragmented NewSessionTicket comes | 
|  | 9318 | # in afterwards, the encrypted Finished message must be freed in order | 
|  | 9319 | # to make space for the NewSessionTicket to be reassembled. | 
|  | 9320 | # This works only in very particular circumstances: | 
|  | 9321 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering | 
|  | 9322 | #   of the NewSessionTicket, but small enough to also allow buffering of | 
|  | 9323 | #   the encrypted Finished message. | 
|  | 9324 | # - The MTU setting on the server must be so small that the NewSessionTicket | 
|  | 9325 | #   needs to be fragmented. | 
|  | 9326 | # - All messages sent by the server must be small enough to be either sent | 
|  | 9327 | #   without fragmentation or be reassembled within the bounds of | 
|  | 9328 | #   MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based | 
|  | 9329 | #   handshake, omitting CRTs. | 
| Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9330 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 | 
|  | 9331 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9333 | run_test    "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ | 
|  | 9334 | -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] | 9335 | "$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] | 9336 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ | 
|  | 9337 | 0 \ | 
|  | 9338 | -s "Buffer record from epoch 1" \ | 
|  | 9339 | -s "Found buffered record from current epoch - load" \ | 
|  | 9340 | -c "Buffer record from epoch 1" \ | 
|  | 9341 | -C "Found buffered record from current epoch - load" \ | 
|  | 9342 | -c "Enough space available after freeing future epoch record" | 
|  | 9343 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9344 | # Tests for "randomly unreliable connection": try a variety of flows and peers | 
|  | 9345 |  | 
|  | 9346 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9348 | run_test    "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ | 
|  | 9349 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9350 | "$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] | 9351 | psk=abc123" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9352 | "$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] | 9353 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9354 | 0 \ | 
|  | 9355 | -s "Extra-header:" \ | 
|  | 9356 | -c "HTTP/1.0 200 OK" | 
|  | 9357 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9358 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9360 | run_test    "DTLS proxy: 3d, \"short\" RSA handshake" \ | 
|  | 9361 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9362 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 9363 | "$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] | 9364 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 9365 | 0 \ | 
|  | 9366 | -s "Extra-header:" \ | 
|  | 9367 | -c "HTTP/1.0 200 OK" | 
|  | 9368 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9369 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9371 | run_test    "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ | 
|  | 9372 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9373 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 9374 | "$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] | 9375 | 0 \ | 
|  | 9376 | -s "Extra-header:" \ | 
|  | 9377 | -c "HTTP/1.0 200 OK" | 
|  | 9378 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9379 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9381 | run_test    "DTLS proxy: 3d, FS, client auth" \ | 
|  | 9382 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9383 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ | 
|  | 9384 | "$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] | 9385 | 0 \ | 
|  | 9386 | -s "Extra-header:" \ | 
|  | 9387 | -c "HTTP/1.0 200 OK" | 
|  | 9388 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9389 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9391 | run_test    "DTLS proxy: 3d, FS, ticket" \ | 
|  | 9392 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9393 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ | 
|  | 9394 | "$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] | 9395 | 0 \ | 
|  | 9396 | -s "Extra-header:" \ | 
|  | 9397 | -c "HTTP/1.0 200 OK" | 
|  | 9398 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9399 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9401 | run_test    "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ | 
|  | 9402 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9403 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ | 
|  | 9404 | "$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] | 9405 | 0 \ | 
|  | 9406 | -s "Extra-header:" \ | 
|  | 9407 | -c "HTTP/1.0 200 OK" | 
|  | 9408 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9409 | client_needs_more_time 2 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9411 | run_test    "DTLS proxy: 3d, max handshake, nbio" \ | 
|  | 9412 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9413 | "$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] | 9414 | auth_mode=required" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9415 | "$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] | 9416 | 0 \ | 
|  | 9417 | -s "Extra-header:" \ | 
|  | 9418 | -c "HTTP/1.0 200 OK" | 
|  | 9419 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9420 | client_needs_more_time 4 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9422 | run_test    "DTLS proxy: 3d, min handshake, resumption" \ | 
|  | 9423 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9424 | "$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] | 9425 | psk=abc123 debug_level=3" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9426 | "$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] | 9427 | 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] | 9428 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9429 | 0 \ | 
|  | 9430 | -s "a session has been resumed" \ | 
|  | 9431 | -c "a session has been resumed" \ | 
|  | 9432 | -s "Extra-header:" \ | 
|  | 9433 | -c "HTTP/1.0 200 OK" | 
|  | 9434 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9435 | client_needs_more_time 4 | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9437 | run_test    "DTLS proxy: 3d, min handshake, resumption, nbio" \ | 
|  | 9438 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9439 | "$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] | 9440 | psk=abc123 debug_level=3 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9441 | "$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] | 9442 | 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] | 9443 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ | 
|  | 9444 | 0 \ | 
|  | 9445 | -s "a session has been resumed" \ | 
|  | 9446 | -c "a session has been resumed" \ | 
|  | 9447 | -s "Extra-header:" \ | 
|  | 9448 | -c "HTTP/1.0 200 OK" | 
|  | 9449 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9450 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9451 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9453 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego" \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9454 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9455 | "$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] | 9456 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9457 | "$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] | 9458 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9459 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9460 | 0 \ | 
|  | 9461 | -c "=> renegotiate" \ | 
|  | 9462 | -s "=> renegotiate" \ | 
|  | 9463 | -s "Extra-header:" \ | 
|  | 9464 | -c "HTTP/1.0 200 OK" | 
|  | 9465 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9466 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9467 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9469 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ | 
|  | 9470 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9471 | "$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] | 9472 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9473 | "$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] | 9474 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9475 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9476 | 0 \ | 
|  | 9477 | -c "=> renegotiate" \ | 
|  | 9478 | -s "=> renegotiate" \ | 
|  | 9479 | -s "Extra-header:" \ | 
|  | 9480 | -c "HTTP/1.0 200 OK" | 
|  | 9481 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9482 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9483 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9485 | run_test    "DTLS proxy: 3d, min handshake, server-initiated renego" \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9486 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9487 | "$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] | 9488 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9489 | debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9490 | "$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] | 9491 | renegotiation=1 exchanges=4 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9492 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9493 | 0 \ | 
|  | 9494 | -c "=> renegotiate" \ | 
|  | 9495 | -s "=> renegotiate" \ | 
|  | 9496 | -s "Extra-header:" \ | 
|  | 9497 | -c "HTTP/1.0 200 OK" | 
|  | 9498 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9499 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9500 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9502 | 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] | 9503 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9504 | "$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] | 9505 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9506 | debug_level=2 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9507 | "$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] | 9508 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9509 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9510 | 0 \ | 
|  | 9511 | -c "=> renegotiate" \ | 
|  | 9512 | -s "=> renegotiate" \ | 
|  | 9513 | -s "Extra-header:" \ | 
|  | 9514 | -c "HTTP/1.0 200 OK" | 
|  | 9515 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9516 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including | 
|  | 9517 | ## all versions installed on the CI machines), reported here: | 
|  | 9518 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
|  | 9519 | ## They should be re-enabled once a fixed version of OpenSSL is available | 
|  | 9520 | ## (this should happen in some 1.1.1_ release according to the ticket). | 
|  | 9521 | skip_next_test | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9522 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9523 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9525 | run_test    "DTLS proxy: 3d, openssl server" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9526 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 9527 | "$O_SRV -dtls1 -mtu 2048" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9528 | "$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] | 9529 | 0 \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9530 | -c "HTTP/1.0 200 OK" | 
|  | 9531 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9532 | skip_next_test # see above | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9533 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9534 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9536 | run_test    "DTLS proxy: 3d, openssl server, fragmentation" \ | 
|  | 9537 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 9538 | "$O_SRV -dtls1 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9539 | "$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] | 9540 | 0 \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9541 | -c "HTTP/1.0 200 OK" | 
|  | 9542 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9543 | skip_next_test # see above | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9544 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9545 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9547 | run_test    "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ | 
|  | 9548 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 9549 | "$O_SRV -dtls1 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9550 | "$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] | 9551 | 0 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9552 | -c "HTTP/1.0 200 OK" | 
|  | 9553 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9554 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9555 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9556 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9558 | run_test    "DTLS proxy: 3d, gnutls server" \ | 
|  | 9559 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 9560 | "$G_SRV -u --mtu 2048 -a" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9561 | "$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] | 9562 | 0 \ | 
|  | 9563 | -s "Extra-header:" \ | 
|  | 9564 | -c "Extra-header:" | 
|  | 9565 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9566 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9567 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9568 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9570 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation" \ | 
|  | 9571 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9572 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9573 | "$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] | 9574 | 0 \ | 
|  | 9575 | -s "Extra-header:" \ | 
|  | 9576 | -c "Extra-header:" | 
|  | 9577 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9578 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9579 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9580 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9582 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ | 
|  | 9583 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9584 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9585 | "$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] | 9586 | 0 \ | 
|  | 9587 | -s "Extra-header:" \ | 
|  | 9588 | -c "Extra-header:" | 
|  | 9589 |  | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9591 | run_test    "export keys functionality" \ | 
|  | 9592 | "$P_SRV eap_tls=1 debug_level=3" \ | 
|  | 9593 | "$P_CLI eap_tls=1 debug_level=3" \ | 
|  | 9594 | 0 \ | 
| Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9595 | -c "EAP-TLS key material is:"\ | 
|  | 9596 | -s "EAP-TLS key material is:"\ | 
|  | 9597 | -c "EAP-TLS IV is:" \ | 
|  | 9598 | -s "EAP-TLS IV is:" | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9599 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9600 | # openssl feature tests: check if tls1.3 exists. | 
|  | 9601 | requires_openssl_tls1_3 | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9602 | run_test    "TLS 1.3: Test openssl tls1_3 feature" \ | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9603 | "$O_NEXT_SRV -tls1_3 -msg" \ | 
|  | 9604 | "$O_NEXT_CLI -tls1_3 -msg" \ | 
|  | 9605 | 0 \ | 
|  | 9606 | -c "TLS 1.3" \ | 
|  | 9607 | -s "TLS 1.3" | 
|  | 9608 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 9609 | # 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] | 9610 | requires_gnutls_tls1_3 | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9611 | requires_gnutls_next_no_ticket | 
|  | 9612 | requires_gnutls_next_disable_tls13_compat | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9613 | run_test    "TLS 1.3: Test gnutls tls1_3 feature" \ | 
| Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9614 | "$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] | 9615 | "$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] | 9616 | 0 \ | 
|  | 9617 | -s "Version: TLS1.3" \ | 
|  | 9618 | -c "Version: TLS1.3" | 
|  | 9619 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9620 | # TLS1.3 test cases | 
|  | 9621 | # TODO: remove or rewrite this test case if #4832 is resolved. | 
|  | 9622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9624 | skip_handshake_stage_check | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9625 | run_test    "TLS 1.3: Not supported version check: tls12 and tls13" \ | 
| Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9626 | "$P_SRV debug_level=1 min_version=tls12 max_version=tls13" \ | 
|  | 9627 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9628 | 1 \ | 
|  | 9629 | -s "SSL - The requested feature is not available" \ | 
|  | 9630 | -c "SSL - The requested feature is not available" \ | 
|  | 9631 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ | 
|  | 9632 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" | 
|  | 9633 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9635 | run_test    "TLS 1.3: handshake dispatch test: tls13 only" \ | 
| Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9636 | "$P_SRV debug_level=2 min_version=tls13 max_version=tls13" \ | 
|  | 9637 | "$P_CLI debug_level=2 min_version=tls13 max_version=tls13" \ | 
| Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9638 | 1 \ | 
| Jerry Yu | e3b3412 | 2021-09-28 17:53:35 +0800 | [diff] [blame] | 9639 | -s "tls13 server state: MBEDTLS_SSL_HELLO_REQUEST"     \ | 
|  | 9640 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST" | 
| Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9641 |  | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9642 | requires_openssl_tls1_3 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9644 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9645 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9646 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9647 | run_test    "TLS 1.3: minimal feature sets - openssl" \ | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9648 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ | 
| Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9649 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ | 
| Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9650 | 0 \ | 
| Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9651 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)"               \ | 
|  | 9652 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)"                \ | 
|  | 9653 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)"       \ | 
|  | 9654 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)"         \ | 
|  | 9655 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)"          \ | 
|  | 9656 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)"          \ | 
|  | 9657 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)"            \ | 
|  | 9658 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)"            \ | 
|  | 9659 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)"              \ | 
|  | 9660 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)"           \ | 
| Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9661 | -c "<= ssl_tls13_process_server_hello" \ | 
| Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9662 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ | 
|  | 9663 | -c "ECDH curve: x25519"         \ | 
| Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9664 | -c "=> ssl_tls13_process_server_hello" \ | 
| Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9665 | -c "<= parse encrypted extensions"      \ | 
| Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9666 | -c "Certificate verification flags clear" \ | 
| Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9667 | -c "=> parse certificate verify"          \ | 
|  | 9668 | -c "<= parse certificate verify"          \ | 
| XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9669 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ | 
| Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9670 | -c "<= parse finished message" \ | 
| Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 9671 | -c "Protocol is TLSv1.3" \ | 
| Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9672 | -c "HTTP/1.0 200 ok" | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9673 |  | 
| Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 9674 | requires_gnutls_tls1_3 | 
| Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9675 | requires_gnutls_next_no_ticket | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9677 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9678 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9679 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9680 | run_test    "TLS 1.3: minimal feature sets - gnutls" \ | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9681 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ | 
| Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9682 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ | 
| Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9683 | 0 \ | 
| Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9684 | -s "SERVER HELLO was queued"    \ | 
|  | 9685 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)"               \ | 
|  | 9686 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)"                \ | 
|  | 9687 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)"       \ | 
|  | 9688 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)"         \ | 
|  | 9689 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)"          \ | 
|  | 9690 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)"          \ | 
|  | 9691 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)"            \ | 
|  | 9692 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)"            \ | 
|  | 9693 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)"              \ | 
|  | 9694 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)"           \ | 
| Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9695 | -c "<= ssl_tls13_process_server_hello" \ | 
| Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9696 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ | 
|  | 9697 | -c "ECDH curve: x25519"         \ | 
| Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9698 | -c "=> ssl_tls13_process_server_hello" \ | 
| Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9699 | -c "<= parse encrypted extensions"      \ | 
| Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9700 | -c "Certificate verification flags clear" \ | 
| Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9701 | -c "=> parse certificate verify"          \ | 
|  | 9702 | -c "<= parse certificate verify"          \ | 
| XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9703 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ | 
| Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9704 | -c "<= parse finished message" \ | 
| Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 9705 | -c "Protocol is TLSv1.3" \ | 
| Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9706 | -c "HTTP/1.0 200 OK" | 
| XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9707 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9709 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9710 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9711 | skip_handshake_stage_check | 
|  | 9712 | requires_gnutls_tls1_3 | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9713 | 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] | 9714 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ | 
| Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9715 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9716 | 1 \ | 
|  | 9717 | -s "Client's version: 3.3" \ | 
|  | 9718 | -c "is a fatal alert message (msg 40)" \ | 
|  | 9719 | -S "Version: TLS1.0" \ | 
|  | 9720 | -C "Protocol is TLSv1.0" | 
|  | 9721 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9723 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9724 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9725 | skip_handshake_stage_check | 
|  | 9726 | requires_gnutls_tls1_3 | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9727 | 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] | 9728 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ | 
| Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9729 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9730 | 1 \ | 
|  | 9731 | -s "Client's version: 3.3" \ | 
|  | 9732 | -c "is a fatal alert message (msg 40)" \ | 
|  | 9733 | -S "Version: TLS1.1" \ | 
|  | 9734 | -C "Protocol is TLSv1.1" | 
|  | 9735 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9737 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9738 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9739 | skip_handshake_stage_check | 
|  | 9740 | requires_gnutls_tls1_3 | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9741 | 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] | 9742 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ | 
| Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9743 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9744 | 1 \ | 
|  | 9745 | -s "Client's version: 3.3" \ | 
|  | 9746 | -c "is a fatal alert message (msg 40)" \ | 
|  | 9747 | -S "Version: TLS1.2" \ | 
|  | 9748 | -C "Protocol is TLSv1.2" | 
|  | 9749 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9751 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9752 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9753 | skip_handshake_stage_check | 
|  | 9754 | requires_openssl_next | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9755 | 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] | 9756 | "$O_NEXT_SRV -msg -tls1" \ | 
| Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9757 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9758 | 1 \ | 
|  | 9759 | -s "fatal protocol_version" \ | 
|  | 9760 | -c "is a fatal alert message (msg 70)" \ | 
|  | 9761 | -S "Version: TLS1.0" \ | 
|  | 9762 | -C "Protocol  : TLSv1.0" | 
|  | 9763 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9765 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9766 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9767 | skip_handshake_stage_check | 
|  | 9768 | requires_openssl_next | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9769 | 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] | 9770 | "$O_NEXT_SRV -msg -tls1_1" \ | 
| Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9771 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9772 | 1 \ | 
|  | 9773 | -s "fatal protocol_version" \ | 
|  | 9774 | -c "is a fatal alert message (msg 70)" \ | 
|  | 9775 | -S "Version: TLS1.1" \ | 
|  | 9776 | -C "Protocol  : TLSv1.1" | 
|  | 9777 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9779 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9780 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9781 | skip_handshake_stage_check | 
|  | 9782 | requires_openssl_next | 
| Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9783 | 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] | 9784 | "$O_NEXT_SRV -msg -tls1_2" \ | 
| Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9785 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ | 
| Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9786 | 1 \ | 
|  | 9787 | -s "fatal protocol_version" \ | 
|  | 9788 | -c "is a fatal alert message (msg 70)" \ | 
|  | 9789 | -S "Version: TLS1.2" \ | 
|  | 9790 | -C "Protocol  : TLSv1.2" | 
|  | 9791 |  | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 9792 | requires_openssl_tls1_3 | 
|  | 9793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9794 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9795 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9796 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9797 | run_test    "TLS 1.3: Client authentication, no client certificate - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9798 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -verify 10" \ | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 9799 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none \ | 
|  | 9800 | key_file=none" \ | 
|  | 9801 | 0 \ | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 9802 | -c "got a certificate request" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9803 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 9804 | -s "TLS 1.3" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9805 | -c "HTTP/1.0 200 ok" \ | 
|  | 9806 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9807 |  | 
|  | 9808 | requires_gnutls_tls1_3 | 
|  | 9809 | requires_gnutls_next_no_ticket | 
|  | 9810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9811 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9812 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9813 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9814 | run_test    "TLS 1.3: Client authentication, no client certificate - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9815 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --verify-client-cert" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9816 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13 crt_file=none \ | 
|  | 9817 | key_file=none" \ | 
|  | 9818 | 0 \ | 
|  | 9819 | -c "got a certificate request" \ | 
|  | 9820 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ | 
|  | 9821 | -s "Version: TLS1.3" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9822 | -c "HTTP/1.0 200 OK" \ | 
|  | 9823 | -c "Protocol is TLSv1.3" | 
|  | 9824 |  | 
| Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 9825 |  | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9826 | requires_openssl_tls1_3 | 
|  | 9827 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9828 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9829 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9830 | run_test    "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9831 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ | 
| Jerry Yu | 22abd06 | 2022-01-30 20:02:47 +0800 | [diff] [blame] | 9832 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cli2.crt \ | 
| Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 9833 | key_file=data_files/cli2.key" \ | 
| Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 9834 | 0 \ | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9835 | -c "got a certificate request" \ | 
| Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 9836 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9837 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 9838 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9839 |  | 
|  | 9840 | requires_gnutls_tls1_3 | 
|  | 9841 | requires_gnutls_next_no_ticket | 
|  | 9842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9843 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9844 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9845 | run_test    "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9846 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ | 
| Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 9847 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13 crt_file=data_files/cli2.crt \ | 
|  | 9848 | key_file=data_files/cli2.key" \ | 
| Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 9849 | 0 \ | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9850 | -c "got a certificate request" \ | 
| Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 9851 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9852 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 9853 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 9854 |  | 
|  | 9855 | requires_openssl_tls1_3 | 
|  | 9856 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9857 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9858 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9859 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9860 | run_test    "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9861 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9862 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/ecdsa_secp256r1.crt \ | 
|  | 9863 | key_file=data_files/ecdsa_secp256r1.key" \ | 
|  | 9864 | 0 \ | 
|  | 9865 | -c "got a certificate request" \ | 
|  | 9866 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9867 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 9868 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9869 |  | 
|  | 9870 | requires_gnutls_tls1_3 | 
|  | 9871 | requires_gnutls_next_no_ticket | 
|  | 9872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9873 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9874 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9875 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9876 | run_test    "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9877 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9878 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp256r1.crt \ | 
|  | 9879 | key_file=data_files/ecdsa_secp256r1.key" \ | 
|  | 9880 | 0 \ | 
|  | 9881 | -c "got a certificate request" \ | 
|  | 9882 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9883 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 9884 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9885 |  | 
|  | 9886 | requires_openssl_tls1_3 | 
|  | 9887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9888 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9889 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9890 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9891 | run_test    "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9892 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9893 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/ecdsa_secp384r1.crt \ | 
|  | 9894 | key_file=data_files/ecdsa_secp384r1.key" \ | 
|  | 9895 | 0 \ | 
|  | 9896 | -c "got a certificate request" \ | 
|  | 9897 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9898 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 9899 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9900 |  | 
|  | 9901 | requires_gnutls_tls1_3 | 
|  | 9902 | requires_gnutls_next_no_ticket | 
|  | 9903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9904 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9905 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9906 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9907 | run_test    "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9908 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9909 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp384r1.crt \ | 
|  | 9910 | key_file=data_files/ecdsa_secp384r1.key" \ | 
|  | 9911 | 0 \ | 
|  | 9912 | -c "got a certificate request" \ | 
|  | 9913 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9914 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 9915 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9916 |  | 
|  | 9917 | requires_openssl_tls1_3 | 
|  | 9918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9919 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9920 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9921 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9922 | run_test    "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9923 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9924 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/ecdsa_secp521r1.crt \ | 
|  | 9925 | key_file=data_files/ecdsa_secp521r1.key" \ | 
|  | 9926 | 0 \ | 
|  | 9927 | -c "got a certificate request" \ | 
|  | 9928 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9929 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 9930 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9931 |  | 
|  | 9932 | requires_gnutls_tls1_3 | 
|  | 9933 | requires_gnutls_next_no_ticket | 
|  | 9934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9935 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9936 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9937 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9938 | run_test    "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9939 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9940 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp521r1.crt \ | 
|  | 9941 | key_file=data_files/ecdsa_secp521r1.key" \ | 
|  | 9942 | 0 \ | 
|  | 9943 | -c "got a certificate request" \ | 
|  | 9944 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9945 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
|  | 9946 | -c "Protocol is TLSv1.3" | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9947 |  | 
|  | 9948 | requires_openssl_tls1_3 | 
|  | 9949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9950 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9951 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 9952 | requires_config_enabled MBEDTLS_RSA_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9953 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9954 | run_test    "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9955 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9956 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 9957 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ | 
|  | 9958 | 1 \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9959 | -c "got a certificate request" \ | 
|  | 9960 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9961 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 9962 | -c "unkown pk type" \ | 
|  | 9963 | -c "signature algorithm not in received or offered list." | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9964 |  | 
|  | 9965 | requires_gnutls_tls1_3 | 
|  | 9966 | requires_gnutls_next_no_ticket | 
|  | 9967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9968 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9969 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 9970 | requires_config_enabled MBEDTLS_RSA_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9971 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9972 | run_test    "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9973 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9974 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 9975 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ | 
|  | 9976 | 1 \ | 
| Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9977 | -c "got a certificate request" \ | 
|  | 9978 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
| Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9979 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 9980 | -c "unkown pk type" \ | 
|  | 9981 | -c "signature algorithm not in received or offered list." | 
| Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9982 |  | 
| Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 9983 | requires_openssl_tls1_3 | 
|  | 9984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 9985 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 9986 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 9987 | requires_config_enabled MBEDTLS_RSA_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9988 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 9989 | 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] | 9990 | "$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] | 9991 | -sigalgs ecdsa_secp256r1_sha256" \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 9992 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp521r1.crt \ | 
|  | 9993 | 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] | 9994 | 1 \ | 
|  | 9995 | -c "got a certificate request" \ | 
|  | 9996 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 9997 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 9998 | -c "signature algorithm not in received or offered list." \ | 
|  | 9999 | -C "unkown pk type" | 
| Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10000 |  | 
|  | 10001 | requires_gnutls_tls1_3 | 
|  | 10002 | requires_gnutls_next_no_ticket | 
|  | 10003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 10004 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10005 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
|  | 10006 | requires_config_enabled MBEDTLS_RSA_C | 
| Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10007 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 10008 | run_test    "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ | 
|  | 10009 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10010 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp521r1.crt \ | 
|  | 10011 | 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] | 10012 | 1 \ | 
|  | 10013 | -c "got a certificate request" \ | 
|  | 10014 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ | 
|  | 10015 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ | 
| Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10016 | -c "signature algorithm not in received or offered list." \ | 
|  | 10017 | -C "unkown pk type" | 
| Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10018 |  | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10020 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10021 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10022 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10023 | requires_openssl_tls1_3 | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10024 | run_test    "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ | 
|  | 10025 | "$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" \ | 
|  | 10026 | "$P_CLI debug_level=4 force_version=tls13" \ | 
|  | 10027 | 0 \ | 
|  | 10028 | -c "received HelloRetryRequest message" \ | 
| XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10029 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ | 
|  | 10030 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10031 | -c "HTTP/1.0 200 ok" | 
|  | 10032 |  | 
|  | 10033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 10034 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 10035 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10036 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10037 | requires_openssl_tls1_3 | 
|  | 10038 | run_test    "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_256_GCM_SHA384 - openssl" \ | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10039 | "$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" \ | 
| Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 10040 | "$P_CLI debug_level=4 force_version=tls13" \ | 
| XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 10041 | 0 \ | 
| Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10042 | -c "received HelloRetryRequest message" \ | 
| XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10043 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ | 
|  | 10044 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
| XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 10045 | -c "HTTP/1.0 200 ok" | 
| Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10046 |  | 
|  | 10047 | requires_gnutls_tls1_3 | 
|  | 10048 | requires_gnutls_next_no_ticket | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10050 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10051 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10052 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10053 | run_test    "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ | 
|  | 10054 | "$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" \ | 
|  | 10055 | "$P_CLI debug_level=4 force_version=tls13" \ | 
|  | 10056 | 0 \ | 
|  | 10057 | -c "received HelloRetryRequest message" \ | 
| XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10058 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ | 
|  | 10059 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10060 | -c "HTTP/1.0 200 OK" | 
|  | 10061 |  | 
|  | 10062 | requires_gnutls_tls1_3 | 
|  | 10063 | requires_gnutls_next_no_ticket | 
|  | 10064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
|  | 10065 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 10066 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10067 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10068 | run_test    "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_256_GCM_SHA384 - gnutls" \ | 
| XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10069 | "$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" \ | 
| Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 10070 | "$P_CLI debug_level=4 force_version=tls13" \ | 
| XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10071 | 0 \ | 
| Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10072 | -c "received HelloRetryRequest message" \ | 
| XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10073 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ | 
|  | 10074 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ | 
| XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10075 | -c "HTTP/1.0 200 OK" | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10076 |  | 
| Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 10077 | for i in opt-testcases/*.sh | 
| Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 10078 | do | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 10079 | TEST_SUITE_NAME=${i##*/} | 
|  | 10080 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} | 
|  | 10081 | . "$i" | 
| Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 10082 | done | 
| Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 10083 | unset TEST_SUITE_NAME | 
| Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 10084 |  | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10085 | requires_openssl_tls1_3 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10087 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10088 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10089 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10090 | 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] | 10091 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ | 
|  | 10092 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ | 
|  | 10093 | 0 \ | 
|  | 10094 | -c "HTTP/1.0 200 ok" | 
|  | 10095 |  | 
|  | 10096 | requires_openssl_tls1_3 | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10098 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
| Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10099 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10100 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10101 | 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] | 10102 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ | 
|  | 10103 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ | 
|  | 10104 | 1 \ | 
|  | 10105 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" | 
|  | 10106 |  | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10107 | requires_gnutls_tls1_3 | 
|  | 10108 | requires_gnutls_next_no_ticket | 
|  | 10109 | requires_gnutls_next_disable_tls13_compat | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10111 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 10112 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10113 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10114 | run_test    "TLS 1.3 m->G both peers do not support middlebox compatibility" \ | 
|  | 10115 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ | 
|  | 10116 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ | 
|  | 10117 | 0 \ | 
|  | 10118 | -c "HTTP/1.0 200 OK" | 
|  | 10119 |  | 
|  | 10120 | requires_gnutls_tls1_3 | 
|  | 10121 | requires_gnutls_next_no_ticket | 
| Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10123 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | 
|  | 10124 | requires_config_enabled MBEDTLS_DEBUG_C | 
|  | 10125 | requires_config_enabled MBEDTLS_SSL_CLI_C | 
| Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10126 | run_test    "TLS 1.3 m->G server with middlebox compat support, not client" \ | 
|  | 10127 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ | 
|  | 10128 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ | 
|  | 10129 | 1 \ | 
|  | 10130 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" | 
|  | 10131 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10132 | # Test heap memory usage after handshake | 
| Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10134 | requires_config_enabled MBEDTLS_MEMORY_DEBUG | 
|  | 10135 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C | 
|  | 10136 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10137 | requires_max_content_len 16384 | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10138 | run_tests_memory_after_hanshake | 
|  | 10139 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10140 | # Final report | 
|  | 10141 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10142 | echo "------------------------------------------------------------------------" | 
|  | 10143 |  | 
|  | 10144 | if [ $FAILS = 0 ]; then | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10145 | printf "PASSED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10146 | else | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10147 | printf "FAILED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10148 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10149 | PASSES=$(( $TESTS - $FAILS )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10150 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10151 |  | 
|  | 10152 | exit $FAILS |